public class AtomicQuery extends Query
Base reasoner atomic query. An atomic query is a query constrained to having at most one rule-resolvable atom together with its accompanying constraints (predicates and types)
| Constructor and Description |
|---|
AtomicQuery(AtomicQuery q) |
AtomicQuery(Atom at,
Set<VarName> vars) |
AtomicQuery(MatchQuery query,
GraknGraph graph) |
AtomicQuery(String rhs,
GraknGraph graph) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAtom(Atomic at) |
QueryAnswers |
answer(Set<AtomicQuery> subGoals,
QueryCache cache,
boolean materialise)
answer the query by providing combined lookup/rule resolutions
|
boolean |
equals(Object obj) |
void |
establishRelation(AtomicQuery aq)
establishes parent-child (if there is one) relation between this and aq query
the relation expresses the relative level of specificity between queries with the parent being more specific
|
Atom |
getAtom() |
Set<AtomicQuery> |
getChildren() |
AtomicQuery |
getParent() |
QueryAnswers |
materialise() |
QueryAnswers |
materialise(Set<IdPredicate> subs)
Add explicit IdPredicates and materialise
|
boolean |
removeAtom(Atomic at) |
void |
resolveViaRule(Rule rl,
Set<AtomicQuery> subGoals,
QueryCache cache,
boolean materialise)
attempt query resolution via application of a specific rule
|
Set<Atom> |
selectAtoms()
atom selection function
|
void |
unify(Map<VarName,VarName> unifiers)
change each variable occurrence according to provided mappings (apply unifiers {[from, to]_i})
|
addAtomConstraints, containsAtom, containsEquivalentAtom, DBlookup, getAnswers, getAtoms, getFilters, getIdPredicate, getIdPredicates, getMatchQuery, getNewAnswers, getPattern, getResources, getSelectedNames, getTypeConstraints, getValuePredicates, getVarSet, getVarTypeMap, graph, hashCode, isEquivalent, isRuleResolvable, lookup, memoryLookup, propagateAnswers, resolve, selectAppend, toString, unifypublic AtomicQuery(String rhs, GraknGraph graph)
public AtomicQuery(MatchQuery query, GraknGraph graph)
public AtomicQuery(AtomicQuery q)
public AtomicQuery getParent()
public void establishRelation(AtomicQuery aq)
aq - query to comparepublic Atom getAtom()
public Set<AtomicQuery> getChildren()
public boolean addAtom(Atomic at)
public boolean removeAtom(Atomic at)
removeAtom in class Queryat - to be removedpublic QueryAnswers materialise()
public QueryAnswers materialise(Set<IdPredicate> subs)
subs - IdPredicates of variablespublic void unify(Map<VarName,VarName> unifiers)
Querypublic Set<Atom> selectAtoms()
QueryselectAtoms in class Querypublic void resolveViaRule(Rule rl, Set<AtomicQuery> subGoals, QueryCache cache, boolean materialise)
rl - rule through which to resolve the querysubGoals - set of visited subqueriescache - collection of performed query resolutionsmaterialise - materialisation flagpublic QueryAnswers answer(Set<AtomicQuery> subGoals, QueryCache cache, boolean materialise)
subGoals - set of visited subqueriescache - collection of performed query resolutionsmaterialise - materialisation flagCopyright © 2017 Grakn Labs Ltd. All rights reserved.