Query.VarType| Constructor and Description |
|---|
QueryImpl(KnowledgeBase kb,
boolean distinct) |
QueryImpl(Query query) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(QueryAtom atom)
Adds an query atom to the query.
|
void |
addDistVar(aterm.ATermAppl a,
Query.VarType type)
Adds a distinguished variable to the query with its type - there can be
more variable types to support punning.
|
void |
addResultVar(aterm.ATermAppl a)
Adds a distinguished variable that appears in the result projection to
the query;
|
Query |
apply(ResultBinding binding)
Replace the variables in the query with the values specified in the
binding and return a new query instance (without modifying this query).
|
List<QueryAtom> |
findAtoms(QueryPredicate predicate,
aterm.ATermAppl... args)
Searches for given atom pattern.
|
List<QueryAtom> |
getAtoms()
Get all the atoms in the query.
|
Set<aterm.ATermAppl> |
getConstants()
Return individuals and literals used in this query.
|
Set<aterm.ATermAppl> |
getDistVars()
Return all the distinguished variables.
|
Set<aterm.ATermAppl> |
getDistVarsForType(Query.VarType type)
Returns variables that occur in the subquery specified by the given type.
|
Filter |
getFilter()
Sets the filter for this query.
|
KnowledgeBase |
getKB()
The KB that will be used to answer this query.
|
aterm.ATermAppl |
getName()
Return the name of this query
|
QueryParameters |
getQueryParameters()
Get the query parameterization values
|
List<aterm.ATermAppl> |
getResultVars()
Return all the variables that will be in the results.
|
Set<aterm.ATermAppl> |
getUndistVars()
Return all undistinguished variables used in this query.
|
Set<aterm.ATermAppl> |
getVars()
Return all the variables used in this query.
|
boolean |
isDistinct()
Returns true if distinct results are required.
|
boolean |
isGround()
Checks whether the query is ground.
|
void |
remove(QueryAtom atom) |
Query |
reorder(int[] ordering)
Creates a subquery from the given query.
|
aterm.ATermAppl |
rollUpTo(aterm.ATermAppl var,
Collection<aterm.ATermAppl> stopList,
boolean stopOnConstants)
Rolls up the query to the given variable.
|
void |
setFilter(Filter filter)
Sets the filter for this query.
|
void |
setKB(KnowledgeBase kb)
Sets the KB that will be used to answer this query.
|
void |
setName(aterm.ATermAppl name)
Sets the name of this query
|
void |
setQueryParameters(QueryParameters parameters)
Set the query parameterization
|
String |
toString() |
String |
toString(boolean multiLine) |
public QueryImpl(KnowledgeBase kb, boolean distinct)
public QueryImpl(Query query)
public void add(QueryAtom atom)
public Set<aterm.ATermAppl> getDistVarsForType(Query.VarType type)
getDistVarsForType in interface Querypublic void addDistVar(aterm.ATermAppl a,
Query.VarType type)
addDistVar in interface Querypublic void addResultVar(aterm.ATermAppl a)
addResultVar in interface Querypublic Set<aterm.ATermAppl> getConstants()
getConstants in interface Querypublic Set<aterm.ATermAppl> getDistVars()
getDistVars in interface Querypublic Set<aterm.ATermAppl> getUndistVars()
getUndistVars in interface Querypublic List<aterm.ATermAppl> getResultVars()
getResultVars in interface Querypublic Set<aterm.ATermAppl> getVars()
public boolean isGround()
public KnowledgeBase getKB()
public void setKB(KnowledgeBase kb)
public Query apply(ResultBinding binding)
public aterm.ATermAppl rollUpTo(aterm.ATermAppl var,
Collection<aterm.ATermAppl> stopList,
boolean stopOnConstants)
public List<QueryAtom> findAtoms(QueryPredicate predicate, aterm.ATermAppl... args)
public Query reorder(int[] ordering)
public String toString(boolean multiLine)
public boolean isDistinct()
isDistinct in interface Querypublic Filter getFilter()
public void setFilter(Filter filter)
public void setQueryParameters(QueryParameters parameters)
QuerysetQueryParameters in interface Querypublic QueryParameters getQueryParameters()
QuerygetQueryParameters in interface Querypublic aterm.ATermAppl getName()
QueryCopyright © 2019. All rights reserved.