Hi,
On 14/09/12 11:01, Paul Taylor wrote:
Hello everyone, I would like to know how I can use Jena API to dereference a
URI for example: http://xmlns.com/foaf/0.1/Person and get the collection of
RDF-triples that describe that entity, without having to retrieve the entire
FOAF document. I would like to know whether this is possible?
At the moment I have been using the following Jana code:
Model model = ModelFactory.createDefaultModel();
model.read("http://xmlns.com/foaf/0.1/Person/";);
Spurious trailing "/" there, though it does no harm in this case.
to load the entire RDF document in memory and then ask a SPARQL query to get
the triples that have the entity's URI as the subject. Is there any other way
to do it because some RDF documents are expected to have large numbers of
triples and eventually I will be running out of memory at some point. I am
trying to build a follow-your-nose application and I do not find it convenience
to load everything in memory. Apologies in advance for this newbie question,
but I have recently started working with Jena. Thank you
This is a function of the publisher rather than of Jena :)
All Jena can do is fetch from that URL, it is up the publisher whether
they return an entire ontology document or just some fragment of it that
relates to the particular concept dereferenced.
It's common with ontologies to just publish the whole document.
With data it is more common to get more specific data back when you
dereference the URL. Which is what makes "follow your nose" linked data
browsing practical.
Some people also publish SPARQL endpoints and in that case you can be as
selective as you like in what ask for.
Dave