use of ai.grakn.graql.internal.pattern.property.VarPropertyInternal in project grakn by graknlabs.
the class ConjunctionQuery method equivalentFragmentSetsOfVar.
private static Stream<EquivalentFragmentSet> equivalentFragmentSetsOfVar(VarPatternAdmin var) {
Collection<EquivalentFragmentSet> traversals = new HashSet<>();
Var start = var.var();
var.getProperties().forEach(property -> {
VarPropertyInternal propertyInternal = (VarPropertyInternal) property;
Collection<EquivalentFragmentSet> newTraversals = propertyInternal.match(start);
traversals.addAll(newTraversals);
});
if (!traversals.isEmpty()) {
return traversals.stream();
} else {
// If this variable has no properties, only confirm that it is not internal and nothing else.
return Stream.of(EquivalentFragmentSets.notInternalFragmentSet(null, start));
}
}
Aggregations