Class QueryExecutionCompat

java.lang.Object
org.apache.jena.sparql.exec.QueryExecutionAdapter
org.apache.jena.sparql.exec.QueryExecutionCompat
All Implemented Interfaces:
AutoCloseable, QueryExecution

public class QueryExecutionCompat extends QueryExecutionAdapter
Query execution that delays making the QueryExecution until needed by exec
See Also:
  • Method Details

    • compatibility

      public static QueryExecution compatibility(QueryExecMod qExec, Dataset dataset, Query query, String queryString)
    • getDataset

      public Dataset getDataset()
      Description copied from class: QueryExecutionAdapter
      The dataset against which the query will execute. May be null, implying it is expected that the query itself has a dataset description.
      Specified by:
      getDataset in interface QueryExecution
      Overrides:
      getDataset in class QueryExecutionAdapter
    • getContext

      public Context getContext()
      Description copied from class: QueryExecutionAdapter
      The properties associated with a query execution - implementation specific parameters This includes Java objects (so it is not an RDF graph). Keys should be URIs as strings. May be null (this implementation does not provide any configuration).
      Specified by:
      getContext in interface QueryExecution
      Overrides:
      getContext in class QueryExecutionAdapter
    • getQuery

      public Query getQuery()
      Description copied from class: QueryExecutionAdapter
      The query associated with a query execution. May be null (QueryExecution may have been created by other means)
      Specified by:
      getQuery in interface QueryExecution
      Overrides:
      getQuery in class QueryExecutionAdapter
    • execSelect

      public ResultSet execSelect()
      Description copied from class: QueryExecutionAdapter
      Execute a SELECT query

      Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the SELECT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.

      Specified by:
      execSelect in interface QueryExecution
      Overrides:
      execSelect in class QueryExecutionAdapter
    • execConstruct

      public org.apache.jena.rdf.model.Model execConstruct()
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query
      Specified by:
      execConstruct in interface QueryExecution
      Overrides:
      execConstruct in class QueryExecutionAdapter
    • execConstruct

      public org.apache.jena.rdf.model.Model execConstruct(org.apache.jena.rdf.model.Model model)
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query, putting the statements into a graph.
      Specified by:
      execConstruct in interface QueryExecution
      Overrides:
      execConstruct in class QueryExecutionAdapter
      Returns:
      Graph The model argument for cascaded code.
    • execConstructTriples

      public Iterator<org.apache.jena.graph.Triple> execConstructTriples()
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query, returning the results as an iterator of Triple.

      Caution: This method may return duplicate Triples. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.

      Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the CONSTRUCT query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.

      Specified by:
      execConstructTriples in interface QueryExecution
      Overrides:
      execConstructTriples in class QueryExecutionAdapter
      Returns:
      An iterator of Triple objects (possibly containing duplicates) generated by applying the CONSTRUCT template of the query to the bindings in the WHERE clause.
    • execConstructQuads

      public Iterator<Quad> execConstructQuads()
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query, returning the results as an iterator of Quad.

      Caution: This method may return duplicate Quads. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.

      An iterator of Quad objects (possibly containing duplicates) generated by applying the CONSTRUCT template of the query to the bindings in the WHERE clause.

      See QueryExecutionAdapter.execConstructTriples() for usage and features.

      Specified by:
      execConstructQuads in interface QueryExecution
      Overrides:
      execConstructQuads in class QueryExecutionAdapter
      Returns:
      An iterator of Quad objects (possibly containing duplicates) generated by applying the CONSTRUCT template of the query to the bindings in the WHERE clause.
    • execConstructDataset

      public Dataset execConstructDataset()
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query, putting the statements into 'dataset'. This maybe an extended syntax query (if supported).
      Specified by:
      execConstructDataset in interface QueryExecution
      Overrides:
      execConstructDataset in class QueryExecutionAdapter
    • execConstructDataset

      public Dataset execConstructDataset(Dataset dataset)
      Description copied from class: QueryExecutionAdapter
      Execute a CONSTRUCT query, putting the statements into 'dataset'. This may be an extended syntax query (if supported).
      Specified by:
      execConstructDataset in interface QueryExecution
      Overrides:
      execConstructDataset in class QueryExecutionAdapter
    • execDescribe

      public org.apache.jena.rdf.model.Model execDescribe()
      Description copied from class: QueryExecutionAdapter
      Execute a DESCRIBE query
      Specified by:
      execDescribe in interface QueryExecution
      Overrides:
      execDescribe in class QueryExecutionAdapter
    • execDescribe

      public org.apache.jena.rdf.model.Model execDescribe(org.apache.jena.rdf.model.Model model)
      Description copied from class: QueryExecutionAdapter
      Execute a DESCRIBE query, putting the statements into a graph.
      Specified by:
      execDescribe in interface QueryExecution
      Overrides:
      execDescribe in class QueryExecutionAdapter
      Returns:
      Graph The model argument for cascaded code.
    • execDescribeTriples

      public Iterator<org.apache.jena.graph.Triple> execDescribeTriples()
      Description copied from class: QueryExecutionAdapter
      Execute a DESCRIBE query, returning the results as an iterator of Triple.

      Caution: This method may return duplicate Triples. This method may be useful if you only need the results for stream processing, as it can avoid having to place the results in a Model.

      Important: The name of this method is somewhat of a misnomer in that depending on the underlying implementation this typically does not execute the DESCRIBE query but rather answers a wrapper over an internal data structure that can be used to answer the query. In essence calling this method only returns a plan for executing this query which only gets evaluated when you actually start iterating over the results.

      Specified by:
      execDescribeTriples in interface QueryExecution
      Overrides:
      execDescribeTriples in class QueryExecutionAdapter
      Returns:
      An iterator of Triple objects (possibly containing duplicates) generated as the output of the DESCRIBE query.
    • execAsk

      public boolean execAsk()
      Description copied from class: QueryExecutionAdapter
      Execute an ASK query
      Specified by:
      execAsk in interface QueryExecution
      Overrides:
      execAsk in class QueryExecutionAdapter
    • execJson

      public JsonArray execJson()
      Description copied from class: QueryExecutionAdapter
      Execute a JSON query and return a json array
      Specified by:
      execJson in interface QueryExecution
      Overrides:
      execJson in class QueryExecutionAdapter
    • execJsonItems

      public Iterator<JsonObject> execJsonItems()
      Description copied from class: QueryExecutionAdapter
      Execute a JSON query and return an iterator
      Specified by:
      execJsonItems in interface QueryExecution
      Overrides:
      execJsonItems in class QueryExecutionAdapter
    • abort

      public void abort()
      Description copied from class: QueryExecutionAdapter
      Stop in mid execution. This method can be called in parallel with other methods on the QueryExecution object. There is no guarantee that the concrete implementation actual will stop or that it will do so immediately. No operations on the query execution or any associated result set are permitted after this call and may cause exceptions to be thrown.
      Specified by:
      abort in interface QueryExecution
      Overrides:
      abort in class QueryExecutionAdapter
    • close

      public void close()
      Description copied from class: QueryExecutionAdapter
      Close the query execution and stop query evaluation as soon as convenient. QueryExecution objects, and a ResultSet from QueryExecutionAdapter.execSelect(), can not be used once the QueryExecution is closed. Model results from QueryExecutionAdapter.execConstruct() and QueryExecutionAdapter.execDescribe() are still valid. It is important to close query execution objects in order to release resources such as working memory and to stop the query execution. Some storage subsystems require explicit ends of operations and this operation will cause those to be called where necessary. No operations on the query execution or any associated result set are permitted after this call.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface QueryExecution
      Overrides:
      close in class QueryExecutionAdapter
    • isClosed

      public boolean isClosed()
      Description copied from class: QueryExecutionAdapter
      Answer whether this QueryExecution object has been closed or not.
      Specified by:
      isClosed in interface QueryExecution
      Overrides:
      isClosed in class QueryExecutionAdapter
      Returns:
      boolean
    • getTimeout1

      public long getTimeout1()
      Description copied from class: QueryExecutionAdapter
      Return the first timeout (time to first result), in milliseconds: negative if unset
      Specified by:
      getTimeout1 in interface QueryExecution
      Overrides:
      getTimeout1 in class QueryExecutionAdapter
    • getTimeout2

      public long getTimeout2()
      Description copied from class: QueryExecutionAdapter
      Return the second timeout (overall query execution after first result), in milliseconds: negative if unset
      Specified by:
      getTimeout2 in interface QueryExecution
      Overrides:
      getTimeout2 in class QueryExecutionAdapter