Re: Lightweight Java RDF libraries

That's a good question that I asked myself when I started EulerGUI.
And I couldn't also find a right answer.
Then the project, geared towards GUI and rules, proceeded, and I
forgot the question. We used Jena for parsing RDF/XML, OWL-API for
OWL/XML.
And for N3 including quoted graphs and rules, we built a parser.
Then , along the way , we built an API able to parse any RDF dialect (
Turtle/N3, RDF/XML, OWL/XML, and more  ) .
Here is a sample:

		SourceFactory factory = new SourceFactory();
		N3Source n3 = factory.addSource(new URL(
		  "https://eulergui.svn.sourceforge.net/svnroot/eulergui/trunk/eulergui/examples/parents.n3"),
null);
		ParserLink pl = new ParserLink();
		pl.parse( n3 );
		ListStorageTripleHandler handler = new ListStorageTripleHandler();
		pl.visitAllURI( handler );
		System.out.println( handler.getTriples() );
		List<ITriple> triples = handler.getTriples();
		System.out.println( triples );

To do this , these 3 jar are needed :

eulergui-1.9-SNAPSHOT.jar 1031194
/home/jmv/.m2/repository/parser4j/all/trunk3/all-trunk3.jar 383791
log4j-1.2.16.jar 481535

which amounts to this total :
1031194 + 383791 + 481535
1,896,520 bytes


2011/9/12 Norman Gray <norman@astro.gla.ac.uk>:
>
> Greetings.
>
> Can anyone point me towards a simple/lightweight Java RDF library?
>
> Here, I mean 'lightweight' in the sense of having a small API, rather than a small jar, because if one is trying to persuade people that RDF is a useful and practical thing, then hauling out a manual which could crush a small donkey is a difficult place to start.  I want an RDF gateway drug^Wlibrary.
>
> All I really want to be able to (demonstrate I can) do is to read and write RDF/XML and Turtle, create triples, and iterate through a graph.   Simple inference I wouldn't say no to, but wouldn't need; and SPARQL would be unnecessary for the scope and userbase I have in mind.
>
> Ideally, I'd like to be able to say "here is a little jar to put on your classpath, and here is a webpage with a few examples which make simple things simple; have fun".
>
> Jena I've used a lot, and like, but ... well, see remarks about maltreated donkeys above.  Sesame I've used less, but it's still a four-types-of-batteries included solution.
>
> JRDF <http://jrdf.sourceforge.net/> is I think intended to be small, but looking at its documentation, it seems to have become fuller-featured over time.  Also, it's marked as 'inactive', which is nudging one away from using it for new projects.
>
> rdf2go looks attractive, and seems to be aimed in part at the same semweb-sceptical userbase.  But as an abstraction layer over other triple stores, it fails my 'one jar' goal.
>
> I imagine it would be possible to try to extract some some sort of bare-bones Jena subset, but I can't help thinking that would be quite a lot of work (I haven't looked at the feasibility in any detail).
>
> Yes, disk space is cheap, and yes, I can' just write a "primer for sceptics" set of examples, but if there's a bare-bones librarylet knocking around, that I haven't found, then I'd like to use it, and I imagine the LOD list would know of it.
>
> Thanks for any pointers.
>
> All the best,
>
> Norman
>
>
> --
> Norman Gray  :  http://nxg.me.uk
> SUPA School of Physics and Astronomy, University of Glasgow, UK
>
>
>


-- 
Jean-Marc Vanel
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
http://jmvanel.free.fr/ - EulerGUI, a turntable GUI for Semantic Web +
rules, XML, UML, eCore, Java bytecode
+33 (0)6 89 16 29 52
chat :  irc://irc.freenode.net#eulergui

Received on Monday, 12 September 2011 12:50:19 UTC