From: Sergey C. <rdf...@an...> - 2008-08-14 04:34:04
|
It looks like RAP is having a significant issue with handling OPTIONAL blocks - when variable from mandatory part is also used within OPTIONAL block and non-optional part of the query matches nothing, OPTIONAL block still gets executed as if there was no mandatory part of the query. For example, query like this: *PREFIX dc: <http://purl.org/dc/elements/1.1/>* *PREFIX foaf: <http://xmlns.com/foaf/0.1/>* *SELECT ?blog, ?title WHERE {* *<http://www.sergeychernyshev.com/sergey> foaf:weblog ?blog .* *OPTIONAL { ?blog dc:title ?title}* *}* ran against http://www.sergeychernyshev.com/sergey.rdf (where foaf:weblog triple exists) works fine and returns one entry with defined ?blog and empty ?title. But query *PREFIX dc: <http://purl.org/dc/elements/1.1/>* *PREFIX foaf: <http://xmlns.com/foaf/0.1/>* *SELECT ?blog, ?title WHERE {* *<http://www.w3.org/People/Berners-Lee/card#i> foaf:weblog ?blog .* *OPTIONAL { ?blog dc:title ?title}* *}* ran against http://www.sergeychernyshev.com/profile/tests/timbl.rdf (where no foaf:weblog triples exist) returns ?blog variables bound to all subjects that have dc:title properties as if this query was ran *PREFIX dc: <http://purl.org/dc/elements/1.1/>* *PREFIX foaf: <http://xmlns.com/foaf/0.1/>* *SELECT ?blog, ?title WHERE {* *OPTIONAL { ?blog dc:title ?title}* *}* I don't even know how to approach this! Will appreciate any help. Thank you, Sergey -- Sergey Chernyshev http://www.sergeychernyshev.com/ |