SWI-Prolog / packages-semweb

The SWI-Prolog RDF store
28 stars 14 forks source link

N-Triples parser does not parse regal ECHARs #82

Closed wouterbeek closed 6 years ago

wouterbeek commented 6 years ago

With the following data in test.nt:

<x:x> <y:y> "z\'z"@en .

Do the following to reproduce the issue:

?- [library(semweb/rdf_db)].
?- [library(semweb/rdf_ntriples)].
?- rdf_load('test.nt', [format(ntriples)]).
Warning: /home/wbeek/tmp/test.nt:1:15: Syntax error: illegal escape

Expected: the backslash escape sequence should be parsed as a legal N-Triples character, according to the following EBNF rule:

[11]   STRING_LITERAL_QUOTE ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"'
[153s] ECHAR ::= '\' [tbnrf"'\]