public class AGStreamTupleQuery extends AGTupleQuery implements 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.eclipse.rdf4j.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 |
---|---|
TupleQueryResult |
evaluate()
Returns a result object that will read from the http response as
results are requested, by
TupleQueryResult .hasNext() . |
void |
evaluate(TupleQueryResultHandler handler) |
count, download, download, stream
analyze, download, download, download, download, getBaseURI, getBindingsArray, getEngine, getEntailmentRegime, getFranzOptionPrefixString, getLanguage, getLimit, getName, getOffset, getPlanner, getQueryString, isCheckVariables, isLoggingEnabled, isPrepared, setCheckVariables, setEngine, setEntailmentRegime, setIncludeInferred, setLimit, setLoggingEnabled, setOffset, setPlanner, setPrepared, setSaveName, stream, stream, toString
getMaxQueryTime, setMaxQueryTime
clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setMaxExecutionTime
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMaxQueryTime, setMaxQueryTime
clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setIncludeInferred, setMaxExecutionTime
public AGStreamTupleQuery(AGTupleQuery query)
query
- to wrappublic TupleQueryResult evaluate() throws QueryEvaluationException
TupleQueryResult
.hasNext()
.
(Note that TupleQueryResult
.next()
does not actually do the work if hasNext() is called first.)evaluate
in interface TupleQuery
evaluate
in class AGTupleQuery
QueryEvaluationException
public void evaluate(TupleQueryResultHandler handler) throws QueryEvaluationException, TupleQueryResultHandlerException
evaluate
in interface TupleQuery
evaluate
in class AGTupleQuery
QueryEvaluationException
TupleQueryResultHandlerException
Copyright © 2024 Franz Inc.. All rights reserved.