I also notice a weirdness this BGP pattern ?o2 <http://foo/id> "some id" is somehow not passed by Jena, hence it never got optimized [:(]
The prime suspect is the FILTER line, which if I remove it, or change it to FILTER (?o1 = ?o2) (note this is just for experimental purpose since it's not making sense), then I can see pattern ?o2 <http://foo/id> "some id" is being passed now. Weird.. ________________________________ From: Zen 98052 <[email protected]> Sent: Friday, June 3, 2016 1:28:48 PM To: [email protected] Subject: optimize a query Hi, Is there a way to rewrite this Sparql query to run more efficiently? SELECT ?s WHERE { ?s <http://foo/bar> ?o1, ?o2 . ?o2 <http://foo/id> "some id" . FILTER (?o1 != ?o2) . } It seems to me this can be optimized, I am still trying to figure it out. Thanks, Z
