[redland-dev] How does OPTIONAL work?

Jasper van de Gronde th.v.d.gronde at hccnet.nl
Mon May 16 19:58:08 BST 2005


Marinaio di terra wrote:

> On Mon, 2005-05-16 at 14:27 +0100, Chris Dollin wrote:
> 
>>>              "WHERE (<file:./sample.rdf#Ball> toy:name ?name) " +
>>>              "OPTIONAL (<file:/sample.rdf#Ball> toy:version ?ver)",
>>
>>Look carefully at the two file: URIs.
>>
> 
> Whoops, well you're right but the result doesn't change even setting the
> wrong URI to <file:./sample.rdf#Ball>

You may want to try with a more straightforward URI, like 
http://something/somethingelse. I'm not entirely sure how the leading 
dot in your path is to be interpreted, but I'd try to at least make sure 
that it isn't the URI that is in some way giving you the trouble.

Also try the query without the OPTIONAL part and see what that does 
(don't forget to remove ?ver from SELECT too), and you may also want to 
try just removing the OPTIONAL keyword (so only the resource with both a 
name and version will match).



More information about the redland-dev mailing list