gjhiggins/rdflib — Issue #29: N3 parser returns error if a namespace prefix contains a hyphen. 
Author: gjhiggins
Created: 2011-10-19 00:59:35+00:00
State: open

Originally filed by gjhigg...@gmail.com on 2008-08-11T14:01:55

What steps will reproduce the problem?

$ echo "@prefix foo-bar: ." > /tmp/test.n3

>>> from rdflib.Graph import Graph
>>> g=Graph();
>>> g.parse('/tmp/test.n3',format='n3');

What is the expected output?

The usual RDF Graph id:

)>

What do you see instead?

ValueError: Token: ': ]*>

module body	in untitled at line 5
function parse	in Graph.py at line 730
function parse	in N3Parser.py at line 32
function parse	in n3proc.py at line 119
function parse	in n3p.py at line 110

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

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

Please provide any additional information below.

Problem may be avoided by changing the hyphen to an underscore.