W3C home > Mailing lists > Public > public-rdf-comments@w3.org > June 2017

Re: Proposed fixed version of N-Triples https://www.w3.org/TR/n-triples/ Section 7

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Fri, 30 Jun 2017 06:43:13 -0700
To: Andy Seaborne <andy@apache.org>, public-rdf-comments@w3.org
Message-ID: <cbf8582f-04fc-f238-2fb1-b18b3be8b7fe@gmail.com>
On 06/29/2017 01:11 PM, Andy Seaborne wrote:

>> [[Lines consisting entirely of white space and/or a comment are now
> permitted.]]
> Counting the number of lines to find the number of triples is intentional IIRC.
>     Andy

The number of lines in a N-Triples file is not necessarily the number of
triples in it.


[1] 	ntriplesDoc 	::= 	triple? (EOL triple)* EOL?

allows an initial non-triple line, probably including white space and
comments.  As well, the final triple does not need to be followed by an
end-of-line token.


[7] 	EOL 	::= 	[#xD#xA]+

permits repeated newlines.   It also allows quite a few unusual end-of-line

So an N-Triples file that has one line according to wc can have any number of
triples in it.  I can't think of any tool for counting lines in a UNICODE
document that has the property that the number of lines it reports for an
N-Triples document must be at most a fixed constant different from the number
of triples in the document.

Received on Friday, 30 June 2017 13:43:52 UTC

This archive was generated by hypermail 2.3.1 : Friday, 30 June 2017 13:43:52 UTC