/** * Returns label for relationship on the graph, considering its "mandatory" * and "to-many" properties */ private static String getRelationshipLabel(Relationship rel) { if (rel == null) { return null; } if (rel.isToMany()) { return "0..*"; } return rel.isMandatory() ? "1" : "0..1"; }