On 05/09/12 23:11, Sarven Capadisli wrote:
Hi,
Could I ask you to do a quick test for me?
1. Import the following:
<http://worldbank.270a.info/dataset/world-development-indicators/EG.USE.PCAP.KG.OE/PT/2000>
<http://purl.org/linked-data/sdmx/2009/measure#obsValue>
"2412.80478192688"^^<http://www.w3.org/2001/XMLSchema#decimal> .
2. Query the subject:
SELECT * WHERE {
<http://worldbank.270a.info/dataset/world-development-indicators/EG.USE.PCAP.KG.OE/PT/2000>
?p ?o . }
3. What's the object value in the result?
I'm using jena-tdb/0.9.4-SNAPSHOT/jena-tdb-0.9.4-20120905.
What I get is -401.94498517968 instead of 2412.80478192688.
Note that 2412.80478192688 has 11 numerals after the decimal. If I
change that to 10 (removing 8 at the end), or to something more than 11,
then importing is okay i.e., I get the exact result back.
Is this a possible bug or am I overlooking something obvious?
Bug - the decimal inlining isn't round tripping that value or deciding
it can't.
Recorded as
https://issues.apache.org/jira/browse/JENA-317
with reduced test case.
I think it's because the value (the digits without the dot) are
overflowing into the sign bit. Decimals are packed into a logn as
(type, scale, value) where (scale,value) is as Java's BigDecimal. If
the form does not fit, it refuses to pack it and the code store the node
long form (lexical form etc in the node table).
The value is signed and your number is close to the maximum. Hence
removing the last decimal - it reduces the value by a factor of 10.
Andy
Thanks,
-Sarven