|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSPARQLQueryInternals
com.franz.agbase.SPARQLQuery
public class SPARQLQuery
This class collects the parameters and results of a SPARQL query.
The typical sequence of steps is to
This document is not intended to be a SPARQL tutorial or reference. Please refer to other documents for the definition of SPARQL syntax and semantics and for the precise behavior of the SPARQL engine.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.franz.agbase.SPARQLQueryConstants |
|---|
SPARQLQueryConstants.ENGINE, SPARQLQueryConstants.PLANNER |
| Constructor Summary | |
|---|---|
SPARQLQuery()
Create a new empty SPARQL query with default arguments. |
|
| Method Summary | |
|---|---|
boolean |
ask()
Run a SPARQL query that returns a boolean result. |
boolean |
ask(AllegroGraph ag)
Run a SPARQL query that returns a boolean result. |
boolean |
ask(AllegroGraph ag,
java.lang.String query)
Run a SPARQL query that returns a boolean result. |
boolean |
ask(java.lang.String query)
Run a SPARQL query that returns a boolean result. |
TriplesIterator |
construct()
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
construct(AllegroGraph ag)
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
construct(AllegroGraph ag,
java.lang.String query)
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
construct(java.lang.String query)
Run a SPARQL query that retrieves a set of statements. |
long |
count()
Run a SPARQL query that retrieves a set (or row) of variable bindings. |
long |
count(AllegroGraph ag)
Run a SPARQL query that retrieves a set (or row) of variable bindings. |
long |
count(AllegroGraph ag,
java.lang.String query)
Run a SPARQL query that retrieves a set (or row) of variable bindings. |
long |
count(java.lang.String query)
Run a SPARQL query that retrieves a set (or row) of variable bindings. |
TriplesIterator |
describe()
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
describe(AllegroGraph ag)
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
describe(AllegroGraph ag,
java.lang.String query)
Run a SPARQL query that retrieves a set of statements. |
TriplesIterator |
describe(java.lang.String query)
Run a SPARQL query that retrieves a set of statements. |
boolean |
getBooleanResult()
Query the result of a query that has a boolean result. |
java.lang.String |
getDefaultBase()
Query the default base value of the query. |
java.lang.String |
getDefaultDatasetBehavior()
Query the default dataset behavior for this SPARQL query. |
java.lang.String[] |
getDefaultPrefixes()
Query the default-prefixes option. |
SPARQLQueryConstants.ENGINE |
getEngine()
Query the engine that was or will be used for the SPARQL query. |
java.lang.Boolean |
getExtended()
Query the extended option. |
java.lang.String[] |
getFrom()
Query the from option. |
java.lang.String[] |
getFromNamed()
Query the from-named option. |
java.lang.Boolean |
getHasValue()
Query the hasValue option. |
long |
getLimit()
Query the limit option. |
java.lang.String |
getLoadFunction()
Query the name of the load-function. |
java.lang.Boolean |
getMemoized()
Query the memoize option. |
java.lang.String |
getMemoTable()
Query the name of the memo table. |
long |
getOffset()
Query the offset option. |
SPARQLQueryConstants.PLANNER |
getPlanner()
Query the engine that was or will be used for the SPARQL query. |
java.lang.String |
getQuery()
Get the query string. |
java.lang.String |
getRDFFormat()
Query the RDFFormat option. |
long |
getResultCount()
Query the count value of a query that returns a numeric result. |
TriplesIterator |
getResultCursor()
Query the result of a SPARQL query that returns a collection of triples. |
java.lang.String[] |
getResultNames()
Query the names and order of the variables in a SELECT query result. |
ValueSetIterator |
getResultSets()
Query the results of a SPARQL query that returns sets of bindings. |
java.lang.String |
getResultsFormat()
Query the resultsFormat option. |
java.lang.String |
getResultString()
Query the result of a SPARQL query that returns a string result. |
AllegroGraph |
getTripleStore()
Query the triple store against which this SPARQL query has or will run. |
java.lang.String |
getVars()
Query the vars option. |
java.lang.Object[] |
getWithVariables()
Query the with-variables option. |
boolean |
isIncludeInferred()
Query the includeInferred option. |
java.lang.String |
run()
Run a SPARQL query that returns a serialized string result. |
java.lang.String |
run(AllegroGraph ag)
|
java.lang.String |
run(AllegroGraph ag,
java.lang.String query)
|
java.lang.String |
run(java.lang.String query)
|
ValueSetIterator |
select()
Run a SPARQL query that retrieves a set of variable bindings. |
ValueSetIterator |
select(AllegroGraph ag)
Run a SPARQL query that retrieves a set of variable bindings. |
ValueSetIterator |
select(AllegroGraph ag,
java.lang.String query)
|
ValueSetIterator |
select(java.lang.String query)
Run a SPARQL query that retrieves a set of variable bindings. |
void |
setDefaultBase(java.lang.String base)
Set the default-base option for this SPARQL query. |
void |
setDefaultDatasetBehaviorAll()
Set the default-data-set-behavior option to "all". |
void |
setDefaultDatasetBehaviorDefault()
Set the default-data-set-behavior option to "default". |
void |
setDefaultPrefixes(NamespaceRegistry prefixes)
Set the default-prefixes option. |
void |
setDefaultPrefixes(java.lang.String[] prefixes)
Set the default-prefixes option. |
void |
setEngine(SPARQLQueryConstants.ENGINE e)
Set the engine that will be used for the SPARQL query. |
void |
setExtended(boolean extended)
Set the extended option. |
void |
setFrom(java.lang.String[] uriLabels)
Set the from option, |
void |
setFromNamed(java.lang.String[] uriLabels)
Set the from-named option, |
void |
setHasValue(boolean v)
Enable or disable hasValue reasoning. |
void |
setIncludeInferred(boolean includeInferred)
Modify the includeInferred option. |
void |
setLimit(int limit)
Set the limit option. |
void |
setLoadFunction(java.lang.String name)
Set the name of a load-function option. |
void |
setMemoized(boolean memoized)
Set the memoize option. |
void |
setMemoTable(java.lang.String name)
Set the name of a memo table. |
void |
setOffset(int offset)
Set the offset option. |
void |
setPlanner(SPARQLQueryConstants.PLANNER e)
Set the engine that will be used for the SPARQL query. |
void |
setQuery(java.lang.String newQuery)
Set the query string. |
void |
setRDFFormat(java.lang.String format)
Set the RDFFormat option. |
void |
setResultsFormat(java.lang.String resultsFormat)
Set the resultsFormat option. |
void |
setTripleStore(AllegroGraph ag)
Specify the triple store against which this SPARQL query will run. |
void |
setVars(java.lang.String vars)
Set the vars option. |
void |
setWithVariables(AllegroGraph ag,
java.lang.Object[] withVariables)
Set the with-variables option for the SPARQL query. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SPARQLQuery()
| Method Detail |
|---|
public java.lang.String getQuery()
public void setQuery(java.lang.String newQuery)
newQuery - a string containing a complete well-formed SPARQL query.public boolean getBooleanResult()
java.lang.IllegalStateException - if a boolean result is not available.public long getResultCount()
java.lang.IllegalStateException - if the count is not available.public java.lang.String[] getResultNames()
java.lang.IllegalStateException - if the names are not available.public boolean isIncludeInferred()
public void setIncludeInferred(boolean includeInferred)
includeInferred - the desired value.public java.lang.Boolean getHasValue()
public void setHasValue(boolean v)
v - true or falsepublic long getLimit()
public void setLimit(int limit)
limit - the limit to set.
A value less than 1 specifies that the LIMIT clause in the query applies.public long getOffset()
public void setOffset(int offset)
offset - the offset to set.
A value less than 1 specifies that the LIMIT clause in the query applies.public java.lang.String getRDFFormat()
public void setRDFFormat(java.lang.String format)
format - the RDFFormat to setpublic java.lang.String getResultsFormat()
public void setResultsFormat(java.lang.String resultsFormat)
resultsFormat - the resultsFormat to setpublic java.lang.String getVars()
public void setVars(java.lang.String vars)
vars - null or a string containing variable names separated by spacespublic java.lang.Boolean getExtended()
*use-extended-sparql-verbs-p* in the server
documentation for more details.
public void setExtended(boolean extended)
extended - the extended to setpublic java.lang.Boolean getMemoized()
*build-filter-memoizes-p* in the server
documentation for more details.
public void setMemoized(boolean memoized)
memoized - the memoized to setpublic void setMemoTable(java.lang.String name)
name - public java.lang.String getMemoTable()
public void setLoadFunction(java.lang.String name)
name - public java.lang.String getLoadFunction()
public void setDefaultPrefixes(java.lang.String[] prefixes)
prefixes - an array of alternating prefix and URI strings.public void setDefaultPrefixes(NamespaceRegistry prefixes)
prefixes - a NamespaceRegistry instance that defines the desired prefixes.public java.lang.String[] getDefaultPrefixes()
default-prefixes in the server
documentation for more details.
public void setDefaultBase(java.lang.String base)
base - a string containing the default base URI.public java.lang.String getDefaultBase()
default-base in the server
documentation for more details.
public void setFromNamed(java.lang.String[] uriLabels)
uriLabels - an array of URI stringspublic java.lang.String[] getFromNamed()
public void setFrom(java.lang.String[] uriLabels)
uriLabels - an array of URI stringspublic java.lang.String[] getFrom()
public void setDefaultDatasetBehaviorAll()
public void setDefaultDatasetBehaviorDefault()
public java.lang.String getDefaultDatasetBehavior()
*sparql-default-graph-behavior* in the server
documentation for more details.
public SPARQLQueryConstants.ENGINE getEngine()
*default-sparql-query-engine* in the server
documentation for more details.
public void setEngine(SPARQLQueryConstants.ENGINE e)
e - public SPARQLQueryConstants.PLANNER getPlanner()
*sparql-query-planner* in the server
documentation for more details.
public void setPlanner(SPARQLQueryConstants.PLANNER e)
e - public java.lang.Object[] getWithVariables()
public void setWithVariables(AllegroGraph ag,
java.lang.Object[] withVariables)
ag - the AllegroGraph instance where the variable values are resolved.withVariables - an array of alternating variable names and values.
The variable names must be strings.
The variable values may be any valid triple part specifier as in addStatement.public ValueSetIterator getResultSets()
java.lang.IllegalStateException - if the result is not available.public TriplesIterator getResultCursor()
public java.lang.String getResultString()
public void setTripleStore(AllegroGraph ag)
ag - public AllegroGraph getTripleStore()
public ValueSetIterator select()
throws AllegroGraphException
AllegroGraphException
public ValueSetIterator select(AllegroGraph ag)
throws AllegroGraphException
ag - the AllogroGraph instance against which the query will run.
AllegroGraphException
public ValueSetIterator select(java.lang.String query)
throws AllegroGraphException
query - the complete and well-formed SPARQL SELECT query string.
AllegroGraphException
public ValueSetIterator select(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
AllegroGraphException
public long count()
throws AllegroGraphException
The result may also be obtained subsequently by calling getResultCount().
AllegroGraphException
public long count(AllegroGraph ag)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).
AllegroGraphExceptioncount().
public long count(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).query - a string containing a well-formed SPARQL SELECT query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptioncount().
public long count(java.lang.String query)
throws AllegroGraphException
query - a string containing a well-formed SPARQL SELECT query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptioncount().
public boolean ask()
throws AllegroGraphException
The result may also be obtained subsequently by calling getBooleanResult().
AllegroGraphException
public boolean ask(AllegroGraph ag)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).
AllegroGraphExceptionask().
public boolean ask(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).query - a string containing a well-formed SPARQL ASK query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptionask().
public boolean ask(java.lang.String query)
throws AllegroGraphException
query - a string containing a well-formed SPARQL ASK query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptionask().
public TriplesIterator describe()
throws AllegroGraphException
The result may also be obtained subsequently by calling getResultCursor().
AllegroGraphException
public TriplesIterator describe(AllegroGraph ag)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).
AllegroGraphExceptiondescribe().
public TriplesIterator describe(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).query - a string containing a well-formed SPARQL DESCRIBE query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptiondescribe().
public TriplesIterator describe(java.lang.String query)
throws AllegroGraphException
query - a string containing a well-formed SPARQL DESCRIBE query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptiondescribe().
public TriplesIterator construct()
throws AllegroGraphException
The result may also be obtained subsequently by calling getResultCursor().
AllegroGraphException
public TriplesIterator construct(AllegroGraph ag)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).
AllegroGraphExceptionconstruct().
public TriplesIterator construct(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
ag - the AllegroGraph instance where the query will run.
This instance is remembered as if set with setTripleStore(AllegroGraph).query - a string containing a well-formed SPARQL CONSTRUCT query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptionconstruct().
public TriplesIterator construct(java.lang.String query)
throws AllegroGraphException
query - a string containing a well-formed SPARQL CONSTRUCT query.
The query is remembered as if set with setQuery(String).
AllegroGraphExceptionconstruct().
public java.lang.String run()
throws AllegroGraphException
AllegroGraphException - if a problem was encountered during the search.
java.lang.IllegalArgumentException - if this instance is not properly initialized.
public java.lang.String run(AllegroGraph ag)
throws AllegroGraphException
AllegroGraphException
public java.lang.String run(AllegroGraph ag,
java.lang.String query)
throws AllegroGraphException
AllegroGraphException
public java.lang.String run(java.lang.String query)
throws AllegroGraphException
AllegroGraphException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||