Re: N-triples white space question

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



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