W3C home > Mailing lists > Public > public-rdf-wg@w3.org > May 2012

Re: N-triples white space question

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Fri, 18 May 2012 11:27:48 +0100
Message-ID: <4FB62424.4020309@epimorphics.com>
To: public-rdf-wg@w3.org


On 18/05/12 11:06, Richard Cyganiak wrote:
> RDF 2004 N-Triples [1] requires at least one character of horizontal
> white space between s, p and o.
>
> This helps tremendously with quick-and-dirty parsing using regexes.
>
> I think the WS rules for N-Triples should stay as they were in RDF
> 2004.
>
> I would even go one step further and add some SHOULD-level guidance
> on where to put what whitespace. Perhaps something like: exactly one
> space between s and p; exactly one space between p and o; no WS
> before or after the period; no WS at the start of a line; CR+LF as
> EOL.
>
> I also note that RDF 2004 N-Triples allows comments (only at the
> start of a line). This makes sense for the use as a test case format,
> but not much sense for the use as a dump format.
>
> Best, Richard
>
>
> [1] http://www.w3.org/TR/rdf-testcases/#ntriples

Building on the possible SHOULD level guidance:

Maybe we could define a canonical form of N-triples:

. No comments.
. No blank lines.
. CR+LF
. Single space between S/P, P/O.
     (a raw tab is also good - it can't appear in a valid literal)
. No use of \u or \U
. Resolved IRIs
     avoid <http://example/a/./b/../c> or <http://example.org:80/a>
. Last line has a CR+LF

	Andy
Received on Friday, 18 May 2012 10:28:27 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:49 GMT