tags:

views:

180

answers:

1

I have a Jena URI Resource (Resource reference to an object where isURIResource() returns true). An example Resource URI is this:

http://d.opencalais.com/er/company/ralg-tr1r/4ee13d20-b44f-3bce-98bc-49a303e72db5

If you open that in a web browser, you'll probably be given the HTML representation of the data:

http://d.opencalais.com/er/company/ralg-tr1r/4ee13d20-b44f-3bce-98bc-49a303e72db5.html

You can change the .html extension to .rdf giving you:

http://d.opencalais.com/er/company/ralg-tr1r/4ee13d20-b44f-3bce-98bc-49a303e72db5.rdf

This RDF model is formatted as XML. The property I need to retrieve is:

<c:symbol>MSFT.OQ</c:symbol>

In summary, I'm looking for a way to use my Jena URI Resource to return the value of c:symbol, which in my example would be MSFT.OQ

I'm aware that I could take this URI, GET the RDF representation via some HTTP client, then load and query the model as I'm doing already. What I'm assuming, however, is that Jena offers a more elegant solution to this recurring task.

A: 

I don't think Jena has a 'streaming' API just like the StaX API for XML. Might help: last year, I wrote a simple streaming parser for RDF: see http://tinyurl.com/b2ju8s. It does not handle the full RDF spec, but you might get some ideas there.

Pierre