xml schema for skos

Norman Gray norman at astro.gla.ac.uk
Wed Apr 8 04:11:30 PDT 2009


Gerard, hello.

It's good to see some independent use of the vocabularies.  Your  
experience here will be very useful -- let me know if I can help more.

On 2009 Apr 8, at 10:19, Gerard wrote:

> I am trying to incorporate SKOS vocabularies in SimDB.
> For a proto-type implementation that uses JAXB for XML  
> (un)marshalling I
> could use an xml schema describing the XML syntax of SKOS. Does this  
> exist,
> can someone point me to it?

There isn't such a schema, I'm afraid.

SKOS is an RDF vocabulary, so processing a SKOS vocabulary means  
processing an RDF graph (albeit one with a _very_ simple structure).   
RDF has three well-known serialisations: RDF/XML, Turtle (also called  
Notation3 or n3) and n-triples.

What you're (presumably) looking at is RDF/XML, which is a  
serialisation of an RDF graph as XML.  It's syntactically well-formed  
XML, but not described by a schema, but instead by a set of rules  
described in [1].  Though any RDF/XML file will be deserialised to  
give equivalent RDF, a given RDF graph could be serialised into  
multiple rather different-looking XML files.

The SKOS files that are part of the Vocabularies document are pretty  
regular, but could in principle be written in different ways.  Also,  
other SKOS vocabularies could use write their RDF/XML taking advantage  
of the freedoms that [1] provides.

I'm aware that there are a couple of stylesheets which can grok  
reasonably general RDF/XML, and there are a couple of proposals for  
alternative XML syntaxes for RDF, none of which has gained much  
traction.  Fundamentally, if you're going to process RDF, it's best to  
process it as RDF.  There are assorted tools which can parse, and  
translate between, RDF syntaxes: librdf.org is a well-known one with  
bindings to multiple languages.  Translating the vocabulary into n- 
triples, which is _very_ easy to parse, may be a useful step.

This is admittedly more hassle than you were anticipating!  During the  
development of the Vocabularies document, there was some discussion  
(initiated by Rick) about specifying an XML-friendly profile of RDF/ 
XML.  The problem with that is that specifying some sort of RDF/XML- 
lite would involve quite a lot of work: beside the specification and  
validation work rquired, this would also preclude using generic RDF  
tools to work with the vocabularies, since these wouldn't, obviously,  
be able to generate the RDF/XML profile.

Having said that, it occurs to me that there may be a way to specify a  
non-mandatory XML serialisation format for vocabularies, in a fairly  
principled way, and without massive effort.  How much hassle does the  
above RDF-parsing sound?

All the best,

Norman


[1] http://www.w3.org/TR/rdf-syntax-grammar/

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



More information about the semantics mailing list