public class ReasonerQueryImpl extends Object implements ReasonerQuery
Base reasoner query providing resolution and atom handling facilities for conjunctive graql queries.
public ReasonerQuery conjunction(ReasonerQuery q)
conjunction in interface ReasonerQuerypublic ReasonerQueryImpl withSubstitution(Answer sub)
sub - substitution to be inserted into the querypublic ReasonerQueryImpl inferTypes()
public ReasonerQueryImpl positive()
public ReasonerQueryImpl transformIds(Map<Var,ConceptId> transform)
transform - map defining id transform: var -> new idpublic ReasonerQuery copy()
public boolean isEquivalent(ReasonerQueryImpl q)
q - query to be compared withpublic GraknTx tx()
tx in interface ReasonerQuerypublic void checkValid()
checkValid in interface ReasonerQuerypublic Conjunction<PatternAdmin> getPattern()
public Set<String> validateOntologically()
validateOntologically in interface ReasonerQuerypublic boolean isRuleResolvable()
isRuleResolvable in interface ReasonerQuerypublic boolean isTypeRoleCompatible(Var typedVar, Type parentType)
isTypeRoleCompatible in interface ReasonerQuerytypedVar - variable of interestparentType - to be checkedpublic Set<Atomic> getAtoms()
getAtoms in interface ReasonerQuerypublic <T extends Atomic> java.util.stream.Stream<T> getAtoms(Class<T> type)
getAtoms in interface ReasonerQuerypublic Set<Var> getVarNames()
getVarNames in interface ReasonerQuerypublic MultiUnifier getMultiUnifier(ReasonerQuery parent)
public MultiUnifier getMultiUnifier(ReasonerQuery parent, UnifierComparison unifierType)
parent - query for which unifier to unify with should be foundunifierType - unifier typepublic GetQuery getQuery()
public com.google.common.collect.ImmutableMap<Var,Type> getVarTypeMap()
getVarTypeMap in interface ReasonerQuerypublic com.google.common.collect.ImmutableMap<Var,Type> getVarTypeMap(Answer sub)
getVarTypeMap in interface ReasonerQuerypublic Map<Var,ConceptId> idTransform(ReasonerQueryImpl query, Unifier unifier)
query - for which the transform is to be constructedunifier - between this query and provided querypublic Answer getSubstitution()
getSubstitution in interface ReasonerQuerypublic Answer getRoleSubstitution()
public java.util.stream.Stream<Answer> resolve(boolean materialise)
resolve in interface ReasonerQuerypublic ResolutionState subGoal(Answer sub, Unifier u, QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, QueryCache<ReasonerAtomicQuery> cache)
sub - partial substitutionu - unifier with parent stateparent - parent statesubGoals - set of visited sub goalscache - query cachepublic java.util.stream.Stream<ResolutionState> subGoals(Answer sub, Unifier u, QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, QueryCache<ReasonerAtomicQuery> cache)
sub - partial substitutionu - unifier with parent stateparent - parent statesubGoals - set of visited sub goalscache - query cachepublic Pair<Iterator<ResolutionState>,MultiUnifier> queryStateIterator(QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, QueryCache<ReasonerAtomicQuery> cache)
parent - parent statesubGoals - set of visited sub goalscache - query cachepublic boolean requiresReiteration()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.