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

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.

First,

[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.

Second,

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

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

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.

peter

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