use of ai.grakn.graql.internal.reasoner.atom.predicate.IdPredicate in project grakn by graknlabs.
the class AbstractIsaProperty method mapToAtom.
@Nullable
@Override
public final Atomic mapToAtom(VarPatternAdmin var, Set<VarPatternAdmin> vars, ReasonerQuery parent) {
// IsaProperty is unique within a var, so skip if this is a relation
if (var.hasProperty(RelationshipProperty.class))
return null;
Var varName = var.var().asUserDefined();
VarPatternAdmin typePattern = this.type();
Var typeVariable = typePattern.var();
IdPredicate predicate = getIdPredicate(typeVariable, typePattern, vars, parent);
ConceptId predicateId = predicate != null ? predicate.getPredicate() : null;
// isa part
VarPatternAdmin isaVar = varPatternForAtom(varName, typeVariable).admin();
return IsaAtom.create(isaVar, typeVariable, predicateId, parent);
}
Aggregations