RDFLib/rdflib — Issue #119: N3 parser complains about @base statement
Author: gjhiggins
Created: 2012-02-20 08:33:11+00:00
State: closed

dorian.t...@gmail.com, 2010-05-08T06:42:04.000Z

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.

Comment 1 by eik...@gmail.com

Comment 2 by gromgull

Comment 3 by eik...@gmail.com

Comment 4 by gromgull
Fixed in r1755, test-case in test_n3.py

Comment 5 by gromgull
Issue 127 has been merged into this issue.