On 05/10/11 15:25, Jérôme wrote:
Hi all,
I am currently working with Jena and Fuseki. My web application queries
the remote fuseki server with a
"QueryExecutionFactory.sparqlService(url, query)" call.
The server answers quickly, but the resultSet iteration is really slow.
QueryExecution qExec = QueryExecutionFactory.sparqlService(url, query);
ResultSet set = qExec.execSelect();
This sets things up and connects to the server - it does not recieve all
the results.
log.info("start");
while (set.hasNext()) {
This receives a result.
Underlying network buffers bytes.
set.next();
}
log.info("done");
between 2 and 6 seconds from "start" to "done".
1-Why is it so long? How can i boost it?
I guess the query is expensive in some way - what is the query? how much
data?
2-Is there a way to know the number of solutions without iterate over
the resultSet?
ARQ is a streaming results system unless you want to do something
different. Counting needs to walk over the results (especially in the
case of a remote execution).
Force the results to be collected with ResultSetFactory.makeRewindable
and you can count them or print them, and reset the result set.
Andy
Thanks.
Jérôme.