gjhiggins/rdflib — Issue #90: rdflib Graph parse() fails for nt files with @prefixes
Author: gjhiggins
Created: 2011-10-19 01:18:01+00:00
State: open

Originally filed by olyerick...@gmail.com on 2009-11-09T15:22:09

What steps will reproduce the problem?
1. Attempt to parse file example...
http://www.w3.org/2000/10/swap/doc/formats

What is the expected output? What do you see instead?
When I execute...

>>>> g.parse("demo.nt", format="nt")

I except to see something like...
)>

Instead I see...
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 713, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/NTParser.py", line
23, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/ntriples.py", line
125, in parse
rdflib.syntax.parsers.ntriples.ParseError: Invalid line: '@prefix :
.'

If I use the "standard form" (NO @prefixes) I get the expected result,
)>

What version of the product are you using? On what operating system?
rdflib-2.4.2 on Ubuntu 9.10

Please provide any additional information below.
I have done numerous tests with sample data; problem is limited to NT
format that includes @prefix lines...