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(ConceptMap 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 EmbeddedGraknTx<?> tx()
tx in interface ReasonerQuerypublic void checkValid()
checkValid in interface ReasonerQuerypublic Conjunction<PatternAdmin> getPattern()
getPattern in interface ReasonerQuerypublic Set<String> validateOntologically()
validateOntologically in interface ReasonerQuerypublic boolean isRuleResolvable()
isRuleResolvable in interface ReasonerQuerypublic boolean isBoundlesslyDisconnected()
public boolean requiresSchema()
public boolean isAtomic()
public 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)
getMultiUnifier in interface ReasonerQuerypublic MultiUnifier getMultiUnifier(ReasonerQuery parent, UnifierComparison unifierType)
getMultiUnifier in interface ReasonerQuerypublic GetQuery getQuery()
public com.google.common.collect.ImmutableMap<Var,Type> getVarTypeMap()
getVarTypeMap in interface ReasonerQuerypublic com.google.common.collect.ImmutableMap<Var,Type> getVarTypeMap(boolean inferTypes)
getVarTypeMap in interface ReasonerQuerypublic com.google.common.collect.ImmutableMap<Var,Type> getVarTypeMap(ConceptMap 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 java.util.stream.Stream<Atom> selectAtoms()
public ConceptMap getSubstitution()
getSubstitution in interface ReasonerQuerypublic ConceptMap getRoleSubstitution()
public boolean requiresDecomposition()
public ReasonerQueryImpl rewrite()
public java.util.stream.Stream<ConceptMap> resolve()
resolve in interface ReasonerQuerypublic ResolutionState subGoal(ConceptMap sub, Unifier u, QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, SimpleQueryCache<ReasonerAtomicQuery> cache)
sub - partial substitutionu - unifier with parent stateparent - parent statesubGoals - set of visited sub goalscache - query cachepublic java.util.stream.Stream<ResolutionState> subGoals(ConceptMap sub, Unifier u, QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, SimpleQueryCache<ReasonerAtomicQuery> cache)
sub - partial substitutionu - unifier with parent stateparent - parent statesubGoals - set of visited sub goalscache - query cachepublic Iterator<ResolutionState> queryStateIterator(QueryStateBase parent, Set<ReasonerAtomicQuery> subGoals, SimpleQueryCache<ReasonerAtomicQuery> cache)
parent - parent statesubGoals - set of visited sub goalscache - query cachepublic boolean requiresReiteration()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.