You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "xiaoq95a@163.com" <xi...@163.com> on 2015/02/11 02:33:33 UTC

5^^http://www.w3.org/2001/XMLSchema#int

Hi,I'm new to jena.my question below:
 RDFNode rdfn=answer.getPropertyValue(hasValue);
"answer" is a individual,"hasValue" is a dataproperty, I hava insert "answer" "hasvalue" 5,int.
how can I get 5,int, not "5^^http://www.w3.org/2001/XMLSchema#int"

Thanks,
 --Louise

Re: Re: 5^^http://www.w3.org/2001/XMLSchema#int

Posted by "xiaoq95a@163.com" <xi...@163.com>.
Claude,Thank you very much,I use"rdfn.asLiteral().getInt();"get the int value,just what I want.
 
From: Claude Warren
Date: 2015-02-11 15:36
To: users@jena.apache.org
Subject: Re: 5^^http://www.w3.org/2001/XMLSchema#int
Louise,
 
"5^^http://www.w3.org/2001/XMLSchema#int" is the RDF literal representation
of the integer 5.
 
The object you get back is a Jena Literal object.  On that object you can
call the getInt() method to return 5 as an Java int, or getValue() which
will return either an Integer or an int (I am not certain which)
 
Claude
 
On Wed, Feb 11, 2015 at 1:33 AM, xiaoq95a@163.com <xi...@163.com> wrote:
 
> Hi,I'm new to jena.my question below:
>  RDFNode rdfn=answer.getPropertyValue(hasValue);
> "answer" is a individual,"hasValue" is a dataproperty, I hava insert
> "answer" "hasvalue" 5,int.
> how can I get 5,int, not "5^^http://www.w3.org/2001/XMLSchema#int"
>
> Thanks,
>  --Louise
>
 
 
 
-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: 5^^http://www.w3.org/2001/XMLSchema#int

Posted by Claude Warren <cl...@xenei.com>.
Louise,

"5^^http://www.w3.org/2001/XMLSchema#int" is the RDF literal representation
of the integer 5.

The object you get back is a Jena Literal object.  On that object you can
call the getInt() method to return 5 as an Java int, or getValue() which
will return either an Integer or an int (I am not certain which)

Claude

On Wed, Feb 11, 2015 at 1:33 AM, xiaoq95a@163.com <xi...@163.com> wrote:

> Hi,I'm new to jena.my question below:
>  RDFNode rdfn=answer.getPropertyValue(hasValue);
> "answer" is a individual,"hasValue" is a dataproperty, I hava insert
> "answer" "hasvalue" 5,int.
> how can I get 5,int, not "5^^http://www.w3.org/2001/XMLSchema#int"
>
> Thanks,
>  --Louise
>



-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren