RFC: RDF::SKOS

This weekend I have commenced work on RDF::SKOS.

As most of you know, many have observed this before and larsbot has blogged about it in the past, SKOS is strikingly similar to Topic Maps, although in detail its semantics is much more limited. Interesting from a standards-political point of view.

There is yet no Perl coverage on CPAN. That has to change.

Generic SKOS

My current plan of attack is to have the abstract model of SKOS implemented in RDF::SKOS. That, by itself, does not do much, except offering classes of SKOS, Concepts and Schemes together with the interfaces to navigate between them. And to have the narrower, broader (and their inverse and transitive versions) in place.

SKOS on top of RDF

Here I have already implemented mostly RDF::SKOS::Redland, an SKOS view over an existing RDF Redland structure:

use RDF::Redland;
my $storage = new RDF::Redland::Storage ("hashes", "test", "hash-type='memory'");
my $model   = new RDF::Redland::Model ($storage, "");
# fill the model somehow

use RDF::SKOS::Redland;
my $skos = new RDF::SKOS::Redland ($model);
# play the SKOS ...

The reason why I have to ontologically commit to a particular RDF store, is that the access patterns to stores differ drastically. There might be an abstract RDF API for Java (not saying it is then also in practical use), but there is none for Perl. Not that I can see.

So there might be an RDF::SKOS::AllegroGraph, RDF::SKOS::Jena, RDF::SKOS::Sesame2, etc.

Native SKOSes

One thing I want to cover are native SKOSes, i.e. particular data, such as NACE (Nomenclature européenne des activités économiques) or its Austrian variation OeNACE. (Yes, it is silly to have these variants, but people here are silly. Very silly actually.)

That I have already, such as in RDF::SKOS::OeNACE.

Topic Mappish SKOSes

Of course, my ultimate plan is to convert (or should I say uplift?) an SKOS instance into a topic map. This is not just an empty exercise; I want/need to bring SKOSes into my Topic Map visualisation infrastructure.

I am still undecided how to do this best. One path I consider is to have it look like this to the user:

use RDF::SKOS::Redland;
my $skos = new RDF::SKOS::Redland ($model);

use TM::Virtual::SKOS;
my $tm = new TM::Virtual::SKOS ($skos);

That $tm object would be a virtual topic map, i.e. one which exposes all the behaviour of a map, without actually being one. The TM::Virtual::SKOS would manage the mediation between SKOS and TMs.

This setup would allow also to write at some point:

my $tm2 = $tm->materialize;

which creates a materialized copy of that virtual data.

We will see how far I get; I have not much time this week for this.

Posted In

SKOS data model as Perl module

There should be a generic SKOS package that only provides the specific SKOS properties and relations without much dependence to full RDF. Specific implementations (RDF triple store, Topic map, SQL...) can then implement the SKOS interface. For instance simple KOSes can also be implemented as plain Perl data structure that serializes/unserializes in RDF. Basically you only need Perl classes for skos:Concept, skos:Collection, skos:OrderedCollection, and skos:ConceptScheme and getter/setter methods for the properties and relations.

Jakob (not verified) | Thu, 11/12/2009 - 14:28

Re: SKOS data model as Perl module

without much dependence to full RDF. Specific implementations (RDF triple store, Topic map, SQL...) can then implement the SKOS interface

I agree. SKOS is a model by itself.

For instance simple KOSes can also be implemented as plain Perl data structure that \ serializes/unserializes in RDF.

Ok, that contradicts somewhat the above.

Basically you only need Perl classes for skos:Concept, skos:Collection, skos:OrderedCollection, and skos:ConceptScheme and getter/setter methods for the properties and relations.

At the moment I do not plan to support collections. And I also have no time atm to have full read/write support. So there will be a "getter" (what an ugly word), but no way to manipulate the SKOS model.

rho | Sat, 11/14/2009 - 19:36