gjhiggins/rdflib — Issue #126: N3 parser complains about @base statement
Author: gjhiggins
Created: 2011-10-19 01:27:53+00:00
State: open

Originally filed by dorian.t...@gmail.com on 2010-05-08T06:42:04

What steps will reproduce the problem?
1. Create an N3 file with a @base keyword
2. parse it with Graph().parse('file', format='n3')
3. Crash and burn

What is the expected output? What do you see instead?

Traceback (most recent call last):
File "./four-part-scan.py", line 23, in
g.parse('../log/durr.n3', format='n3')
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 890, in parse
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 713, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/N3Parser.py", line
32, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3proc.py",
line 119, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3p.py", line
83, in parse
ValueError: Found @base when expecting a
http://www.w3.org/2000/10/swap/grammar/n3#document .
todoStack=[['http://www.w3.org/2000/10/swap/grammar/n3#document', []]]

What version of the product are you using? On what operating system?

rdflib 2.4.2 on Ubuntu 9.04

Please provide any additional information below.

Notwithstanding not working, that BNF-in-RDF looks pretty slick! I may have
to try it out sometime.