You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Benson Margulies <bi...@gmail.com> on 2010/12/28 18:02:17 UTC

Quickest way to retrieve literal value

Given a Resource, and wanting the value of a particular literal, I'm
not seeing any quicker API than calling getProperty and pulling the
value from the statement. Am I missing something?

Re: Quickest way to retrieve literal value

Posted by Dave Reynolds <da...@gmail.com>.
On Tue, 2010-12-28 at 12:02 -0500, Benson Margulies wrote: 
> Given a Resource, and wanting the value of a particular literal, I'm
> not seeing any quicker API than calling getProperty and pulling the
> value from the statement. Am I missing something?

The OntAPI (e.g. OntResource) has some convenience methods for getting
the values of properties. You can use the OntAPI even if you are not
explicitly using OWL.

We talked about, but have never agreed on, how to merge the general
purpose utilities in the OntAPI (and in various personal/project level
utils) into the base API. On the one hand the base API leads to verbose
code and most of us have a little package of functions to simplify the
common cases. On the other hand we get regular and justifiable
complaints that the base API is just far too big and it is hard to find
your way round the sheer volume methods on Model and Resource.

Dave