Damian,

Thanks, that clarified how to use BINDINGS, which I'd been wondering about!

I've now tried that approach, but it turns out to be very slow...


My benchmarks so far (milliseconds):

Query per resource:                         735

Filter using IN(), in batches of 50:     109

Bindings, in batches of 50:             4047

One query for all resources:           2000

(This is for querying 200 resources from a model containing about 100K
triples; the query is repeated 10 times to get significant durations).


Cheers,

David.


Damian Steer wrote:

>>Is the performance of the IN() function O(n), and if so can anything be
easily done to improve this?

>I suspect the answers are: yes, and maybe.

>and, is there a better way to do this kind of query?

>I've never used them, but how about using bindings? [1]

>SELECT ?res ?lat ?lon { ?res <http://example.com#lat> ?lat; <
http://example.com#lon> ?lon . } BINDINGS ?res {
(<http://example.com#myresource123>)
(<http://example.com#myresource124>) }

>My naïve understanding is that this ought to operate like a regular join.

Reply via email to