use of ai.grakn.graql.internal.pattern.property.ValueProperty in project grakn by graknlabs.
the class GreedyTraversalPlan method processFragmentWithDependencies.
private static void processFragmentWithDependencies(Map<NodeId, Node> allNodes, Fragment fragment) {
// it's either neq or value fragment
Node start = Node.addIfAbsent(NodeId.NodeType.VAR, fragment.start(), allNodes);
Node other = Node.addIfAbsent(NodeId.NodeType.VAR, fragment.dependencies().iterator().next(), allNodes);
start.getFragmentsWithDependency().add(fragment);
other.getDependants().add(fragment);
// check whether it's value fragment
if (fragment.varProperty() instanceof ValueProperty) {
// as value fragment is not symmetric, we need to add it again
other.getFragmentsWithDependency().add(fragment);
start.getDependants().add(fragment);
}
}
use of ai.grakn.graql.internal.pattern.property.ValueProperty in project grakn by graknlabs.
the class ValuePredicate method extractPredicate.
private static ai.grakn.graql.ValuePredicate extractPredicate(VarPattern pattern) {
Iterator<ValueProperty> properties = pattern.admin().getProperties(ValueProperty.class).iterator();
ValueProperty property = properties.next();
if (properties.hasNext()) {
throw GraqlQueryException.valuePredicateAtomWithMultiplePredicates();
}
return property.predicate();
}
Aggregations