Re: Experimental Ruby SKOS API

Hi Simon and Dan,

Can I hitchike within your hijacks?

I took a different approach as my goal is to be able to manage very big authority lists as SKOS schemes (for instances 400 thousands chemical substances): SKOS is modeled as java beans (classes) and concepts can be cached (a scheme is not oblige to reside fully in memory: concepts are paged in from an SQL database). I also defined an XSD and enabled JAXB XML serialization/deserialization.

I like Protege very much (I used it in many projects) and I am very enthusiastic that a path could exists from SKOS/Protege to my stuff, using your API (or reparsing using RIO).

SKOS Sources I support now:
* SQL databases (SQL queries are parameterized to map "any" database to SKOS model)
* CSV files (Excel) with columns named "about", "broader", "label-en", etc.
* XML files conforming to my SKOS XSD

SKOS Sinks I support now:
* XML SKOS "view" (data is filtered for the user language) used for instance in http://www.windmusic.org/dspace/subject-search

I fully integrated my stuff within DSpace to allow:
* autocomplete when cataloguing
* Lucene indexing with synonyms, translations but also broader+broadMatch codes
* autocomplete when searching, translating user terms to concept codes
* precise search using concept codes (encompassing or not codes from narrower term)
* full text search using words (knowing that all variants have been indexed).

I still have to:
* separate Lucene/SKOS integration from DSpace (make a general Lucene+SKOS module "pluggable" in DSpace but also JSPWiki, Carrot2, Solr, etc.)
* provide RDF input/output to enable Protege SKOS Sources for instance and thesaurus export.
* document, document, document to share the results in other projects.

Thanks for the hints!

Christophe


--- En date de : Mer 18.2.09, Dan Brickley <danbri@danbri.org> a écrit :

