You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Bruno P. Kinoshita (JIRA)" <ji...@apache.org> on 2017/06/07 23:22:18 UTC

[jira] [Commented] (JENA-1359) Literal.getValue() does not respect the datatype

    [ https://issues.apache.org/jira/browse/JENA-1359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16041883#comment-16041883 ] 

Bruno P. Kinoshita commented on JENA-1359:
------------------------------------------

I remember seeing somewhere in ARQ where a long would be casted down to integer to save space, if there was no lose in precision. But not from float/double to integer. I don't have Jena in my Eclipse workspace in this computer, but can check it later. I think it was somewhere around [here|https://github.com/apache/jena/blob/bd357d406045bd82f5ce899d2ebbc3e6fdf33dca/jena-core/src/main/java/org/apache/jena/rdf/model/Literal.java#L57].

I think you can still call getFloat or getDouble to return the value with the decimal.

> Literal.getValue() does not respect the datatype 
> -------------------------------------------------
>
>                 Key: JENA-1359
>                 URL: https://issues.apache.org/jira/browse/JENA-1359
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: Panagiotis Papadakos
>
> I was expecting that the getValue would return a Java object based on the
> datatype of typed literals. This is not the case, since jena will coerce a decimal literal with value 12.0 to an Integer with value 12. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)