- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
QueryExecAdapter,QueryExecApp,QueryExecDataset,QueryExecHTTP
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Stop in mid execution.static QueryExecadapt(QueryExecution qExec) booleanask()Execute an ASK queryvoidclose()Close the query execution and stop query evaluation as soon as convenient.default org.apache.jena.graph.GraphExecute a CONSTRUCT queryorg.apache.jena.graph.Graphconstruct(org.apache.jena.graph.Graph graph) Execute a CONSTRUCT query, putting the statements into a graph.default DatasetGraphExecute a CONSTRUCT query, putting the statements into 'dataset'.constructDataset(DatasetGraph dataset) Execute a CONSTRUCT query, putting the statements into 'dataset'.Execute a CONSTRUCT query, returning the results as an iterator ofQuad.Iterator<org.apache.jena.graph.Triple>Execute a CONSTRUCT query, returning the results as an iterator ofTriple.static QueryExecBuilderdataset(DatasetGraph dataset) Create aQueryExecBuilderfor a dataset.default org.apache.jena.graph.Graphdescribe()Execute a DESCRIBE queryorg.apache.jena.graph.Graphdescribe(org.apache.jena.graph.Graph graph) Execute a DESCRIBE query, putting the statements into a graph.Iterator<org.apache.jena.graph.Triple>Execute a DESCRIBE query, returning the results as an iterator ofTriple.execJson()Execute a JSON query and return a json arrayExecute a JSON query and return an iteratorThe properties associated with a query execution - implementation specific parameters This includes Java objects (so it is not an RDF graph).The dataset against which the query will execute.getQuery()The query associated with a query execution.The query as a string.static QueryExecBuildergraph(org.apache.jena.graph.Graph graph) Create aQueryExecBuilderfor a graph.booleanisClosed()Answer whether this QueryExecution object has been closed or not.static QueryExecDatasetBuilderCreate an uninitializedQueryExecDatasetBuilder.select()Execute a SELECT querystatic QueryExecBuilderCreate aQueryExecBuilderfor a remote endpoint.
-
Method Details
-
dataset
Create aQueryExecBuilderfor a dataset. For local dataset specific configuration, usenewBuilder()().dataset(dataset) to get aQueryExecDatasetBuilder. -
graph
Create aQueryExecBuilderfor a graph. -
service
Create aQueryExecBuilderfor a remote endpoint. -
newBuilder
Create an uninitializedQueryExecDatasetBuilder. -
getDataset
DatasetGraph getDataset()The dataset against which the query will execute. May be null - the dataset may be remote or the query itself has a dataset description. -
getContext
Context getContext()The properties associated with a query execution - implementation specific parameters This includes Java objects (so it is not an RDF graph). Keys should be URIs as strings. May be null (this implementation does not provide any configuration). -
getQuery
Query getQuery()The query associated with a query execution. May be null (QueryExec may have been created by other means) -
getQueryString
String getQueryString()The query as a string. This may be null (QueryExec may have been created by other means). This may contain non-Jena extensions and can not be parsed by Jena. IfgetQuery()is not null, this is a corresponding string that parses to the same query. -
select
RowSet select()Execute a SELECT queryImportant: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the SELECT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
-
construct
default org.apache.jena.graph.Graph construct()Execute a CONSTRUCT query -
construct
org.apache.jena.graph.Graph construct(org.apache.jena.graph.Graph graph) Execute a CONSTRUCT query, putting the statements into a graph.- Returns:
- Graph The graph argument for cascaded code.
-
constructTriples
Iterator<org.apache.jena.graph.Triple> constructTriples()Execute a CONSTRUCT query, returning the results as an iterator ofTriple.Caution: This method may return duplicate Triples. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.
Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the CONSTRUCT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
- Returns:
- An iterator of Triple objects (possibly containing duplicates) generated by applying the CONSTRUCT template of the query to the bindings in the WHERE clause.
-
constructQuads
Execute a CONSTRUCT query, returning the results as an iterator ofQuad.Caution: This method may return duplicate Quads. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.
See
constructTriples()for usage and features.- Returns:
- An iterator of Quad objects (possibly containing duplicates) generated by applying the CONSTRUCT template of the query to the bindings in the WHERE clause.
-
constructDataset
Execute a CONSTRUCT query, putting the statements into 'dataset'. This maybe an extended syntax query (if supported). -
constructDataset
Execute a CONSTRUCT query, putting the statements into 'dataset'. This may be an extended syntax query (if supported). -
describe
default org.apache.jena.graph.Graph describe()Execute a DESCRIBE query -
describe
org.apache.jena.graph.Graph describe(org.apache.jena.graph.Graph graph) Execute a DESCRIBE query, putting the statements into a graph.- Returns:
- Graph The model argument for cascaded code.
-
describeTriples
Iterator<org.apache.jena.graph.Triple> describeTriples()Execute a DESCRIBE query, returning the results as an iterator ofTriple.Caution: This method may return duplicate Triples. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.
Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the DESCRIBE query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.
- Returns:
- An iterator of Triple objects (possibly containing duplicates) generated as the output of the DESCRIBE query.
-
ask
boolean ask()Execute an ASK query -
execJson
JsonArray execJson()Execute a JSON query and return a json array -
execJsonItems
Iterator<JsonObject> execJsonItems()Execute a JSON query and return an iterator -
abort
void abort()Stop in mid execution. This method can be called in parallel with other methods on the QueryExecution object. There is no guarantee that the concrete implementation actual will stop or that it will do so immediately. No operations on the query execution or any associated result set are permitted after this call and may cause exceptions to be thrown. -
close
void close()Close the query execution and stop query evaluation as soon as convenient. QExec objects, and aRowSetfromselect(), can not be used once the QExec is closed. Model results fromconstruct()anddescribe()are still valid.It is important to close query execution objects in order to release resources such as working memory and to stop the query execution. Some storage subsystems require explicit ends of operations and this operation will cause those to be called where necessary. No operations on the query execution or any associated result set are permitted after this call.
- Specified by:
closein interfaceAutoCloseable
-
isClosed
boolean isClosed()Answer whether this QueryExecution object has been closed or not.- Returns:
- boolean
-
adapt
-