Possible grammar problem with decimal numbers

Gentlemen,
While verifying our implementation of Sparql, I have encountered what several suspected problems in the grammar.

1st Case:  The following production (in http://www.w3.org/TR/sparql11-query/#rUnaryExpression) permits decimal numbers of the following exemplary forms:  ddd.d    ddd.ddd   .ddd  .  Decimals of the form  ddd.  are not permitted.

[147]

DECIMAL

::=

[0-9]* '.' [0-9]+


If this was not the intended result, the right-hand side of the production might better read as

[0-9]* '.' [0-9]+ | [0-9] '.'

The original motivation might be the conflicting use of a floating number in the object position of a triple, where a fraction-free float's decimal point would conflict with the triple's closing AND '.' mark.

The implications of leaving [147] as-is is that FILTER [?data > 29.] is not legal, a visible annoyance.


2nd Case:  There is a slight inconsistency in treatment of DECIMAL (per above) and DOUBLEs:

[148]

DOUBLE

::=

[0-9]+ '.' [0-9]* EXPONENT<http://www.w3.org/TR/sparql11-query/#rEXPONENT> | '.' ([0-9])+ EXPONENT<http://www.w3.org/TR/sparql11-query/#rEXPONENT> | ([0-9])+ EXPONENT<http://www.w3.org/TR/sparql11-query/#rEXPONENT>


For single precision DECIMAL, the leading digit is optional.  For DOUBLE, a leading digit is mandatory.  Is there a motivation for this difference?


My regards to the WG for taking 1.1 through to closure.

Thomas A. Visel
AlgebraixData, Inc.
(512) 651-5834

Received on Tuesday, 9 April 2013 17:25:33 UTC