Re: RDF Test Cases Bug: The N-Triples Grammar is Ambiguous

On 11/1/07, Sean B. Palmer <sean@miscoranda.com> wrote:

> <p:> <> <q:> <> <r:> <> "s" .

Note the following response when we try to get rapper to emit
N-Triples corresponding as closely as possible to this edge case:

$ cat test/rdfxml006.rdf
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="p:> &lt;> &lt;q:> &lt;">
<s xmlns="r:> &lt;" rdf:resource="http://example.org/"/>
</rdf:Description>
</rdf:RDF>

$ rapper -i rdfxml test/rdfxml006.rdf
rapper: Parsing file test/rdfxml006.rdf
<p:\u003E <\u003E <q:\u003E <> <r:\u003E <s> <http://example.org/> .
rapper: Parsing returned 1 triple

rapper refuses to emit an > character in an absoluteURI, even though
according to the specification this cannot be escaped.

All the same, this is the obvious way to correct this problem. It
means that instead of the following:

"These are encoded in N-Triples using the escapes described in section Strings."
- http://www.w3.org/TR/2004/REC-rdf-testcases-20040210/#sec-uri-encoding

The specification should instead say something like:

'These are encoded in N-Triples using the escapes described in section
Strings, with the extra proviso that unicode character #x3E, ">", must
be escaped as \u003E.'

This would mean that /[^>]+/ could be used as a regexp to get
absoluteURI production instances.

Thanks,

-- 
Sean B. Palmer, http://inamidst.com/sbp/

Received on Thursday, 1 November 2007 11:20:04 UTC