initNs not supported in sparql query

27 views
Skip to first unread message

Luis Miguel Morillas

unread,
Jan 9, 2012, 11:14:10 AM1/9/12
to rdfli...@googlegroups.com
I want to query our opendata sparql endpoint with rdflib. This is the
code sample: [1].

The query works fine at the web interface, but raises an initNs not
supported exception with rdflib:

Traceback (most recent call last):
File "/home/lm/test_rdf2.py", line 19, in <module>
for row in graph.query(query_fran, initNs=ns):
File "/usr/local/lib/python2.7/dist-packages/rdflib-3.2.0_dev-py2.7.egg/rdflib/graph.py",
line 880, in query
return self.store.query(self,query_object, initNs, initBindings, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/rdfextras-0.2_dev-py2.7.egg/rdfextras/store/SPARQL.py",
line 249, in query
raise Exception("initNs not supported.")
Exception: initNs not supported.


[1] http://paste2.org/p/1859449

Any ideas?

-- luismiguel

Luis Miguel Morillas

unread,
Jan 9, 2012, 2:24:46 PM1/9/12
to rdfli...@googlegroups.com
2012/1/9 Luis Miguel Morillas <mori...@gmail.com>:

It works writing the query with prefixes:

"""
PREFIX dcat: <http://vocab.deri.ie/dcat#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?d ?t ?s ?l FROM
<http://www.zaragoza.es/datosabiertos/catalogo> WHERE {?d a
dcat:Dataset . ?d dct:title ?t . ?d dct:subject ?s . ?s skos:prefLabel
?l}'''
"""

-- luismiguel


>
>
> -- luismiguel

Graham Higgins

unread,
Jan 9, 2012, 4:21:36 PM1/9/12
to rdfli...@googlegroups.com
Thanks for that report. I'm glad you were ultimately successful. I've raised a documentation ticket:


Cheers,

Graham Higgins
Reply all
Reply to author
Forward
0 new messages