Class QueryExecHTTP
- java.lang.Object
-
- org.apache.jena.sparql.exec.http.QueryExecHTTP
-
-
Constructor Summary
Constructors Constructor Description QueryExecHTTP(java.lang.String serviceURL, Query query, java.lang.String queryString, int urlLimit, java.net.http.HttpClient httpClient, java.util.Map<java.lang.String,java.lang.String> httpHeaders, Params params, Context context, java.util.List<java.lang.String> defaultGraphURIs, java.util.List<java.lang.String> namedGraphURIs, QuerySendMode sendMode, java.lang.String explicitAcceptHeader, long timeout, java.util.concurrent.TimeUnit timeoutUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abort()
Stop in mid execution.boolean
ask()
Execute an ASK queryvoid
cancel()
Cancel query evaluationvoid
close()
Close the query execution and stop query evaluation as soon as convenient.Graph
construct(Graph graph)
Execute a CONSTRUCT query, putting the statements into a graph.DatasetGraph
constructDataset()
Execute a CONSTRUCT query, putting the statements into 'dataset'.DatasetGraph
constructDataset(DatasetGraph dataset)
Execute a CONSTRUCT query, putting the statements into 'dataset'.java.util.Iterator<Quad>
constructQuads()
Execute a CONSTRUCT query, returning the results as an iterator ofQuad
.java.util.Iterator<Triple>
constructTriples()
Execute a CONSTRUCT query, returning the results as an iterator ofTriple
.static QueryExecHTTPBuilder
create()
Deprecated.UsenewBuilder()
Graph
describe(Graph graph)
Execute a DESCRIBE query, putting the statements into a graph.java.util.Iterator<Triple>
describeTriples()
Execute a DESCRIBE query, returning the results as an iterator ofTriple
.JsonArray
execJson()
Execute a JSON query and return a json arrayjava.util.Iterator<JsonObject>
execJsonItems()
Execute a JSON query and return an iteratorContext
getContext()
The properties associated with a query execution - implementation specific parameters This includes Java objects (so it is not an RDF graph).DatasetGraph
getDataset()
The dataset against which the query will execute.java.lang.String
getHttpResponseContentType()
The Content-Type response header received (null before the remote operation is attempted).Query
getQuery()
The query associated with a query execution.java.lang.String
getQueryString()
Return the query string.boolean
isClosed()
Answer whether this QueryExecution object has been closed or not.static QueryExecHTTPBuilder
newBuilder()
Create an uninitializedQueryExecDatasetBuilder
.RowSet
select()
Execute a SELECT querystatic QueryExecHTTPBuilder
service(java.lang.String serviceURL)
Create aQueryExecBuilder
for a remote endpoint.
-
-
-
Constructor Detail
-
QueryExecHTTP
public QueryExecHTTP(java.lang.String serviceURL, Query query, java.lang.String queryString, int urlLimit, java.net.http.HttpClient httpClient, java.util.Map<java.lang.String,java.lang.String> httpHeaders, Params params, Context context, java.util.List<java.lang.String> defaultGraphURIs, java.util.List<java.lang.String> namedGraphURIs, QuerySendMode sendMode, java.lang.String explicitAcceptHeader, long timeout, java.util.concurrent.TimeUnit timeoutUnit)
-
-
Method Detail
-
create
@Deprecated public static QueryExecHTTPBuilder create()
Deprecated.UsenewBuilder()
-
newBuilder
public static QueryExecHTTPBuilder newBuilder()
Description copied from interface:QueryExec
Create an uninitializedQueryExecDatasetBuilder
.
-
service
public static QueryExecHTTPBuilder service(java.lang.String serviceURL)
Description copied from interface:QueryExec
Create aQueryExecBuilder
for a remote endpoint.
-
getHttpResponseContentType
public java.lang.String getHttpResponseContentType()
The Content-Type response header received (null before the remote operation is attempted).
-
select
public RowSet select()
Description copied from interface:QueryExec
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.
-
ask
public boolean ask()
Description copied from interface:QueryExec
Execute an ASK query
-
construct
public Graph construct(Graph graph)
Description copied from interface:QueryExec
Execute a CONSTRUCT query, putting the statements into a graph.
-
constructTriples
public java.util.Iterator<Triple> constructTriples()
Description copied from interface:QueryExec
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.
- Specified by:
constructTriples
in interfaceQueryExec
- 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
public java.util.Iterator<Quad> constructQuads()
Description copied from interface:QueryExec
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.
- Specified by:
constructQuads
in interfaceQueryExec
- 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.
See
QueryExec.constructTriples()
for usage and features.
-
constructDataset
public DatasetGraph constructDataset()
Description copied from interface:QueryExec
Execute a CONSTRUCT query, putting the statements into 'dataset'. This maybe an extended syntax query (if supported).- Specified by:
constructDataset
in interfaceQueryExec
-
constructDataset
public DatasetGraph constructDataset(DatasetGraph dataset)
Description copied from interface:QueryExec
Execute a CONSTRUCT query, putting the statements into 'dataset'. This may be an extended syntax query (if supported).- Specified by:
constructDataset
in interfaceQueryExec
-
describe
public Graph describe(Graph graph)
Description copied from interface:QueryExec
Execute a DESCRIBE query, putting the statements into a graph.
-
describeTriples
public java.util.Iterator<Triple> describeTriples()
Description copied from interface:QueryExec
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.
- Specified by:
describeTriples
in interfaceQueryExec
- Returns:
- An iterator of Triple objects (possibly containing duplicates) generated as the output of the DESCRIBE query.
-
execJson
public JsonArray execJson()
Description copied from interface:QueryExec
Execute a JSON query and return a json array
-
execJsonItems
public java.util.Iterator<JsonObject> execJsonItems()
Description copied from interface:QueryExec
Execute a JSON query and return an iterator- Specified by:
execJsonItems
in interfaceQueryExec
-
getContext
public Context getContext()
Description copied from interface:QueryExec
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).- Specified by:
getContext
in interfaceQueryExec
-
getDataset
public DatasetGraph getDataset()
Description copied from interface:QueryExec
The dataset against which the query will execute. May be null - the dataset may be remote or the query itself has a dataset description.- Specified by:
getDataset
in interfaceQueryExec
-
getQuery
public Query getQuery()
Description copied from interface:QueryExec
The query associated with a query execution. May be null (QueryExec may have been created by other means)
-
getQueryString
public java.lang.String getQueryString()
Return the query string. If this was supplied in a constructor, there is no guarantee this is legal SPARQL syntax.- Specified by:
getQueryString
in interfaceQueryExec
-
cancel
public void cancel()
Cancel query evaluation
-
abort
public void abort()
Description copied from interface:QueryExec
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
public void close()
Description copied from interface:QueryExec
Close the query execution and stop query evaluation as soon as convenient. QExec objects, and aRowSet
fromQueryExec.select()
, can not be used once the QExec is closed. Model results fromQueryExec.construct()
andQueryExec.describe()
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.
-
-