Package: python-rdflib
Version: 4.0.1-3
Severity: normal
Tags: upstream
The following code issues an error :
import urllib2
from rdflib import Graph, URIRef
from rdflib.plugins.stores.sparqlstore import SPARQLStore
if 1:
handler = urllib2.HTTPHandler(debuglevel=1)
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
store = SPARQLStore("http://dbpedia.org/sparql",
context_aware=False)
graph = Graph(store)
for p, o in
graph.predicate_objects(URIRef('http://dbpedia.org/resource/Teheran_43')):
continue
send: 'GET
/sparql?query=%0ASELECT+%3Fp+%3Fo+WHERE+%7B+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FTeheran_43%3E+%3Fp+%3Fo+%7D
HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: dbpedia.org\r\nConnection:
close\r\nAccept: application/sparql-results+xml\r\nUser-Agent: sparqlwrapper
1.5.2 (http://sparql-wrapper.sourceforge.net/)\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Wed, 14 May 2014 11:40:39 GMT
header: Content-Type: application/sparql-results+xml; charset=UTF-8
header: Content-Length: 24350
header: Connection: close
header: Server: Virtuoso/07.10.3209 (Linux) i686-generic-linux-glibc212-64 VDB
header: Accept-Ranges: bytes
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File
"/home/olivier/git/github.com/gjhiggins/RDFAlchemy/rdfalchemy/samples/bug.py",
line 14, in <module>
for p, o in
graph.predicate_objects(URIRef('http://dbpedia.org/resource/Teheran_43')):
File "/usr/lib/python2.7/dist-packages/rdflib/graph.py", line 618, in
predicate_objects
for s, p, o in self.triples((subject, None, None)):
File "/usr/lib/python2.7/dist-packages/rdflib/graph.py", line 397, in triples
for (s, p, o), cg in self.__store.triples((s, p, o), context=self):
File "/usr/lib/python2.7/dist-packages/rdflib/plugins/stores/sparqlstore.py",
line 324, in triples
for rt, vars in TraverseSPARQLResultDOM(doc, asDictionary=True):
File "/usr/lib/python2.7/dist-packages/rdflib/plugins/stores/sparqlstore.py",
line 104, in TraverseSPARQLResultDOM
term = CastToTerm(binding.findall('*')[0])
File "/usr/lib/python2.7/dist-packages/rdflib/plugins/stores/sparqlstore.py",
line 141, in CastToTerm
"{http://www.w3.org/XML/1998/namespace}lang"])
File "/usr/lib/python2.7/dist-packages/rdflib/term.py", line 571, in __new__
_value, _datatype = _castPythonToLiteral(lexical_or_value)
File "/usr/lib/python2.7/dist-packages/rdflib/term.py", line 1384, in
_castPythonToLiteral
if isinstance(obj, pType):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and
types
Hope this helps.
Best regards,
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (900, 'testing'), (250, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.13-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-rdflib depends on:
ii python-isodate 0.4.6-1
ii python-pyparsing 2.0.1+dfsg1-1
pn python:any <none>
Versions of packages python-rdflib recommends:
ii python-html5lib 0.999-2
ii python-sparqlwrapper 1.5.2-2
Versions of packages python-rdflib suggests:
ii python-rdflib-doc 4.0.1-3
ii python-rdflib-tools 4.0.1-3
-- debconf-show failed
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]