RDFLib/rdflib — Issue #30: DESCRIBE without WHERE clause or empty WHERE clause does not work as expected
Author: gjhiggins
Created: 2012-02-20 08:30:52+00:00
State: open

ralf.hen...@gmail.com, 2008-10-30T10:34:15.000Z

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.

Comment 1 by ralf.hen...@gmail.com
Sorry, my mistake. This works (expect for "DESCRIBE ?uri").

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.