[redland-dev] Status of OPTIONAL

Knud Hinnerk Möller knud.moeller at deri.org
Tue Mar 20 20:06:10 UTC 2007


Hi,

I know OPTIONAL doesn't work properly yet - do you have any idea when  =

it will? Single OPTIONALS seem to work fine, but multiples don't seem  =

to work. In particular, this query from the SPARQL spec seems to work:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  { ?x foaf:name  ?name .
    OPTIONAL { ?x  foaf:mbox  ?mbox }
}

But this one doesn't:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox ?hpage
WHERE  { ?x foaf:name  ?name .
    OPTIONAL { ?x foaf:mbox ?mbox } .
    OPTIONAL { ?x foaf:homepage ?hpage }
}

The first OPTIONAL is ignored, and the query evaluates identically to:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox ?hpage
WHERE  { ?x foaf:name  ?name .
    ?x foaf:mbox ?mbox .
    OPTIONAL { ?x foaf:homepage ?hpage }
}

In the meantime, are there any code examples that show how to do a  =

workaround programmatically?

Cheers,
Knud
-------------------------------------------------
Knud M=F6ller, MA
+353 - 91 - 495086
Digital Enterprise Research Institute
   National University of Ireland, Galway
Institi=FAid Taighde na Fiontra=EDochta Digit=ED
   Ollscoil na h=C9ireann, Gaillimh


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/redland-dev/attachments/20070320/=
f06b2d8f/attachment.htm


More information about the redland-dev mailing list