dburke at cfa.harvard.edu
Tue Oct 30 13:35:05 PDT 2007
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
The magic - once you have cwm installed [1,2] - is
--think=http://hea-www.harvard.edu/~dburke/playground/infer.n3 --rdf >
--filter=http://hea-www.harvard.edu/~dburke/playground/infer.n3 --rdf >
and the output files are at
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 ;-)
--- infer.n3 ---
@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 "'
?y skos:broader ?x ;
skos:changeNote ?s .
?x skos:broader ?y .
("DJB: added skos:narrower term for '" ?x.skos:prefLabel "'
?y skos:narrower ?x ;
skos:changeNote ?s .
More information about the semantics