-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider support for underscores in numeric literals #173
Comments
I'd like to see it if we do it uniformly. |
Hmm- that allows trailing For internal DIGITS ::= DIGIT (("_" | DIGIT)* DIGIT)? c.f. |
Presumably we need to say the " FILTER ( sameTerm(?x, 1_000) ) |
It seems very odd to support the underscore |
Dots and comas are already syntactic elements. |
By "odd", are you arguing that SPARQL caters to a different audience than the languages referenced above? The use of (Some languages, e.g. Swedish, use comma |
Agree with @gkellogg and @niklasl. In addition to the fact that dots and commas are already used, there are other inconsistencies with natural languages, e.g. in Polish, a comma is used to separate decimal parts, just like a dot in English. On the other hand, underscore is quite often used in a unified way in different languages. |
In @niklasl's language survey, the usage is in any place and including factional parts. |
I think I'm understanding now, that this underscore support is only relevant with un-quoted numeric literals, so (How would |
The triple So, The only interpretation of numeric literals which are not strings with a a specific datatype is |
In processing, the parser removes all Examples -- Valid ways to write the literal xsd:integer RDF Turtle 1.1
Proposed: same RDF term as
There is no proposal to change the meaning of datatypes, or the syntax that explicitly has the datatype, or the datatype lexical to value mapping: Illegal:
In SPARQL 1.1, the abbreviated syntax form must be used in LIMIT 1000
LIMIT 1_000
LIMIT 10_00 |
By the label descriptions, this is seems to fall between Should this be marked IMO This is a small usability improvement. It is normative in the sense there are grammar changes; it is localised and so arguably below the "substantively" level. |
To aid readability, many programming languages allow underscores in numeric literals for separating groups of digits. A common use is to separate in groups of thousands, such as
42_000_000
.For example, this is supported in Java, Python, Javascript, Rust, Erlang and Racket (see links for details and rationale).
Proposed new productions:
Updated productions:
Example use:
Note that this would purely be syntactic sugar.
(Personally, I've only missed this feature in SPARQL when using
LIMIT
and/orOFFSET
. But it may be nice to define this similarly for Turtle/TriG.)The text was updated successfully, but these errors were encountered: