[redland-dev] problem with OPTIONAL in sparql
Benno Blumenthal
benno at iri.columbia.edu
Mon Oct 31 18:32:25 GMT 2005
Hello All,
I am working with SPARQL through rasqal 0.9.10 in redland-1.0.2 under
linux 2.4.21-27.0.2.ELsmp.
When I try the query on my triple set
PREFIX iridl: <http://iridl.ldeo.columbia.edu/ontologies/iridl.owl#>
PREFIX iribib: <http://iridl.ldeo.columbia.edu/ontologies/iribib.owl#>
PREFIX rdfcache: <http://iridl.ldeo.columbia.edu/ontologies/rdfcache.owl#>
SELECT ?y ?x
WHERE { ?x iridl:hasSemantics ?y . ?y a iridl:Person .
?z iridl:isContainerOf ?x .
FILTER (bound(?z))
}
I get results.
When I change it to
PREFIX iridl: <http://iridl.ldeo.columbia.edu/ontologies/iridl.owl#>
PREFIX iribib: <http://iridl.ldeo.columbia.edu/ontologies/iribib.owl#>
PREFIX rdfcache: <http://iridl.ldeo.columbia.edu/ontologies/rdfcache.owl#>
SELECT ?y ?x
WHERE { ?x iridl:hasSemantics ?y . ?y a iridl:Person .
OPTIONAL { ?z iridl:isContainerOf ?x } .
FILTER (bound(?z))
}
I get nothing.
The query I really want is a more complicated version of
PREFIX iridl: <http://iridl.ldeo.columbia.edu/ontologies/iridl.owl#>
PREFIX iribib: <http://iridl.ldeo.columbia.edu/ontologies/iribib.owl#>
PREFIX rdfcache: <http://iridl.ldeo.columbia.edu/ontologies/rdfcache.owl#>
SELECT ?y ?x
WHERE { ?x iridl:hasSemantics ?y . ?y a iridl:Person .
OPTIONAL { ?z iridl:isContainerOf ?x . iridl:hasSemantics ?a
. ?a a iridl:Person } .
FILTER (!bound(?z))
}
in case you were wondering....
Is this clearly a bug, or am I missing something simple? If it is a
bug, how can I usefully contribute a bug report or where could I look to
try to fix this?
Benno
--
Dr. M. Benno Blumenthal benno at iri.columbia.edu
International Research Institute for climate prediction
The Earth Institute at Columbia University
Lamont Campus, Palisades NY 10964-8000 (845) 680-4450
More information about the redland-dev
mailing list