Class ReusableGraphQueryResult

java.lang.Object
org.eclipse.rdf4j.spring.resultcache.ReusableGraphQueryResult
All Implemented Interfaces:
AutoCloseable, Iterable<Statement>, CloseableIteration<Statement,QueryEvaluationException>, Iteration<Statement,QueryEvaluationException>, GraphQueryResult, QueryResult<Statement>, ThrowableRecorder

public class ReusableGraphQueryResult extends Object implements GraphQueryResult, ThrowableRecorder
Wrapper for a TupleQueryResult, allowing the result to be replayed. Not thread-safe. The wrapper copies the result data, consuming the original result fully on close().

Example:

 TupleQueryResult result = tupleQuery.execute();
 ReuseableTupleQueryResult reusable = new ReuseableTupleQueryResult(result);
 while (reusable.hasNext()) {
        reuseable.next();
 }
 reuseable.close();
 GraphQueryResult cached = reuseable.recreateGraphQueryResult();
 while (cached.hasNext()) {
        cached.next();
 }
 cached.close();

 
Since:
4.0.0
Author:
Florian Kleedorfer