virtuoso-opensource
virtuoso-opensource copied to clipboard
Issue handling xsd:double and xsd:decimal
In develop/6, I have issue with loading xsd:double and xsd:decimal datatypes.
When I load "50.08332824707031"^^xsd:double using SPARQL update, when I look at the value using fct or simply by querying, I get "50.0833"^^xsd:double. However, if I load it as "50.08332824707031"^^xsd:decimal, I get "50.08332824707031"^^xsd:double.
I think both cases are wrong. The second one has the effect that when I dump the graph and load it again, it goes through case 1) loosing precision.
I have asked development to look into this and will let you know what they report back ...
Was there any progress on this? While xsd:decimal should be lossless, Virtuoso implements it as lossy. Observe:
SELECT ?value
WHERE {
VALUES ?value {
0.00262335315960871
}
}
When provided with 0.00262335315960871
Virtuoso returns 0.002623353159609.
Tested on Virtuoso 07.20.3218.
I have reported to development to look into ...
Any progress on this? The XSD standard requires to at least maintain a precision of 16 for xsd:decimal for limited conformance, and arbitrary precision for full conformance. Currently, Virtuoso maintains a precision of 15 (example query), which is the precision preserved by doubles. Therefore I guess, decimals are currently implemented with doubles internally.