You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Maria Jackson <ma...@gmail.com> on 2015/04/11 20:41:56 UTC

Range of numerical values supported by Jena

I need to execute the following query:

select ?a?c?d (?c + ?d as ?score) where{graph ?g{?a <name> ?b} graph ?g1{?a
<score2> ?c} graph ?g2{?a <score1> ?d}}

Here ?c, ?d, ?score are numbers of any of the following type: xsd:decimal,
xsd:double, xsd:integer, etc. Can someone please tell me the numerical
range of these data types supported by Jena (e.g. in C++ the numerical
range of double is 1.7E +/- 308 (15 digits) --
https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx). Similarly what is
the range of numerical literals in Jena?

Re: Range of numerical values supported by Jena

Posted by Dave Reynolds <da...@gmail.com>.
On 11/04/15 21:42, Maria Jackson wrote:
> Thanks but I am afraid I tried to search a lot, e.g. but
> http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/#decimal but could not
> find the range. Can you please point me to the document.

That's the "Working Draft". If you click on "latest version" at the top 
of that document it will take you to:
http://www.w3.org/TR/xmlschema-2/#built-in-datatypes

So a minimally conforming processor must support 18 digits of precision 
for xsd:decimal (xsd:float, xsd:double etc are, of course, quite 
different beasts).

In practice Jena uses Java BigDecimals to process xsd:decimal values 
which support arbitrary precision and use 32bits for the scale. So the 
biggest number you can represent that way is:
    unscaledValue x 10 ^ 2,147,483,648

Dave

> On Sun, Apr 12, 2015 at 2:07 AM, Dave Reynolds <da...@gmail.com>
> wrote:
>
>> On 11/04/15 19:41, Maria Jackson wrote:
>>
>>> I need to execute the following query:
>>>
>>> select ?a?c?d (?c + ?d as ?score) where{graph ?g{?a <name> ?b} graph
>>> ?g1{?a
>>> <score2> ?c} graph ?g2{?a <score1> ?d}}
>>>
>>> Here ?c, ?d, ?score are numbers of any of the following type: xsd:decimal,
>>> xsd:double, xsd:integer, etc. Can someone please tell me the numerical
>>> range of these data types supported by Jena (e.g. in C++ the numerical
>>> range of double is 1.7E +/- 308 (15 digits) --
>>> https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx). Similarly what
>>> is
>>> the range of numerical literals in Jena?
>>>
>>
>> The range of these types is defined in the XSD specification which can be
>> found using a web search engine. Jena aims to be compliant with the
>> specification.
>>
>> Dave
>>
>>
>>
>


Re: Range of numerical values supported by Jena

Posted by Maria Jackson <ma...@gmail.com>.
Thanks but I am afraid I tried to search a lot, e.g. but
http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/#decimal but could not
find the range. Can you please point me to the document.

On Sun, Apr 12, 2015 at 2:07 AM, Dave Reynolds <da...@gmail.com>
wrote:

> On 11/04/15 19:41, Maria Jackson wrote:
>
>> I need to execute the following query:
>>
>> select ?a?c?d (?c + ?d as ?score) where{graph ?g{?a <name> ?b} graph
>> ?g1{?a
>> <score2> ?c} graph ?g2{?a <score1> ?d}}
>>
>> Here ?c, ?d, ?score are numbers of any of the following type: xsd:decimal,
>> xsd:double, xsd:integer, etc. Can someone please tell me the numerical
>> range of these data types supported by Jena (e.g. in C++ the numerical
>> range of double is 1.7E +/- 308 (15 digits) --
>> https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx). Similarly what
>> is
>> the range of numerical literals in Jena?
>>
>
> The range of these types is defined in the XSD specification which can be
> found using a web search engine. Jena aims to be compliant with the
> specification.
>
> Dave
>
>
>

Re: Range of numerical values supported by Jena

Posted by Dave Reynolds <da...@gmail.com>.
On 11/04/15 19:41, Maria Jackson wrote:
> I need to execute the following query:
>
> select ?a?c?d (?c + ?d as ?score) where{graph ?g{?a <name> ?b} graph ?g1{?a
> <score2> ?c} graph ?g2{?a <score1> ?d}}
>
> Here ?c, ?d, ?score are numbers of any of the following type: xsd:decimal,
> xsd:double, xsd:integer, etc. Can someone please tell me the numerical
> range of these data types supported by Jena (e.g. in C++ the numerical
> range of double is 1.7E +/- 308 (15 digits) --
> https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx). Similarly what is
> the range of numerical literals in Jena?

The range of these types is defined in the XSD specification which can 
be found using a web search engine. Jena aims to be compliant with the 
specification.

Dave