Streaming Java parsers for RDF formats in XML and N3?

Jena has several readers for RDF serialization formats, but they all store the directly into a Model. However, for some applications it can be useful to stream the content, possible taking advantage that the RDF stream is structured (like keeping all statements about a particular object together). For example, a Streaming API for XML (StAX) based parser for RDF/XML.

Do such streaming RDF parsers exist? Are there such parsers for Java?

Direct access to Jena parsers can be done for streaming: http://openjena.org/wiki/RIOT (they all stream internally)

How brave are you?

If you're willing to stomach a complete lack of documentation and support, and wash that down with spaghetti code, you could try out the NxParser, with up-to-date source code here (BSD/Java).

It supports any form of N-Triple like syntax, and RDF/XML, but not Turtle or N3. All parsers are streaming, with triple iterators returned.


...oh, yep. If you're less brave, you should try any23 (Java/Apache). It should handle all of the main formats you would expect.