I am using Apache Jena's QueryFactory class to transform my SPARQL query string into a Query object for manipulation.
The problem I have is that the single snippet of code shown below takes 5 seconds to run, which is unacceptable.
Query query = QueryFactory.create("PREFIX foaf: <http://xmlns.com/foaf/0.1/>\n" +
"PREFIX dc: <http://purl.org/dc/elements/1.1/>\n" +
"\n" +
"SELECT ?who ?g ?mbox\n" +
"FROM <http://example.org/dft.ttl>\n" +
"FROM NAMED <http://example.org/alice>\n" +
"FROM NAMED <http://example.org/bob>\n" +
"WHERE\n" +
"{\n" +
" ?g dc:publisher ?who .\n" +
" GRAPH ?g { ?x foaf:mbox ?mbox }\n" +
"}");
I am wondering if anyone could provide a reasonable explanation for this, some way of improving the performance, or another alternative to this code altogether.