@Override public void addEdgeLabelFilterToQuery(Query query, Collection<ElementTypeFilter> filters, String workspaceId) { checkNotNull(filters, "filters cannot be null"); if (filters.isEmpty()) { return; } Set<String> edgeIds = new HashSet<>(filters.size()); for (ElementTypeFilter filter : filters) { Relationship relationship = getRelationshipByIRI(filter.iri, workspaceId); checkNotNull(relationship, "Could not find edge with IRI: " + filter.iri); edgeIds.add(relationship.getIRI()); if (filter.includeChildNodes) { Set<Relationship> childRelations = getRelationshipAndAllChildren(relationship, workspaceId); edgeIds.addAll(childRelations.stream().map(Relationship::getIRI).collect(Collectors.toSet())); } } query.hasEdgeLabel(edgeIds); }
} else if (matchConstraint instanceof RelationshipMatchConstraint) { List<String> normalizedLabelNames = labelNamesStream.collect(Collectors.toList()); query = query.hasEdgeLabel(normalizedLabelNames); } else { throw new VertexiumCypherNotImplemented("unexpected constraint type: " + matchConstraint.getClass().getName());
} else if (matchConstraint instanceof RelationshipMatchConstraint) { List<String> normalizedLabelNames = labelNamesStream.collect(Collectors.toList()); query = query.hasEdgeLabel(normalizedLabelNames); } else { throw new VertexiumCypherNotImplemented("unexpected constraint type: " + matchConstraint.getClass().getName());