AGStreamTupleQuery (agraph-java-client 5.0.4-SNAPSHOT API)
Description: declaration: package: com.franz.agraph.repository, class: AGStreamTupleQuery

Package com.franz.agraph.repository

# Class AGStreamTupleQuery

java.lang.Object
org.eclipse.rdf4j.query.impl.AbstractOperation
org.eclipse.rdf4j.query.impl.AbstractQuery
com.franz.agraph.repository.AGQuery
com.franz.agraph.repository.AGTupleQuery
com.franz.agraph.repository.AGStreamTupleQuery

All Implemented Interfaces:
  `org.eclipse.rdf4j.query.Operation`, `org.eclipse.rdf4j.query.Query`, `org.eclipse.rdf4j.query.TupleQuery`

public class AGStreamTupleQuery extends AGTupleQuery implements org.eclipse.rdf4j.query.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:
  - `AGRepositoryConnection.prepareTupleQuery(org.eclipse.rdf4j.query.QueryLanguage, String)`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.eclipse.rdf4j.query.Query

  `org.eclipse.rdf4j.query.Query.QueryType`

- ## Field Summary

  ### Fields inherited from class com.franz.agraph.repository.AGQuery

  `RDFS_PLUS_PLUS, RESTRICTION, SPARQL_COVERAGE_PLANNER, SPARQL_IDENTITY_PLANNER`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AGStreamTupleQuery(AGTupleQuery query)`
  Wraps a query with this object that will stream the response.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `org.eclipse.rdf4j.query.TupleQueryResult`
  `evaluate()`
  Returns a result object that will read from the http response as results are requested, by `TupleQueryResult`.`hasNext()`.
  `void`
  `evaluate(org.eclipse.rdf4j.query.TupleQueryResultHandler handler)`

  ### Methods inherited from class com.franz.agraph.repository.AGTupleQuery

  `count, download, download, stream`

  ### Methods inherited from class com.franz.agraph.repository.AGQuery

  `analyze, download, download, download, download, getBaseURI, getBindingsArray, getEngine, getEntailmentRegime, getFranzOptionPrefixString, getLanguage, getLimit, getName, getOffset, getPlanner, getQueryString, hashCode, isCheckVariables, isLoggingEnabled, isPrepared, setCheckVariables, setEngine, setEntailmentRegime, setIncludeInferred, setLimit, setLoggingEnabled, setOffset, setPlanner, setPrepared, setSaveName, stream, stream, toString`

  ### Methods inherited from class org.eclipse.rdf4j.query.impl.AbstractQuery

  `getMaxQueryTime, setMaxQueryTime`

  ### Methods inherited from class org.eclipse.rdf4j.query.impl.AbstractOperation

  `clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setMaxExecutionTime`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.eclipse.rdf4j.query.Operation

  `clearBindings, getBindings, getDataset, getIncludeInferred, getMaxExecutionTime, removeBinding, setBinding, setDataset, setIncludeInferred, setMaxExecutionTime`

  ### Methods inherited from interface org.eclipse.rdf4j.query.Query

  `explain, getMaxQueryTime, setMaxQueryTime`

- ## Constructor Details

  - ### AGStreamTupleQuery

    public AGStreamTupleQuery(AGTupleQuery query)
    Wraps a query with this object that will stream the response.
    Parameters:
      `query` - to wrap

- ## Method Details

  - ### evaluate

    public org.eclipse.rdf4j.query.TupleQueryResult evaluate() throws org.eclipse.rdf4j.query.QueryEvaluationException
    Returns a result object that will read from the http response as results are requested, by `TupleQueryResult`.`hasNext()`. (Note that `TupleQueryResult`.`next()` does not actually do the work if hasNext() is called first.)
    Specified by:
      `evaluate` in interface `org.eclipse.rdf4j.query.TupleQuery`
    Overrides:
      `evaluate` in class `AGTupleQuery`
    Throws:
      `org.eclipse.rdf4j.query.QueryEvaluationException`

  - ### evaluate

    public void evaluate(org.eclipse.rdf4j.query.TupleQueryResultHandler handler) throws org.eclipse.rdf4j.query.QueryEvaluationException, org.eclipse.rdf4j.query.TupleQueryResultHandlerException
    Specified by:
      `evaluate` in interface `org.eclipse.rdf4j.query.TupleQuery`
    Overrides:
      `evaluate` in class `AGTupleQuery`
    Throws:
      `org.eclipse.rdf4j.query.QueryEvaluationException`
      `org.eclipse.rdf4j.query.TupleQueryResultHandlerException`