Damian, Will post the full benchmark when I've tidied it a little, but the main problem seems to be that the BINDINGS query isn't working as expected and is returning ALL resources.
So either I'm misunderstanding how to use BINDINGS (entirely likely!) or there's a mistake in my query, or something is really wrong! See test case below, which returns all ten resources, when I'd expect it to only return one (for ns:myresource0). Just for clarity, the query below is: PREFIX ns: <http://www.example.com/namespace#> SELECT ?x ?lat ?lon {?x ns:latitude ?lat; ns:longitude ?lon} BINDINGS ?x { (ns:myresource0) } Cheers, David. public class SparqlBindings { public static void main(String[] args) { OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF); Property lat = ontModel.createProperty(" http://www.example.com/namespace#latitude"); Property lon = ontModel.createProperty(" http://www.example.com/namespace#longitude"); for (int i = 0; i < 10; i++) { Resource r = ontModel.createResource(" http://www.example.com/namespace#myresource" + i); ontModel.add(r, lat, Double.toString(90 * Math.random())); ontModel.add(r, lon, Double.toString(90 * Math.random())); } String query = "PREFIX ns: <http://www.example.com/namespace#>" + " SELECT ?x ?lat ?lon {?x ns:latitude ?lat; ns:longitude ?lon} " + "BINDINGS ?x {(ns:myresource0)}"; query(query, ontModel); } static void query(String sparqlQuery, OntModel ontModel) { Query query = QueryFactory.create(sparqlQuery, Syntax.syntaxARQ); QueryExecution qexec = QueryExecutionFactory.create(query, ontModel); ResultSet jenaResults = qexec.execSelect(); while (jenaResults.hasNext()) { QuerySolution qs = jenaResults.nextSolution(); System.out.println(qs); } qexec.close(); } } Damian Steer wrote: >Curses, I was so confident! That's quite a surprise. >Could you post your benchmark somewhere? I'd be interested to know why binding >is so slow. >Damian
