I'm trying to execute a SPARQL query using the Python library RDFlib, but I am getting an error. The error seems to be in the SPARQL, but I've validated it and it is valid.
>>> import rdflib
>>> import rdfextras
>>> rdfextras.registerplugins()
>>> g=rdflib.Graph()
>>> g.parse("/home/file.rdf")
>>> sparql = "PREFIX wo:<http://purl.org/ontology/wo/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?individual ?type where { ?individual rdf:type ?type . filter (?type in (wo:Kingdom))}"
>>> x = g.query(sparql)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/rdflib-3.4.0-py2.7.egg/rdflib/graph.py", line 1007, in query
query_object, initBindings, initNs, **kwargs))
File "/usr/lib/python2.7/site-packages/rdfextras-0.4-py2.7.egg/rdfextras/sparql/processor.py", line 49, in query
loadContexts=loadContexts)
File "/usr/lib/python2.7/site-packages/rdfextras-0.4-py2.7.egg/rdfextras/sparql/algebra.py", line 406, in TopEvaluate
assert isinstance(expr,AlgebraExpression), repr(expr)
AssertionError: None
>>>
What is causing this problem?