> De: Dan Brickley <danbri@danbri.org>
> Objet: Re: Experimental Ruby SKOS API
> À: "Simon Jupp" <simon.jupp@manchester.ac.uk>
> Cc: "SKOS" <public-esw-thes@w3.org>
> Date: Mercredi 18 Février 2009, 16h22
> On 18/2/09 15:44, Simon Jupp wrote:
> > Dan,
> >
> > I don't know much about Ruby but i like the idea
> of having a scripting
> > language to do some stuff with SKOS. This may be of
> some use to you if
> > you, especially if you want to work with SKOS and
> Java. I have started a
> > java API for SKOS [1] that is an extension of the OWL
> 2 API [2]. It is
> > designed to provide a complete abstraction of the SKOS
> data model and
> > supports all SKOS constructs that fall within OWL 2.
> >
> > Some advantages of this approach are:
> > - You can work with SKOS objects at a high level
> abstraction without
> > having to worry about any of the concrete syntaxes
> such as RDF/XML
> > - Create, Edit and Read SKOS files (Nice and clean
> axiom based change
> > control)
> > - All the parsing and serialisation is handled by the
> OWL API
> > - Because it's an extension of the OWL API, you
> have access to the
> > underlying OWL objects (e.g. for handling extensions
> to SKOS)
> > - All the reasoners supported by the OWL API (Pellet,
> Fact++ etc) mean
> > you can work with a inferred SKOS model
> >
> > Anyway, sorry if I hijacked your thread! If it's
> of no us to you maybe
> > someone else on this list who want to do Java
> programming with SKOS
> > might be interested.
> 
> Hey, don't be sorry :) This is great stuff. And as it
> is in Java, looks 
> like it can be wrapped from jruby in just the same way. I
> am happy if I 
> can avoid implementing everything myself.  Particularly so
> as my real 
> interest here is on figuring out quite where thesaurus-like
> modelling 
> stops, and RDF/OWL class-based models start. So having SKOS
> data wired 
> up to OWL reasoners is really great. If you have draft OWL2
> support in 
> the same environment, that's really interesting too,
> since I am pretty 
> motivated to work on bring FOAF closer to OWL2, though
> it's hard without 
> tools to test with.
> 
> BTW does this have any relationship to the SKOS addon for
> Protege 4?
> [2 mins googling later]. Ah yes, that's you as well.
> You've been busy!
> http://protegewiki.stanford.edu/index.php/SKOS_Editor  ...
> OK I'll 
> hijack my own thread then, to mention a feature request:
> can we have an 
> easy way in the SKOS plugin to add custom datatypes for use
> with 
> skos:notation? I ran into this problem yesterday...
> 
> Back re SKOS APIs, I'll try calling your java stuff
> from jruby. I am not 
> at all invested in my code, ... it's only 150 lines of
> ruby after all. 
> OK that's probably 500 lines of Java, but still... :)
> 
> Have you looked at all at indexing/search facilities for
> SKOS? My next 
> step was to try to wire this up with Lucene indexes, and
> experiment with 
> "did you mean?" and autocompletion facilities
> that could be used in 
> searching and tagging UI.
> 
> cheers,
> 
> Dan
> 
> > Cheers,
> > Simon
> >
> >
> > 1- http://skosapi.sourceforge.net/
> > 2- http://owlapi.sourceforge.net/
> >
> >
> > Simon Jupp
> > simon.jupp@manchester.ac.uk
> > http://www.cs.man.ac.uk/~sjupp/
> >
> >
> > On 18 Feb 2009, at 11:12, Dan Brickley wrote:
> >
> >>
> >> Just a quick note to report on a work-in-progress
> I've been exploring
> >> this week.
> >>
> >> I started to make a Ruby API for SKOS.
> >>
> >> The distinguishing feature here is that it uses
> jruby (a Ruby
> >> implementation in pure Java). As such it can call
> on the full powers
> >> of the Jena toolkit, which go far beyond anything
> available currently
> >> in Ruby. At the moment it doesn't do much, I
> just parse SKOS and make
> >> a tiny object model which exposes little more than
> prefLabel and
> >> broader/narrower.
> >>
> >> I think it's worth exploring because Ruby is
> rather nice for
> >> scripting, but lacks things like OWL reasoners and
> the general
> >> maturity of Java RDF/OWL tools (parsers,
> databases, etc.).
> >>
> >> I've posted some example snippet in See
> >>
> http://svn.foaf-project.org/foaftown/2009/skosdex/readme.txt
> which
> >> uses the UKAT SKOS dataset.
> >>
> >> The idea is to use some ruby idioms to explore the
> SKOS graph.
> >>
> >> Quick example. This goes 2 levels down from some
> chosen concept:
> >>
> >> s1 = SKOS.new()
> >> s1.read("file:samples/archives.rdf")
> >> c1 =
> s1.concepts["http://www.ukat.org.uk/thesaurus/concept/1366"]
> >> puts "test concept is "+ c1 + "
> " + c1.prefLabel
> >> c1.narrower do |uri|
> >> c2 = s1.concepts[uri]
> >> puts "\tnarrower: "+ c2 + "
> " + c2.prefLabel
> >> c2.narrower do |uri|
> >> c3 = s1.concepts[uri]
> >> puts "\t\tnarrower: "+ c3 +
> " " + c3.prefLabel
> >> end
> >> end
> >>
> >> See
> http://svn.foaf-project.org/foaftown/2009/skosdex/readme.txt
> for
> >> the indented output, which I won't show here
> as it'll get lost in
> >> email formatting.
> >>
> >> I'm interested to hear if anyone else has
> explored this topic.
> >> Obviously there is a lot more to SKOS than
> broader/narrower, so I'm
> >> very interested to find collaborators or at least
> a sanity check
> >> before taking this beyond a rough demo.
> >>
> >> Thanks for any thoughts,
> >>
> >> Dan
> >>
> >> --
> >> http://danbri.org/
> >>
> >
> >
> >
> >
> >
> >
> >
> >


      

Received on Wednesday, 18 February 2009 16:01:44 UTC