On 10/04/12 19:58, Robert Vesse wrote:
See
http://incubator.apache.org/jena/documentation/javadoc/jena/com/hp/hpl/jena/rdf/model/Literal.html

Once you have a Literal - which you can get by calling asLiteral() -
there are a bunch of get methods which will return the value as an
appropriate java type e.g. getInt()

In particular Literal#getValue() will return the java object mapped to that literal type (a String for plain literals).

Dave


Hope this helps

Rob


Rob Vesse -- YarcData.com <http://YarcData.com> -- A Division of Cray Inc
Software Engineer, Bay Area
m: 925.960.3941 | o: 925.264.4729 | @: [email protected]
<mailto:[email protected]> | Skype: rvesse
6210 Stoneridge Mall Rd | Suite 120 | Pleasanton CA, 94588


On Apr 10, 2012, at 11:41 AM, prerak pradhan wrote:

Hey there everyone, I am working on a project that involves fetching
data from dbpedia. using its SPARQL endpoint and I was wondering
whether there is any method jena provides to convert the the object
returned and stored in an RDFNode from a dbpedia query i.e a
XMLSchema#double into a java int so that I can perform operations on
it and modify the data for my use. I tried casting the RDFNode into a
string and than onto an int but that doesn't work and throws a
numberFormat exception. Anyone with any solution to this problem.

Regards
Prerak


Reply via email to