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

> On Jan 5, 2016, at 4:31 PM, Rob Stewart <robstewart57@gmail.com> wrote:
> 
> 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>
> 
> ?

Seems to me that the -1 is quoted: https://github.com/w3c/rdf-tests/blob/gh-pages/turtle/negative_numeric.nt

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

Perhaps your reader is messing this up?

Gregg
> [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 01:29:40 UTC