Class QueryRunner

  • All Implemented Interfaces:
    Iterator<org.apache.jena.query.QuerySolution>, org.apache.jena.atlas.lib.Closeable

    public class QueryRunner
    extends Object
    implements org.apache.jena.atlas.lib.Closeable, Iterator<org.apache.jena.query.QuerySolution>
    Is able to run a SPARQL query on a Model.
    • Constructor Detail

      • QueryRunner

        public QueryRunner​(org.apache.jena.rdf.model.Model model,
                           QueryString queryString)
    • Method Detail

      • getResultSet

        public org.apache.jena.query.ResultSet getResultSet()
        Retrieve the output from the Model based on the given queryString. Note that depending on the underlying implementation, the actual running of the query is done while retrieving the actual results.
        Returns:
        See Also:
        QueryExecution.execSelect()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<org.apache.jena.query.QuerySolution>
      • next

        public org.apache.jena.query.QuerySolution next()
        Specified by:
        next in interface Iterator<org.apache.jena.query.QuerySolution>
      • close

        public void close()
        Specified by:
        close in interface org.apache.jena.atlas.lib.Closeable