xml schema for skos
Norman Gray
norman at astro.gla.ac.uk
Wed Apr 8 15:58:55 PDT 2009
Gerard, hello.
On 2009 Apr 8, at 13:07, Gerard wrote:
> I am looking for a Java library which I did not found under
> librdf.org.
> Its Java binding seems to have been deprecated it.
> I have found jrdf (http://jrdf.sourceforge.net/), will try that out
> for now.
> Afterwards I might vote for a simple (maybe even schema based) XML
> serialisation.
Having blithely said 'use an RDF parser', and then gone to look for
one, I realised that they're actually a little thinner on the ground
than I expected.
Jena (as Tony suggested) is a very good RDF/OWL/reasoning/everything-
else library, but is huge (because of the .../OWL/reasoning/everything-
else bit). Sesame is another well-known one, and smaller, but still
on the heavyweight side. Either of Jena or Sesame could claim to be
the javax.xml/Xalan/Xerxes of the RDF world. From a quick look, JRDF
looks smaller than either of them, but still does a lot more than you
really need here, and as a result of being much less well known than
Jena and Sesame, is probably less battle-tested.
So I had a closer look at Sesame, and have concluded that this is
probably the one you want to use. The Jena distribution is pretty
monolithic, but Sesame is distributed in a much more componentised
form, and by cherrypicking the right .jars from Sesame, you can
assemble a pretty lightweight parser for yourself. Mmm: I hadn't
previously known that about Sesame!
I've attached a 20kB tarball which contains an example program which
parses RDF in two serialisations 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.
Rick said:
> I hate to mention it (well, not really), but I long ago said that
> part of the IVOA vocabulary proposal should have been suggestions
> for the exact format of RDF/XML so that a formal IVOA RDF/XML schema
> could have been reality, making the practical parsing of
> vocabularies much simpler (for all of the Roy William's and Alasdair
> Allen's of the world that don't want to add Turtle, n-triple, OWL,
> and arbitrarily complex RDF parsers to their list of needed tools).
Yes: as I noted, we discussed this, but the fallout from specifying an
RDF/XML profile is non-negligible.
The point is that you _don't_ need "Turtle, n-triple, OWL, and
arbitrarily complex RDF parsers" to use this stuff -- just as you
don't need XPath, XQuery, XProc, XMI, and arbitrarily complex schema
languages to parse bog-standard .xml files.
I'd be keen to hear your experiences with this, Gerard. If it's a big
hassle to integrate with what you've currently got, it'd certainly be
possible to revisit the RDF/XML profile idea, but my impression from
this little experiment is that 'use a subset of Sesame jars' is a
recommendation I can make with the honest expectation that it'll be
useful and feasible.
SKOS is simple enough that it's representable as XML without violence,
but XML isn't the answer to everything any more than Fortran is.
Yours in all pragmatism,
Norman
--
Norman Gray : http://nxg.me.uk
Dept Physics and Astronomy, University of Leicester
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParseSesame.tar.gz
Type: application/x-gzip
Size: 3814 bytes
Desc: not available
URL: <http://www.ivoa.net/pipermail/semantics/attachments/20090408/d5665221/attachment-0001.gz>
More information about the semantics
mailing list