public interface Query
Title: Query Interface
Description:
Copyright: Copyright (c) 2007
Company: Clark & Parsia, LLC.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Query.VarType |
| 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... arguments)
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 queryType)
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[] atoms)
Creates a subquery from the given query.
|
aterm.ATermAppl |
rollUpTo(aterm.ATermAppl distVar,
Collection<aterm.ATermAppl> avoidList,
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
|
void setFilter(Filter filter)
Filter getFilter()
boolean isDistinct()
Set<aterm.ATermAppl> getDistVarsForType(Query.VarType queryType)
void add(QueryAtom atom)
atom - void addDistVar(aterm.ATermAppl a,
Query.VarType type)
atom - void addResultVar(aterm.ATermAppl a)
atom - Set<aterm.ATermAppl> getVars()
Set<aterm.ATermAppl> getUndistVars()
Set<aterm.ATermAppl> getConstants()
List<aterm.ATermAppl> getResultVars()
Set<aterm.ATermAppl> getDistVars()
KnowledgeBase getKB()
void setKB(KnowledgeBase kb)
kb - KB that will be used to answer this queryboolean isGround()
Query apply(ResultBinding binding)
binding - aterm.ATermAppl rollUpTo(aterm.ATermAppl distVar,
Collection<aterm.ATermAppl> avoidList,
boolean stopOnConstants)
distVar - Query reorder(int[] atoms)
atoms - selected atom indicesvoid remove(QueryAtom atom)
List<QueryAtom> findAtoms(QueryPredicate predicate, aterm.ATermAppl... arguments)
void setQueryParameters(QueryParameters parameters)
QueryParameters getQueryParameters()
aterm.ATermAppl getName()
void setName(aterm.ATermAppl name)
name - name of the queryCopyright © 2019. All rights reserved.