Class QueryExecBaseSelect

java.lang.Object
org.aksw.commons.util.closeable.AutoCloseableBase
org.aksw.jenax.dataaccess.sparql.exec.query.QueryExecBaseSelect
All Implemented Interfaces:
AutoCloseable, QueryExecBaseIterator, org.apache.jena.sparql.exec.QueryExec
Direct Known Subclasses:
QueryExecOverRowSet, QueryExecSelect

public abstract class QueryExecBaseSelect extends org.aksw.commons.util.closeable.AutoCloseableBase implements QueryExecBaseIterator
Map all non-select sparql query types to select queries. Works for CONSTRUCT and ASK. DESCRIBE and JSON not yet supported.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.jena.sparql.exec.QueryExec
     
    protected boolean
     
    protected org.apache.jena.query.Query
     
    protected boolean
    If true, then triples and quads are produced by raw substitution with the bindings.

    Fields inherited from class org.aksw.commons.util.closeable.AutoCloseableBase

    closeStackTrace, enableCloseStackTrace, isClosed
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryExecBaseSelect(org.apache.jena.query.Query query)
     
    QueryExecBaseSelect(org.apache.jena.query.Query query, boolean rawTuples)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    static org.apache.jena.query.Query
    adjust(org.apache.jena.query.Query query)
     
    boolean
    ask()
     
    protected void
     
    Iterator<org.apache.jena.sparql.core.Quad>
     
    Iterator<org.apache.jena.graph.Triple>
     
    Iterator<org.apache.jena.graph.Triple>
    We use this query execution for retrieving the result set of the where clause, but we neet the subFactory to describe the individual resources then.
    protected abstract org.apache.jena.sparql.exec.QueryExec
    doSelect(org.apache.jena.query.Query selectQuery)
    The actual method that needs to be implemented.
    Iterator<org.apache.jena.atlas.json.JsonObject>
     
    org.apache.jena.sparql.util.Context
     
    org.apache.jena.sparql.core.DatasetGraph
     
    org.apache.jena.query.Query
     
     
    protected org.apache.jena.sparql.exec.RowSet
    internalSelect(org.apache.jena.query.Query selectQuery)
     
    boolean
     
    org.apache.jena.sparql.exec.RowSet
     
    protected void
    setActiveQueryExec(org.apache.jena.sparql.exec.QueryExec queryExec)
     

    Methods inherited from class org.aksw.commons.util.closeable.AutoCloseableBase

    close, ensureOpen, throwClosedException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.exec.QueryExec

    close

    Methods inherited from interface org.aksw.jenax.dataaccess.sparql.exec.query.QueryExecBaseIterator

    construct, construct, constructDataset, constructDataset, describe, describe, execJson
  • Field Details

    • query

      protected org.apache.jena.query.Query query
    • rawTuples

      protected boolean rawTuples
      If true, then triples and quads are produced by raw substitution with the bindings. This means literals and variables (that are not substituted) may appear in any component.
    • activeQueryExec

      protected volatile org.apache.jena.sparql.exec.QueryExec activeQueryExec
    • isCancelled

      protected volatile boolean isCancelled
  • Constructor Details

    • QueryExecBaseSelect

      public QueryExecBaseSelect(org.apache.jena.query.Query query)
    • QueryExecBaseSelect

      public QueryExecBaseSelect(org.apache.jena.query.Query query, boolean rawTuples)
  • Method Details

    • doSelect

      protected abstract org.apache.jena.sparql.exec.QueryExec doSelect(org.apache.jena.query.Query selectQuery)
      The actual method that needs to be implemented. The argument is always a SPARQL query of select type. The RowSet may need to implement close() in order to close an underlying query execution.
    • getDataset

      public org.apache.jena.sparql.core.DatasetGraph getDataset()
      Specified by:
      getDataset in interface org.apache.jena.sparql.exec.QueryExec
    • getContext

      public org.apache.jena.sparql.util.Context getContext()
      Specified by:
      getContext in interface org.apache.jena.sparql.exec.QueryExec
    • abort

      public void abort()
      Specified by:
      abort in interface org.apache.jena.sparql.exec.QueryExec
    • closeActual

      protected void closeActual() throws Exception
      Overrides:
      closeActual in class org.aksw.commons.util.closeable.AutoCloseableBase
      Throws:
      Exception
    • setActiveQueryExec

      protected void setActiveQueryExec(org.apache.jena.sparql.exec.QueryExec queryExec)
    • internalSelect

      protected org.apache.jena.sparql.exec.RowSet internalSelect(org.apache.jena.query.Query selectQuery)
    • adjust

      public static org.apache.jena.query.Query adjust(org.apache.jena.query.Query query)
    • ask

      public boolean ask()
      Specified by:
      ask in interface org.apache.jena.sparql.exec.QueryExec
    • constructQuads

      public Iterator<org.apache.jena.sparql.core.Quad> constructQuads()
      Specified by:
      constructQuads in interface org.apache.jena.sparql.exec.QueryExec
    • constructTriples

      public Iterator<org.apache.jena.graph.Triple> constructTriples()
      Specified by:
      constructTriples in interface org.apache.jena.sparql.exec.QueryExec
    • select

      public org.apache.jena.sparql.exec.RowSet select()
      Specified by:
      select in interface org.apache.jena.sparql.exec.QueryExec
    • getQuery

      public org.apache.jena.query.Query getQuery()
      Specified by:
      getQuery in interface org.apache.jena.sparql.exec.QueryExec
    • getQueryString

      public String getQueryString()
      Specified by:
      getQueryString in interface org.apache.jena.sparql.exec.QueryExec
    • execJsonItems

      public Iterator<org.apache.jena.atlas.json.JsonObject> execJsonItems()
      Specified by:
      execJsonItems in interface org.apache.jena.sparql.exec.QueryExec
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface org.apache.jena.sparql.exec.QueryExec
    • describeTriples

      public Iterator<org.apache.jena.graph.Triple> describeTriples()
      We use this query execution for retrieving the result set of the where clause, but we neet the subFactory to describe the individual resources then.
      Specified by:
      describeTriples in interface org.apache.jena.sparql.exec.QueryExec
      Returns: