Package org.apache.jena.query
Interface ResultSet
-
- All Superinterfaces:
java.util.Iterator<QuerySolution>
- All Known Subinterfaces:
ResultSetPeekable
,ResultSetRewindable
- All Known Implementing Classes:
RDFInput
,ResultSetAdapter
,ResultSetCheckCondition
,ResultSetCloseable
,ResultSetMem
,ResultSetPeeking
,ResultSetStream
,ResultSetWrapper
,ResultsStAX
public interface ResultSet extends java.util.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:
Query
,QueryExecution
,QuerySolution
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static ResultSet
adapt(RowSet rowSet)
void
close()
Model
getResourceModel()
Get the model that resources are created against - may be nulljava.util.List<java.lang.String>
getResultVars()
Get the variable names for the projection.int
getRowNumber()
Return the "row" number for the current iterator itemboolean
hasNext()
Is there another result?default ResultSet
materialise()
Return aResultSet
that is not connected to the original source.QuerySolution
next()
Moves onto the next result.Binding
nextBinding()
Move to the next binding (low level)QuerySolution
nextSolution()
Moves onto the next result (legacy - use .next()).default ResultSetRewindable
rewindable()
Convert this result set to aResultSetRewindable
.
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Is there another result?- Specified by:
hasNext
in interfacejava.util.Iterator<QuerySolution>
-
next
QuerySolution next()
Moves onto the next result.- Specified by:
next
in interfacejava.util.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
java.util.List<java.lang.String> getResultVars()
Get the variable names for the projection. Not all query solutions from a result have every variable defined.
-
getResourceModel
Model getResourceModel()
Get the model that resources are created against - may be null
-
rewindable
default ResultSetRewindable rewindable()
Convert this result set to aResultSetRewindable
.Warning: this is likely a copy:
- "this" result set is consumed and not reusable.
- the copy is in-memory
Example of use:
ResultSetRewindable rs = queryExecution.execSelect().rewindable();
-
materialise
default ResultSet materialise()
Return aResultSet
that is not connected to the original source. This consumes this ResultSet and produces another one.
-
close
void close()
-
-