On 21/10/13 22:07, Phil Ashworth wrote:
I want to combine the resultsets together. For this I've used a model (
perhaps incorrectly).
I'm afraid so.
To get a list of results, use ResultSetFormatter toList and concatenate
the lists. If you really want a ResultSet, get as a list of Bindings
(you'll need to write the loop), and use ResultSetStream/
final com.hp.hpl.jena.sparql.resultset.SPARQLResult finalresults = new
com.hp.hpl.jena.sparql.resultset.SPARQLResult(resultModel);
//Everything works fine up to here.
final com.hp.hpl.jena.query.ResultSet results =
finalresults.getResultSet();
The last line throws the error.
com.hp.hpl.jena.sparql.resultset.ResultSetException: Not an ResultSet
result
at com.hp.hpl.jena.sparql.resultset.SPARQLResult.getResultSet
SPARQLResult is a usually internal class for carrying around any kind of
SPARQL results. It's a very simple types holder.
A model is the outcome of a CONSTRUCT or DESCRIBE. The fact it is a
ResultSet encoded in a model is opaque to the SPARQLResult class. A
model is from CONSTRUCT or DESCRIBE.
You have put a model into a SPARQLResult so you can't get a result set out.
Andy