gjhiggins/rdflib — Issue #44: ASK queries result in exception: bool object is not iterable
Author: gjhiggins
Created: 2011-10-19 01:04:28+00:00
State: open

Originally filed by coryd...@gmail.com on 2009-02-16T18:33:48

What steps will reproduce the problem?
1. Create a Graph, populated with any triple such as :x :y :z
2. Construct a query such as askQuery = "ASK { :x :y :z }"
3. Run graph.query(askQuery)

Or:

1. Run the attached ask-bug.py file.

Expected:

Return of a result object representing the boolean result.

Actual behavior:

raises this exception.

Traceback (most recent call last):
File "", line 19, in
File "/usr/lib/python2.5/site-packages/rdflib/Graph.py", line 679, in query
return plugin.get('SPARQLQueryResult',QueryResult)(p.query(strOrQuery,
initBindings, initNs, DEBUG))
File "/usr/lib/python2.5/site-packages/rdflib/sparql/QueryResult.py",
line 216, in __init__
result,selectionF,allVars,orderBy,distinct = qResult
TypeError: 'bool' object is not iterable

Using rdflib 2.4.0 installed with pip, on Ubuntu 8.10.