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

Re: N-triples white space question

From: Richard Cyganiak <richard@cyganiak.de>
Date: Fri, 18 May 2012 11:06:19 +0100
Cc: RDF-WG <public-rdf-wg@w3.org>
Message-Id: <0686F3CA-2CC6-417F-BFB1-6E81025FBB50@cyganiak.de>
To: Andy Seaborne <andy.seaborne@epimorphics.com>
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.


[1] http://www.w3.org/TR/rdf-testcases/#ntriples

On 18 May 2012, at 10:04, Andy Seaborne wrote:

> Gavin, Eric,
> rdf-turtle says:
> [1] ntriplesDoc	::= (triple)? (EOL triple)* (EOL)?
> [2] triple	::= subject predicate object '.'
> [8] EOL		::= ([#xD#xA])+
> What are the white space rules?
> Does it inherit white space processing from the rest of Turtle? Comments seem to come from Turtle.
> If it does not inherit white space rules,
>    what about horizontal white space inside triples?
> If it does inherit white space rules,
>   that includes newlines within triples between S/P or P/O.
> The simplest solution is to add text in section 12.3 to say that horizontal white space outside tokens is discarded (which is different to Turtle).
> 	Andy
Received on Friday, 18 May 2012 10:06:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:17 UTC