W3C home > Mailing lists > Public > public-rdb2rdf-comments@w3.org > November 2011

Jena and BigIntegers (was: Re: DM and R2RML should use same datatype mapping)

From: Richard Cyganiak <richard@cyganiak.de>
Date: Wed, 2 Nov 2011 17:27:26 +0000
Message-Id: <CE807BB5-9AB2-4BD6-ADEF-37BE70EE67D6@cyganiak.de>
To: public-rdb2rdf-comments@w3.org
For the record: Seems like I am mistaken about support for BigIntegers in Jena/ARQ.

On 2 Nov 2011, at 14:52, Richard Cyganiak wrote:
>> The query
>> ASK {FILTER (20000000000000000000/2=10000000000000000000)}
>> at <http://sparql.org/sparql.html> indicates that ARC supports up to, but no more than, 18 digit integers.
> I suppose you mean ARQ? No, it indicates some weird bug in that implementation.
> ASK {FILTER (200000/2=100000)} => true
> ASK {FILTER (20000000/2=10000000)} => true
> ASK {FILTER (2000000000/2=1000000000)} => true
> ASK {FILTER (200000000000/2=100000000000)} => true
> ASK {FILTER (20000000000000/2=10000000000000)} => true
> ASK {FILTER (2000000000000000/2=1000000000000000)} => true
> ASK {FILTER (200000000000000000/2=100000000000000000)} => true
> ASK {FILTER (20000000000000000000/2=10000000000000000000)} => ***false***
> ASK {FILTER (2000000000000000000000/2=1000000000000000000000)} => true
> ASK {FILTER (200000000000000000000000/2=100000000000000000000000)} => true
> ASK {FILTER (20000000000000000000000000/2=10000000000000000000000000)} => true
> You might want to report that to the vendor.

I did report it to the vendor, and closer investigation shows that arithmetic is done with java.lang.Longs in this case, and the funny results come from the overflow behaviour (both sides of the comparison are wrong in the same way).


That's still a bug. XSD requires support for integers up to 10^16 in a minimally conforming processor, so the supported number range is fine; but the spec also clearly states that unsupported values MUST NOT be quietly changed to supported values.

My reference for claiming that BigIntegers are supported was the Jena documentation:

When parsing an xsd:integer the Java value object used will be an Integer, Long or BigInteger depending on the size of the specific value being represented. 

This information seems to be outdated, or the support does not extend to ARQ.

Received on Wednesday, 2 November 2011 17:27:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:45:16 UTC