RDFLib/rdflib — Issue #22: n3 parse error on \u043d\u04...
Author: gjhiggins
Created: 2012-02-20 08:30:40+00:00
State: open

drewpca, 2008-04-24T07:45:17.000Z

input.n3 (based on a dbpedia entry):

"Anna Sergeyevna Kournikova
(Russian: \u0410\u043d\u043d\u0430
\u0421\u0435\u0440\u0433\u0435\u0435\u0432\u043d\u0430
\u041a\u0443\u0440\u043d\u0438\u043a\u043e\u0432\u0430 " .

% python -c "from rdflib.Graph import ConjunctiveGraph as C;
C().parse('anna.n3', format='n3')"
Traceback (most recent call last):
File "", line 1, in
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 828, in parse
File "build/bdist.linux-i686/egg/rdflib/Graph.py", line 661, 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
117, in parse
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3proc.py",
line 131, in onFinish
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3proc.py",
line 397, in literalFinish
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3proc.py",
line 477, in literal
File "build/bdist.linux-i686/egg/rdflib/syntax/parsers/n3p/n3proc.py",
line 81, in unquote
rdflib.syntax.parsers.n3p.n3proc.ParseError: Illegal escape at: \u043d\u04...

cwm is able to read the file.

Comment 1 by eik...@gmail.com

Comment 2 by drewpca
This simpler n3 file has the same issue:

"this word is in
\u201cquotes\u201d".

The nt parser can read it, but n3 can't. I was using n3 format for relative urls.

Comment 3 by drewpca
Oops- n3 is supposed to have uppercase hex in \u and \U escapes, so this error is
correct. Although I wouldn't mind if we matched the cwm behavior and permitted it :)

Comment 4 by eik...@gmail.com

Comment 5 by gromgull
Fixed in r1755