On 30/09/11 16:17, Dave Reynolds wrote:
On Fri, 2011-09-30 at 11:55 +0200, Eric Feliksik wrote:
Dear Jena fanatics,

I am parsing an xml document and RDF/XML can be contained as a subtree, as
follows:

<?xml version='1.0' encoding='utf-8'?>
<myFormat>
   <myGraphAnnouncer>
       <rdf:RDF
         xmlns:j.0="http://dbpedia.org/property/";>
       <rdf:Description rdf:about="
http://dbpedia.org/resource/Geert_den_Ouden";>
         <j.0:cityofbirth rdf:resource="http://dbpedia.org/resource/Delft"/>
         <j.0:placeOfBirth rdf:resource="http://dbpedia.org/resource/Delft"/>
       </rdf:Description>
     </rdf:RDF>
   </myGraphAnnouncer>
</myFormat>

I am using the Stax parser to process my document. As soon as i find the
<myGraphAnnouncer>  tag, I want to hand the responsibility of parsing to Jena
as it already implements this.
Is there a Stax implementation that I could directly pass the stax
javax.xml.stream.XMLStreamReader ? Sharing the inputStream seem to quickly
become complex, as various parsers may buffer the input in their own
particular ways. I prefer a streaming solution as the document may become
many megabytes in size.

Does Jena have a Stax RDF parsing implementation? If not, do you have any
advice? Thanks in advance!

Unless there's something in RIOT I don't there there is a direct Stax
RDF parser.

However, there is support for parsing from SAX event streams [1].
Code to pull on your Stax stream (up to the  closing</rdf:RDF>) passing
the events directly to a SAX2Model probably wouldn't be too bad.

All RIOT does with RDF/XML is wrap ARP into the standard RIOT interfaces.

        Andy


Dave

[1] http://jena.sourceforge.net/ARP/sax.html


Reply via email to