|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectQueryBase
com.franz.agbase.PrologSelectQuery
public class PrologSelectQuery
This class collects the parameters and results of a query posed in a restricted version of Allegro Prolog. A query is composed of two main components, the variables for which bindings are requested, and the body of the query which consists of Allegro Prolog clauses. The variables are used to form a flat list template (see the documentation for select and friends in the AllegroGraph Lisp documentation).
Constructor Summary | |
---|---|
PrologSelectQuery()
Create a fresh Proloq query holder. |
Method Summary | |
---|---|
void |
bind(java.lang.String var,
java.lang.Object val)
Add a pre-set binding to the query. |
long |
count()
Run the query and count the results. |
long |
count(AllegroGraph ag)
Run the query in the specified triple store. |
long |
count(AllegroGraph ag,
java.lang.String[] vars,
java.lang.String newQuery)
|
long |
count(java.lang.String[] vars,
java.lang.String newQuery)
Run the specified query. |
int |
getHasValue()
Query the hasValue option. |
long |
getLimit()
|
java.lang.String |
getQuery()
|
ValueSetIterator |
getResult()
Retrieve the result of the last query. |
AGBase |
getTripleStore()
|
java.lang.String[] |
getVariables()
Query the names of the variables returned in each result set. |
boolean |
isDistinct()
Query the Distinct option on the query. |
boolean |
isIncludeInferred()
|
java.lang.Boolean |
isRemoveRTF()
Query the state of the :remove-redundant-type-filters
planner option on the query. |
java.lang.Boolean |
isReorder()
Query the state of the :reorder
planner option on the query. |
boolean |
isSavedPlan()
Query the state of a saved plan for this query. |
java.lang.Boolean |
isUseMaps()
Query the state of the :use-maps
planner option on the query. |
java.lang.Boolean |
isUseTransforms()
Query the state of the :use-transforms
planner option on the query. |
boolean |
preparePlan()
Prepare a plan for this query. |
ValueSetIterator |
run()
Run the query and collect the results. |
ValueSetIterator |
run(AllegroGraph ag)
Run the query in the specified triple store. |
ValueSetIterator |
run(AllegroGraph ag,
java.lang.String[] vars,
java.lang.String newQuery)
|
ValueSetIterator |
run(AllegroGraph ag,
java.lang.String var,
java.lang.String newQuery)
|
ValueSetIterator |
run(java.lang.String[] vars,
java.lang.String newQuery)
Run the specified query. |
ValueSetIterator |
run(java.lang.String var,
java.lang.String newQuery)
|
boolean |
runAndSavePlan()
Run the query and save the plan for later re-use. |
ValueSetIterator |
runPlan()
Run a previously saved plan. |
void |
setDistinct(boolean onoff)
Set the Distinct option on the query. |
void |
setHasValue(boolean v)
Enable or disable hasValue reasoning. |
void |
setIncludeInferred(boolean includeInferred)
|
void |
setLimit(long limit)
|
void |
setQuery(java.lang.String newQuery)
|
void |
setQuery(java.lang.String[] vars,
java.lang.String query)
Set the result template and clauses of the query with one call. |
void |
setQuery(java.lang.String var,
java.lang.String query)
Set the result template and clauses of the query with one call. |
void |
setRemoveRTF(java.lang.Boolean removeRTF)
Set the state of the :remove-redundant-type-filters
planner option on the query. |
void |
setReorder(java.lang.Boolean reorder)
Set the state of the :reorder
planner option on the query. |
void |
setTripleStore(AllegroGraph ag)
|
void |
setUseMaps(java.lang.Boolean useMaps)
Set the state of the :use-maps
planner option on the query. |
void |
setUseTransforms(java.lang.Boolean useTransforms)
Set the state of the :use-transforms
planner option on the query. |
void |
setVariables(java.lang.String vars)
Set the template of values desired in each result set. |
void |
setVariables(java.lang.String[] vars)
Set the template of values desired in each result set. |
java.lang.String |
showPlan()
Return a string containing a description of the query plan. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrologSelectQuery()
Method Detail |
---|
public void bind(java.lang.String var, java.lang.Object val)
var
- The name of a variable (with or without the leading ?).
A null value removes all the variable bindings.val
- The value for this variable may be a ValueNode instance, a UPI,
or a string in Ntriples notation.
A null value removes the variable from the list.public boolean isIncludeInferred()
public void setIncludeInferred(boolean includeInferred)
public int getHasValue()
public void setHasValue(boolean v)
v
- true or falsepublic AGBase getTripleStore()
public java.lang.String getQuery()
public void setQuery(java.lang.String newQuery)
public void setQuery(java.lang.String[] vars, java.lang.String query)
vars
- the variable names to appear in the result templatequery
- the clauses in the body of the querypublic void setQuery(java.lang.String var, java.lang.String query)
var
- the single variable name to appear in the result templatequery
- the clauses in the body of the querypublic void setTripleStore(AllegroGraph ag)
public boolean isDistinct()
public void setDistinct(boolean onoff)
onoff
- when true, the query will return only the unique sets of results.
When false, the results may include some duplicates.public long getLimit()
public void setLimit(long limit)
public java.lang.String[] getVariables()
public void setVariables(java.lang.String[] vars)
vars
- an array of variable names.public void setVariables(java.lang.String vars)
vars
- A string containing variable names separated by spaces.public ValueSetIterator run() throws AllegroGraphException
AllegroGraphException
public ValueSetIterator getResult()
public ValueSetIterator run(AllegroGraph ag) throws AllegroGraphException
ag
- the AllegroGraph instance where the query should run.
This instance is remembered in the PrologSelectQuery instance.
run()
AllegroGraphException
public ValueSetIterator run(java.lang.String[] vars, java.lang.String newQuery) throws AllegroGraphException
vars
- the variable names to appear in the result templatenewQuery
- the clauses in the body of the query
run()
AllegroGraphException
public ValueSetIterator run(java.lang.String var, java.lang.String newQuery) throws AllegroGraphException
AllegroGraphException
public ValueSetIterator run(AllegroGraph ag, java.lang.String[] vars, java.lang.String newQuery) throws AllegroGraphException
AllegroGraphException
public ValueSetIterator run(AllegroGraph ag, java.lang.String var, java.lang.String newQuery) throws AllegroGraphException
AllegroGraphException
public java.lang.Boolean isReorder() throws AllegroGraphException
:reorder
planner option on the query.
AllegroGraphException
public void setReorder(java.lang.Boolean reorder)
:reorder
planner option on the query.
reorder
- True or false. A null value reverts to the built-in default in the server.public java.lang.Boolean isUseMaps() throws AllegroGraphException
:use-maps
planner option on the query.
AllegroGraphException
public void setUseMaps(java.lang.Boolean useMaps)
:use-maps
planner option on the query.
useMaps
- True or false. A null value reverts to the built-in default in the server.public java.lang.Boolean isUseTransforms() throws AllegroGraphException
:use-transforms
planner option on the query.
Return null if the option has not been set and the server default cannot
be determined.
AllegroGraphException
public void setUseTransforms(java.lang.Boolean useTransforms)
:use-transforms
planner option on the query.
useTransforms
- True or false. A null value reverts to the built-in default in the server.public java.lang.Boolean isRemoveRTF() throws AllegroGraphException
:remove-redundant-type-filters
planner option on the query.
AllegroGraphException
public void setRemoveRTF(java.lang.Boolean removeRTF)
:remove-redundant-type-filters
planner option on the query.
removeRTF
- True or false. A null value reverts to the built-in default in the server.public boolean runAndSavePlan() throws AllegroGraphException
The results of the query are obtained by calling getResult().
AllegroGraphException
public long count() throws AllegroGraphException
AllegroGraphException
public long count(AllegroGraph ag) throws AllegroGraphException
ag
- the AllegroGraph instance where the query should run.
This instance is remembered in the PrologSelectQuery instance.
AllegroGraphException
public long count(java.lang.String[] vars, java.lang.String newQuery) throws AllegroGraphException
vars
- the variable names to appear in the result template.
Since the results are not actually collected, this argument may be null.newQuery
- the clauses in the body of the query
AllegroGraphException
public long count(AllegroGraph ag, java.lang.String[] vars, java.lang.String newQuery) throws AllegroGraphException
AllegroGraphException
public boolean isSavedPlan()
public java.lang.String showPlan() throws AllegroGraphException
AllegroGraphException
public boolean preparePlan() throws AllegroGraphException
AllegroGraphException
public ValueSetIterator runPlan() throws AllegroGraphException
AllegroGraphException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |