W3C home > Mailing lists > Public > public-rdf-comments@w3.org > January 2016

Numeric literals with the NTriples grammar rules, to test the Turtle "negative_numeric" test

From: Rob Stewart <robstewart57@gmail.com>
Date: Wed, 6 Jan 2016 00:31:45 +0000
Message-ID: <CA+ZOas+DR-ze4yY4LcdHjUNPKsLMbrGXoBBp9-Cx1BBqXw2r8Q@mail.gmail.com>
To: RDF Comments <public-rdf-comments@w3.org>
Hi,

The Turtle grammar spec [1] includes the rules:

[13] literal::=RDFLiteral | NumericLiteral | BooleanLiteral
[16] NumericLiteral::=INTEGER | DECIMAL | DOUBLE

The NTriples grammar rule [2] for literals is:

[6] literal ::=STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG)?

So the NTriples grammar doesn't appear to consider numeric literals.

The Turtle test "negative_numeric" test [3] has the input action in a .ttl
file:

<http://a.example/s> <http://a.example/p> -1 .

And expected result is in a .nt file:

<http://a.example/s> <http://a.example/p> -1"^^<
http://www.w3.org/2001/XMLSchema#integer> .

I am able to parse the input action with a turtle parser. However, in order
to run the test I need to parse the .nt file with my NTriples parser.

What NTriples grammar rules in [2] can be used to parse the numeric literal:

-1"^^<http://www.w3.org/2001/XMLSchema#integer>

?

[1] http://www.w3.org/TR/turtle/
[2] http://www.w3.org/TR/n-triples/
[3] https://github.com/w3c/rdf-tests/blob/gh-pages/turtle/manifest.ttl#L1001

--
Rob
Received on Wednesday, 6 January 2016 00:32:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 6 January 2016 00:32:34 UTC