|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.clarkparsia.pellet.sparqldl.model.QueryImpl
public class QueryImpl
Title: Default implementation of the Query
Description:
Copyright: Copyright (c) 2007
Company: Clark & Parsia, LLC.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.clarkparsia.pellet.sparqldl.model.Query |
|---|
Query.VarType |
| Constructor Summary | |
|---|---|
QueryImpl(KnowledgeBase kb,
boolean distinct)
|
|
QueryImpl(Query query)
|
|
| 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... args)
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 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 |
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[] ordering)
Creates a subquery from the given query. |
aterm.ATermAppl |
rollUpTo(aterm.ATermAppl var,
java.util.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 |
java.lang.String |
toString()
|
java.lang.String |
toString(boolean multiLine)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public QueryImpl(KnowledgeBase kb,
boolean distinct)
public QueryImpl(Query query)
| Method Detail |
|---|
public void add(QueryAtom atom)
add in interface Querypublic java.util.Set<aterm.ATermAppl> getDistVarsForType(Query.VarType type)
getDistVarsForType in interface Query
public void addDistVar(aterm.ATermAppl a,
Query.VarType type)
addDistVar in interface Querypublic void addResultVar(aterm.ATermAppl a)
addResultVar in interface Querypublic java.util.List<QueryAtom> getAtoms()
getAtoms in interface Querypublic java.util.Set<aterm.ATermAppl> getConstants()
getConstants in interface Querypublic java.util.Set<aterm.ATermAppl> getDistVars()
getDistVars in interface Querypublic java.util.Set<aterm.ATermAppl> getUndistVars()
getUndistVars in interface Querypublic java.util.List<aterm.ATermAppl> getResultVars()
getResultVars in interface Querypublic java.util.Set<aterm.ATermAppl> getVars()
getVars in interface Querypublic boolean isGround()
isGround in interface Querypublic KnowledgeBase getKB()
getKB in interface Querypublic void setKB(KnowledgeBase kb)
setKB in interface Querykb - KB that will be used to answer this querypublic Query apply(ResultBinding binding)
apply in interface Query
public aterm.ATermAppl rollUpTo(aterm.ATermAppl var,
java.util.Collection<aterm.ATermAppl> stopList,
boolean stopOnConstants)
rollUpTo in interface Query
public java.util.List<QueryAtom> findAtoms(QueryPredicate predicate,
aterm.ATermAppl... args)
findAtoms in interface Querypublic Query reorder(int[] ordering)
reorder in interface Queryordering - selected atom indices
public void remove(QueryAtom atom)
remove in interface Querypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean multiLine)
public boolean isDistinct()
isDistinct in interface Querypublic Filter getFilter()
getFilter in interface Querypublic void setFilter(Filter filter)
setFilter in interface Querypublic void setQueryParameters(QueryParameters parameters)
Query
setQueryParameters in interface Querypublic QueryParameters getQueryParameters()
Query
getQueryParameters in interface Querypublic aterm.ATermAppl getName()
Query
getName in interface Querypublic void setName(aterm.ATermAppl name)
Query
setName in interface Queryname - name of the query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||