Re: Small, standalone, RDF parsers

Christophe, hello.

On 2009 Apr 8, at 17:50, Christophe Dupriez wrote:

> You can check OpenRDF RIO (part of Sesame): let me know the result,  
> I plan to use it for my SKOS project which now imports from XML files.

Thanks for this suggestion -- I would have casually excluded Sesame  
from consideration on the grounds that it was 'too big'.  However,  
because Sesame is distributed as a couple of dozen jar files, it's  
possible to assemble quite a small parser from them.

As an example, I've attached a 20kB tarball (compressed to 3.7kB)  
which contains an example program which parses both RDF/XML or Turtle  
and then spits out the result in (trivial) n-triples format.  The  
Sesame parsers are clearly modelled on the SAX ones, with a parser  
which processes an input stream, and calls a handler which assembles  
the model/graph.

The Makefile in the attachment shows which subset of Sesame jars are  
required.  When the whole lot is assembled into a single jar file it  
comes to 250kB, which could probably be whittled down a _lot_ with jar- 
optimisation.

Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
Dept Physics and Astronomy, University of Leicester

Received on Thursday, 9 April 2009 11:04:25 UTC