On 09/10/15 19:24, Michael Brunnbauer wrote:
Hello Andy,
On Fri, Oct 09, 2015 at 06:25:47PM +0100, Andy Seaborne wrote:
So Fuseki can only cast from xsd:double to xsd:integer if the lexical value
conforms to xsd:integer?
Yes, currently - it maintains term relationships (loosely [*])
X = cast (Y)
=>
str(X) = str(Y)
[*] except in one case for booleans.
The code is in CastXSD_numeric : patches/PRs welcome : it's quite old code.
And the lexical value is preserved by the Fuseki engine unless a computation is
involved, which has to convert the lexical value to the value and back to the
canonical representation, which never conforms to xsd:integer?
That may be due to supporting printing doubles in short form in SPARQL.
Doubles to have "E0". I doubt the tie is necessary.
And the decision which lexical values of xsd:double can be casted to
xsd:integer is up to the implementer of SPARQL?
The casting rules come from XSD (and IIRC are a bit different between
edition 1 and edition 2, at least in how they are expressed). What
isn't clear with hindsight is the relationship to RDF terms. The
canonical (XSD) form of double does not identify it as a double - XSD
has a schema, RDF has datatypes.
c.f. java's Double.toString(100) --> 100.0 where the output is a Java
double string.
What a lot of questions.
Is there something driving all this?
Just curiosity.
Regards,
Michael Brunnbauer