W3C home > Mailing lists > Public > www-rdf-comments@w3.org > October to December 2007

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

From: Sean B. Palmer <sean@miscoranda.com>
Date: Thu, 1 Nov 2007 11:19:55 +0000
Message-ID: <b6bb4d890711010419rdcbeafal3248096513c7ad1c@mail.gmail.com>
To: www-rdf-comments@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 21 September 2012 14:16:34 GMT