gjhiggins/rdflib — Issue #31: DESCRIBE without WHERE clause or empty WHERE clause does not work as expected
Author: gjhiggins
Created: 2011-10-19 01:00:09+00:00
State: open

Originally filed by ralf.hen...@gmail.com on 2008-10-30T10:34:15

What steps will reproduce the problem?

query = "DESCRIBE ?uri WHERE { }" # or "DESCRIBE ?uri"
bnd = { Variable("?uri"): DFL['ralf'] }

result = store_graph.query(query, initNs=dict(foaf=FOAF, vc=VC, dflt=DFL),
initBindings=bnd)

Gives:

DESCRIBE ?uri WHERE { ?uri ?p ?a . }
Traceback (most recent call last):
File "readwrite.py", line 149, in
result = store_graph.query(query, initNs=dict(foaf=FOAF, vc=VC,
dflt=DFL), initBindings=bnd)
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 738, in query
File "build/bdist.linux-i686/egg/rdflib/sparql/QueryResult.py", line 250,
in __init__
TypeError: 'NoneType' object is not iterable

Without a WHERE clause (like in
http://www.w3.org/TR/rdf-sparql-query/#describe), this excetpion is thrown:

Traceback (most recent call last):
File "readwrite.py", line 150, in
result = store_graph.query(query, initNs=dict(foaf=FOAF, vc=VC, dflt=DFL))
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 738, in query
File "build/bdist.linux-i686/egg/rdflib/sparql/bison/Processor.py", line
34, in query
File "build/bdist.linux-i686/egg/rdflib/sparql/bison/Processor.py", line
16, in Parse
SyntaxError: parse error at line 1, column 43: reached end-of-input,
expecting 'VARNAME' or 'ASTERISK'

What is the expected output? What do you see instead?

Description of resource. The query works for a non-empty WHERE clause.

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

Please provide any additional information below.