Search in sources :

Example 1 with Predicate

use of ai.grakn.graql.internal.reasoner.atom.predicate.Predicate in project grakn by graknlabs.

the class RelationshipAtom method toString.

@Override
public String toString() {
    String typeString = getSchemaConcept() != null ? getSchemaConcept().getLabel().getValue() : "{" + inferPossibleTypes(new QueryAnswer()).stream().map(rt -> rt.getLabel().getValue()).collect(Collectors.joining(", ")) + "}";
    String relationString = (isUserDefined() ? getVarName() + " " : "") + typeString + (isDirect() ? "!" : "") + getRelationPlayers().toString();
    return relationString + getPredicates(Predicate.class).map(Predicate::toString).collect(Collectors.joining(""));
}
Also used : QueryAnswer(ai.grakn.graql.internal.query.QueryAnswer) ValuePredicate(ai.grakn.graql.internal.reasoner.atom.predicate.ValuePredicate) IdPredicate(ai.grakn.graql.internal.reasoner.atom.predicate.IdPredicate) Predicate(ai.grakn.graql.internal.reasoner.atom.predicate.Predicate)

Aggregations

QueryAnswer (ai.grakn.graql.internal.query.QueryAnswer)1 IdPredicate (ai.grakn.graql.internal.reasoner.atom.predicate.IdPredicate)1 Predicate (ai.grakn.graql.internal.reasoner.atom.predicate.Predicate)1 ValuePredicate (ai.grakn.graql.internal.reasoner.atom.predicate.ValuePredicate)1