Class AGStreamTupleQuery

All Implemented Interfaces:
Operation, Query, TupleQuery

public class AGStreamTupleQuery extends AGTupleQuery implements TupleQuery
Wraps an AGTupleQuery to provide streaming results. The default, TupleQueryResultParser and TupleQueryResultBuilder use SAX to parse and an ArrayList to collect results, so 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();
 ...
 
Since:
v4.3
See Also: