public class AGStreamTupleQuery extends AGTupleQuery implements org.openrdf.query.TupleQuery
AGTupleQuery.evaluate()
does not return until the
entire stream is parsed.
AGStreamTupleQuery uses XMLStreamReader
, so the result is
pulled from the http response stream as methods such as
TupleQueryResult
.hasNext()
are called.
Usage:
AGTupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, "SELECT ...");
query = new AGStreamTupleQuery(query);
TupleQueryResult results = query.evaluate();
...
AGRepositoryConnection.prepareTupleQuery(org.openrdf.query.QueryLanguage, String)
RDFS_PLUS_PLUS, RESTRICTION, SPARQL_COVERAGE_PLANNER, SPARQL_IDENTITY_PLANNER
Constructor and Description |
---|
AGStreamTupleQuery(AGTupleQuery query)
Wraps a query with this object that will stream the response.
|
Modifier and Type | Method and Description |
---|---|
org.openrdf.query.TupleQueryResult |
evaluate()
Returns a result object that will read from the http response as
results are requested, by
TupleQueryResult .hasNext() . |
void |
evaluate(org.openrdf.query.TupleQueryResultHandler handler) |
count
analyze, getBaseURI, getBindingsArray, getEngine, getEntailmentRegime, getLanguage, getLimit, getName, getOffset, getPlanner, getQueryString, isCheckVariables, isLoggingEnabled, isPrepared, setCheckVariables, setEngine, setEntailmentRegime, setIncludeInferred, setLimit, setLoggingEnabled, setOffset, setPlanner, setPrepared, setSaveName, toString
clearBindings, getBindings, getDataset, getIncludeInferred, removeBinding, setBinding, setDataset
public AGStreamTupleQuery(AGTupleQuery query)
query
- to wrappublic org.openrdf.query.TupleQueryResult evaluate() throws org.openrdf.query.QueryEvaluationException
TupleQueryResult
.hasNext()
.
(Note that TupleQueryResult
.next()
does not actually do the work if hasNext() is called first.)evaluate
in interface org.openrdf.query.TupleQuery
evaluate
in class AGTupleQuery
org.openrdf.query.QueryEvaluationException
public void evaluate(org.openrdf.query.TupleQueryResultHandler handler) throws org.openrdf.query.QueryEvaluationException, org.openrdf.query.TupleQueryResultHandlerException
evaluate
in interface org.openrdf.query.TupleQuery
evaluate
in class AGTupleQuery
org.openrdf.query.QueryEvaluationException
org.openrdf.query.TupleQueryResultHandlerException