RDFLib/rdflib — Issue #86: OPTIONAL doesn't work in SPARQL queries
Author: gjhiggins
Created: 2012-02-20 08:32:21+00:00
State: open

cuu...@gmail.com, 2009-11-13T12:27:08.000Z

What steps will reproduce the problem?

>>> from rdflib.graph import ConjunctiveGraph
>>> from rdflib.term import URIRef
>>> x = ConjunctiveGraph()
>>> x.add((URIRef("http://a"), URIRef("http://b"), URIRef("http://c")))
>>> list(x.query("SELECT ?s WHERE { ?s ?p ?o } "))
[rdflib.term.URIRef('http://a')]
>>> # Expect to get the same result with OPTIONAL:
>>> list(x.query("SELECT ?s WHERE { OPTIONAL { ?s ?p ?o } } "))
[]

What version of the product are you using? On what operating system?

rdflib 2.4.2 and rdflib 2.5.0 (r1722)

Comment 2 by eik...@gmail.com

Comment 3 by eik...@gmail.com

Comment 4 by eik...@gmail.com
These issues involve bits that have been moved out of rdflib proper for now. We will re-open them
or move them to rdfextas as appropriate.