|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Query
Title: Query Interface
Description:
Copyright: Copyright (c) 2007
Company: Clark & Parsia, LLC.
Nested Class Summary | |
---|---|
static class |
Query.VarType
|
Method Summary | |
---|---|
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). |
java.util.List<QueryAtom> |
findAtoms(QueryPredicate predicate,
aterm.ATermAppl... arguments)
Searches for given atom pattern. |
java.util.List<QueryAtom> |
getAtoms()
Get all the atoms in the query. |
java.util.Set<aterm.ATermAppl> |
getConstants()
Return individuals and literals used in this query. |
java.util.Set<aterm.ATermAppl> |
getDistVars()
Return all the distinguished variables. |
java.util.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 |
java.util.List<aterm.ATermAppl> |
getResultVars()
Return all the variables that will be in the results. |
java.util.Set<aterm.ATermAppl> |
getUndistVars()
Return all undistinguished variables used in this query. |
java.util.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,
java.util.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 |
Method Detail |
---|
void setFilter(Filter filter)
Filter getFilter()
boolean isDistinct()
java.util.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
- java.util.Set<aterm.ATermAppl> getVars()
java.util.Set<aterm.ATermAppl> getUndistVars()
java.util.Set<aterm.ATermAppl> getConstants()
java.util.List<aterm.ATermAppl> getResultVars()
java.util.Set<aterm.ATermAppl> getDistVars()
java.util.List<QueryAtom> getAtoms()
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, java.util.Collection<aterm.ATermAppl> avoidList, boolean stopOnConstants)
distVar
-
Query reorder(int[] atoms)
atoms
- selected atom indices
void remove(QueryAtom atom)
java.util.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 query
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |