Class VirtuosoQueryExecution

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.apache.jena.query.QueryExecution

    public class VirtuosoQueryExecution
    extends java.lang.Object
    implements org.apache.jena.query.QueryExecution
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long timeout  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()  
      void close()  
      boolean execAsk()  
      org.apache.jena.rdf.model.Model execConstruct()  
      org.apache.jena.rdf.model.Model execConstruct​(org.apache.jena.rdf.model.Model model)  
      org.apache.jena.query.Dataset execConstructDataset()
      Execute a CONSTRUCT query, putting the statements into 'dataset'.
      org.apache.jena.query.Dataset execConstructDataset​(org.apache.jena.query.Dataset dataset)
      Execute a CONSTRUCT query, putting the statements into 'dataset'.
      java.util.Iterator<org.apache.jena.sparql.core.Quad> execConstructQuads()
      Execute a CONSTRUCT query, returning the results as an iterator of Quad.
      java.util.Iterator<org.apache.jena.graph.Triple> execConstructTriples()
      Execute a CONSTRUCT query, returning the results as an iterator of Triple.
      org.apache.jena.rdf.model.Model execDescribe()  
      org.apache.jena.rdf.model.Model execDescribe​(org.apache.jena.rdf.model.Model model)  
      java.util.Iterator<org.apache.jena.graph.Triple> execDescribeTriples()
      Execute a DESCRIBE query, returning the results as an iterator of Triple.
      org.apache.jena.atlas.json.JsonArray execJson()  
      java.util.Iterator<org.apache.jena.atlas.json.JsonObject> execJsonItems()  
      org.apache.jena.query.ResultSet execSelect()  
      org.apache.jena.sparql.util.Context getContext()  
      org.apache.jena.query.Dataset getDataset()  
      org.apache.jena.query.Query getQuery()  
      java.lang.String getQueryString()
      The query as a string.
      long getTimeout1()
      Return the first timeout (time to first result), in millseconds: negative if unset
      long getTimeout2()
      Return the second timeout (overall query execution after first result), in millseconds: negative if unset
      boolean isClosed()  
      void setFileManager​(org.apache.jena.util.FileManager arg)  
      void setInitialBinding​(org.apache.jena.query.QuerySolution arg)  
      void setInitialBinding​(org.apache.jena.sparql.engine.binding.Binding binding)  
      void setTimeout​(long timeout)
      Set time, in milliseconds
      void setTimeout​(long timeout1, long timeout2)
      Set time, in milliseconds
      void setTimeout​(long timeout, java.util.concurrent.TimeUnit timeoutUnits)
      Set a timeout on the query execution.
      void setTimeout​(long timeout1, java.util.concurrent.TimeUnit timeUnit1, long timeout2, java.util.concurrent.TimeUnit timeUnit2)
      Set timeouts on the query execution; the first timeout refers to time to first result, the second refers to overall query execution after the first result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • timeout

        protected long timeout
    • Constructor Detail

      • VirtuosoQueryExecution

        public VirtuosoQueryExecution​(org.apache.jena.query.Query query,
                                      VirtGraph _graph)
      • VirtuosoQueryExecution

        public VirtuosoQueryExecution​(java.lang.String query,
                                      VirtGraph _graph)
    • Method Detail

      • execSelect

        public org.apache.jena.query.ResultSet execSelect()
        Specified by:
        execSelect in interface org.apache.jena.query.QueryExecution
      • setFileManager

        public void setFileManager​(org.apache.jena.util.FileManager arg)
      • setInitialBinding

        public void setInitialBinding​(org.apache.jena.query.QuerySolution arg)
        Specified by:
        setInitialBinding in interface org.apache.jena.query.QueryExecution
      • setInitialBinding

        public void setInitialBinding​(org.apache.jena.sparql.engine.binding.Binding binding)
        Specified by:
        setInitialBinding in interface org.apache.jena.query.QueryExecution
      • getDataset

        public org.apache.jena.query.Dataset getDataset()
        Specified by:
        getDataset in interface org.apache.jena.query.QueryExecution
      • getContext

        public org.apache.jena.sparql.util.Context getContext()
        Specified by:
        getContext in interface org.apache.jena.query.QueryExecution
      • getQuery

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

        public java.lang.String getQueryString()
        The query as a string. This may be null (QueryExecution may have been created by other means). This may contain non-Jena extensions and can not be parsed by Jena. If getQuery() is not null, this is a corresponding string that parses to the same query.
        Specified by:
        getQueryString in interface org.apache.jena.query.QueryExecution
      • execConstructQuads

        public java.util.Iterator<org.apache.jena.sparql.core.Quad> execConstructQuads()
        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.

        Specified by:
        execConstructQuads in interface org.apache.jena.query.QueryExecution
        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.

        See execConstructTriples() for usage and features.

      • execConstructDataset

        public org.apache.jena.query.Dataset execConstructDataset()
        Execute a CONSTRUCT query, putting the statements into 'dataset'. This maybe an exetended synatx query (if supported).
        Specified by:
        execConstructDataset in interface org.apache.jena.query.QueryExecution
      • execConstructDataset

        public org.apache.jena.query.Dataset execConstructDataset​(org.apache.jena.query.Dataset dataset)
        Execute a CONSTRUCT query, putting the statements into 'dataset'. This maybe an exetended synatx query (if supported).
        Specified by:
        execConstructDataset in interface org.apache.jena.query.QueryExecution
      • execConstruct

        public org.apache.jena.rdf.model.Model execConstruct()
        Specified by:
        execConstruct in interface org.apache.jena.query.QueryExecution
      • execConstruct

        public org.apache.jena.rdf.model.Model execConstruct​(org.apache.jena.rdf.model.Model model)
        Specified by:
        execConstruct in interface org.apache.jena.query.QueryExecution
      • execConstructTriples

        public java.util.Iterator<org.apache.jena.graph.Triple> execConstructTriples()
        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.
        Specified by:
        execConstructTriples in interface org.apache.jena.query.QueryExecution
        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.
      • execDescribe

        public org.apache.jena.rdf.model.Model execDescribe()
        Specified by:
        execDescribe in interface org.apache.jena.query.QueryExecution
      • execDescribe

        public org.apache.jena.rdf.model.Model execDescribe​(org.apache.jena.rdf.model.Model model)
        Specified by:
        execDescribe in interface org.apache.jena.query.QueryExecution
      • execDescribeTriples

        public java.util.Iterator<org.apache.jena.graph.Triple> execDescribeTriples()
        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.
        Specified by:
        execDescribeTriples in interface org.apache.jena.query.QueryExecution
        Returns:
        An iterator of Triple objects (possibly containing duplicates) generated as the output of the DESCRIBE query.
      • execAsk

        public boolean execAsk()
        Specified by:
        execAsk in interface org.apache.jena.query.QueryExecution
      • execJson

        public org.apache.jena.atlas.json.JsonArray execJson()
        Specified by:
        execJson in interface org.apache.jena.query.QueryExecution
      • execJsonItems

        public java.util.Iterator<org.apache.jena.atlas.json.JsonObject> execJsonItems()
        Specified by:
        execJsonItems in interface org.apache.jena.query.QueryExecution
      • abort

        public void abort()
        Specified by:
        abort in interface org.apache.jena.query.QueryExecution
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface org.apache.jena.query.QueryExecution
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface org.apache.jena.query.QueryExecution
      • setTimeout

        public void setTimeout​(long timeout,
                               java.util.concurrent.TimeUnit timeoutUnits)
        Set a timeout on the query execution. Processing will be aborted after the timeout (which starts when the approprate exec call is made). Not all query execution systems support timeouts. A timeout of less than zero means no timeout.
        Specified by:
        setTimeout in interface org.apache.jena.query.QueryExecution
      • setTimeout

        public void setTimeout​(long timeout)
        Set time, in milliseconds
        Specified by:
        setTimeout in interface org.apache.jena.query.QueryExecution
        See Also:
        setTimeout(long, TimeUnit)
      • setTimeout

        public void setTimeout​(long timeout1,
                               java.util.concurrent.TimeUnit timeUnit1,
                               long timeout2,
                               java.util.concurrent.TimeUnit timeUnit2)
        Set timeouts on the query execution; the first timeout refers to time to first result, the second refers to overall query execution after the first result. Processing will be aborted if a timeout expires. Not all query execution systems support timeouts. A timeout of less than zero means no timeout; this can be used for timeout1 or timeout2.
        Specified by:
        setTimeout in interface org.apache.jena.query.QueryExecution
      • setTimeout

        public void setTimeout​(long timeout1,
                               long timeout2)
        Set time, in milliseconds
        Specified by:
        setTimeout in interface org.apache.jena.query.QueryExecution
        See Also:
        setTimeout(long, TimeUnit, long, TimeUnit)
      • getTimeout1

        public long getTimeout1()
        Return the first timeout (time to first result), in millseconds: negative if unset
        Specified by:
        getTimeout1 in interface org.apache.jena.query.QueryExecution
      • getTimeout2

        public long getTimeout2()
        Return the second timeout (overall query execution after first result), in millseconds: negative if unset
        Specified by:
        getTimeout2 in interface org.apache.jena.query.QueryExecution