gjhiggins/rdflib — Issue #189: Possibly bogus rdflib.plugins.parsers.notation3.BadSyntax
Author: gjhiggins
Created: 2011-10-19 01:37:24+00:00
State: open

Originally filed by Nikra...@gmail.com on 2011-09-14T13:57:08

Running the attached example gives:

$ python test.py
3.1.0
# next char: u'}'
Traceback (most recent call last):
File "test.py", line 25, in
graph.parse(StringInputSource(prefix + '<%s>' % url + meta), format='n3')
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/graph.py", line 984, in parse
location=location, file=file, data=data, **args)
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/graph.py", line 780, in parse
parser.parse(source, self, **args)
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/plugins/parsers/notation3.py", line 2257, in parse
p.loadStream(source.getByteStream())
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/plugins/parsers/notation3.py", line 892, in loadStream
return self.loadBuf(stream.read()) # Not ideal
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/plugins/parsers/notation3.py", line 898, in loadBuf
self.feed(buf)
File "/home/nikratio/.local/lib/python2.6/site-packages/rdflib/plugins/parsers/notation3.py", line 928, in feed
"expected directive or statement")
rdflib.plugins.parsers.notation3.BadSyntax: at line 21 of <>:
Bad syntax (expected directive or statement) at ^ in:
"... 0000 6\nWICHTIGES DOKUMENT - SORGFÄLTIG AUFBEWAHREN!\n " .^
} } WHERE { {
?tag1 a nao:Tag ; nao:prefLabel "()" .
"

The data was generated by tracker (www.gnome.org/projects/tracker/). Personally I don't know much about RDF, so it's quite possible that the input is truly malformed. If that's the case, please let me know so that I can file a tracker bug instead.