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.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 |
---|---|
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
analyze, getBaseURI, getBindingsArray, getEngine, getEntailmentRegime, getFranzOptionPrefixString, getLanguage, getLimit, getName, getOffset, getPlanner, getQueryString, isCheckVariables, isLoggingEnabled, isPrepared, setCheckVariables, setEngine, setEntailmentRegime, setIncludeInferred, setLimit, setLoggingEnabled, setOffset, setPlanner, setPrepared, setSaveName, toString
getMaxQueryTime, setMaxQueryTime
clearBindings, getBindings, getDataset, getIncludeInferred, removeBinding, setBinding, setDataset
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMaxQueryTime, setMaxQueryTime
clearBindings, getBindings, getDataset, getIncludeInferred, removeBinding, setBinding, setDataset, setIncludeInferred
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 © 2017 Franz Inc.. All rights reserved.