Interface ResultSet

All Superinterfaces:
All Known Subinterfaces:
ResultSetPeekable, ResultSetRewindable
All Known Implementing Classes:
RDFInput, ResultSetAdapter, ResultSetCheckCondition, ResultSetCloseable, ResultSetMem, ResultSetOnClose, ResultSetPeeking, ResultSetStream, ResultSetWrapper

public interface ResultSet extends Iterator<QuerySolution>
Results from a query in a table-like manner for SELECT queries. Each row corresponds to a set of bindings which fulfil the conditions of the query. Access to the results is by variable name.
See Also:
  • Method Details

    • adapt

      static ResultSet adapt(RowSet rowSet)
    • hasNext

      boolean hasNext()
      Is there another result?
      Specified by:
      hasNext in interface Iterator<QuerySolution>
    • next

      Moves onto the next result.
      Specified by:
      next in interface Iterator<QuerySolution>
    • forEachRemaining

      void forEachRemaining(Consumer<? super QuerySolution> action)
      Specified by:
      forEachRemaining in interface Iterator<QuerySolution>
    • nextSolution

      QuerySolution nextSolution()
      Moves onto the next result (legacy - use .next()).
    • nextBinding

      Binding nextBinding()
      Move to the next binding (low level)
    • getRowNumber

      int getRowNumber()
      Return the "row" number for the current iterator item
    • getResultVars

      List<String> getResultVars()
      Get the variable names for the projection. Not all query solutions from a result have every variable defined.
    • getResourceModel

      org.apache.jena.rdf.model.Model getResourceModel()
      Get the model that resources are created against - may be null
    • rewindable

      default ResultSetRewindable rewindable()
      Convert this result set to a ResultSetRewindable.

      Warning: this is likely a copy:

      • "this" result set is consumed and not reusable.
      • the copy is in-memory
      Use the returned object, not "this" result set after calling this method.

      Example of use:

         ResultSetRewindable rs = queryExecution.execSelect().rewindable();
    • materialise

      default ResultSet materialise()
      Return a ResultSet that is not connected to the original source. This consumes this ResultSet and produces another one.
    • close

      void close()