gjhiggins/rdfextras — Issue #15: Check for plain literals without lang tag doesn't work
Author: gjhiggins
Created: 2011-10-19 02:59:50+00:00
State: open
Labels: Priority-Medium, Type-Defect

Originally filed by joernh...@gmail.com on 2010-11-08T13:05:12

Example code:
graph = ConjunctiveGraph()
graph.add((rdflib.URIRef("http://example.org/#test"), RDFS.label, rdflib.Literal("foobar")))
q = """
SELECT ?p ?o
WHERE {
?p ?o.
FILTER( lang(?o) = "" )
}
"""
pprint(list(graph))
pprint(list(graph.query(q)))

Prints:
[(rdflib.term.URIRef('http://example.org/#test'),
rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#label'),
rdflib.term.Literal(u'foobar'))]
[]

As you can see the second result doesn't include anything, which I think is wrong.