Re: IVOA Thesaurus

From: Douglas Burke <dburke-at-cfa.harvard.edu>
Date: Tue, 30 Oct 2007 16:35:05 -0400


Frederic V. Hessman wrote:
>

>> My second issue is to do with maintenance. In going through the
>> vocabulary I have found quite a few errors that have crept in due to
>> the editing process. (The list can be found at the bottom of this
>> email.) Some of these are simple typos but others are where
>> identifiers have been changed for a concept and the subsequent edits
>> have not been made for all of the relationships involving that edit.
>> Others make the vocabulary poly-hierarchy inconsistent, e.g.
>> acceleration of gravity has gravity as a broader term but the inverse
>> relation is not present in gravity. I think that we need to develop
>> scripts that can check that the inverses of all of the relationships
>> that are declared in the hierarchy are present. This would be based on
>> the related relationship being symmetrical and the broader/narrower
>> being inverses of each other.
>>

> I have made very little effort to correct the consistency of BT's and 
> NT's, thinking like Alasdair, that someone will use a much fancier tool 
> which spits out the correct list.
> 
> Note, however, that total consitency is only really important when the 
> thesaurus is more-or-less finished in it's final working-draft form.

In the spirit of "why not use a sledge hammer to crack a walnut", I've just tried automatically adding skos:broader/narrower terms for those that are missing, using cwm and assuming that the terms are inverses of each other.

The magic - once you have cwm installed [1,2] - is

% cwm
http://www.astro.physik.uni-goettingen.de/~hessman/rdf/IVOAT/IVOAT.rdf --think=http://hea-www.harvard.edu/~dburke/playground/infer.n3 --rdf > ivoa.infer.rdf

or

% cwm
http://www.astro.physik.uni-goettingen.de/~hessman/rdf/IVOAT/IVOAT.rdf --filter=http://hea-www.harvard.edu/~dburke/playground/infer.n3 --rdf > ivoa.additions.rdf

and the output files are at

http://hea-www.harvard.edu/~dburke/playground/ivoa.infer.rdf http://hea-www.harvard.edu/~dburke/playground/ivoa.additions.rdf

where the first version is the full set of terms (ie Rick's "Tue Oct 30 09:44:06 2007" version with my additions) and the second one is just the set of additions made.

The rules I used for this are shown below. Not exactly rocket science ;-) Doug

[1] http://www.w3.org/2000/10/swap/doc/CwmInstall [2] http://dig.csail.mit.edu/2007/Talks/0110-rules-tbl/

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix : <http://www.Astro.physik.Uni-Goettingen.DE/~hessman/rdf/IVOAT#> .
@prefix string: <http://www.w3.org/2000/10/swap/string#>.


{

   ?x skos:narrower ?y .
   ("DJB: added skos:broader term for '" ?x.skos:prefLabel "' (2007-OCT-30)")
          string:concatenation ?s.
}
=>
{

   ?y skos:broader ?x ;

      skos:changeNote ?s .
} .

{

   ?x skos:broader ?y .
   ("DJB: added skos:narrower term for '" ?x.skos:prefLabel "' (2007-OCT-30)")
          string:concatenation ?s.
}
=>
{

   ?y skos:narrower ?x ;

      skos:changeNote ?s .
} . Received on 2007-10-30Z22:11:26