Map<Relation, Set<Descriptor>> relations = new HashMap<Relation, Set<Descriptor>>();
for (Relationship relationship : node.getRelationships(Direction.OUTGOING)) {
Relation relation = Relation.getRelation(relationship.getType().name());
if (relation != null) {
Node targetNode = relationship.getEndNode();
Descriptor targetDescriptor = getDescriptor(targetNode);
Set<Descriptor> set = relations.get(relation);
if (set == null) {
set = new HashSet<>();
relations.put(relation, set);
}