On 9/3/2011 12:48 PM, Phillip Rhodes wrote:
On Sat, Sep 3, 2011 at 11:57 AM, Dave Reynolds
<[email protected]> wrote:
That all sounds plausible and is easy to implement but as I say, I don't
see that is compatible with the published spec. SKOS did change quite a
bit between its initial submission (out of the SWADE project) and the
final Rec so it's possible this is an area that changed.
Probably so. The book is from 2007/2008 or so, so it's not super current.
Unfortunately w3.org seems to be down right this minute, so I can't even
read the spec. Oh well, time to go do some shopping and get away
from computers for a little while anyway! :-)
I happen to have both editions of the book. The section you referred to
in 1st Ed i.e. "Special Purpose Inference" (which is right after the
"Meaning of Semantic Relations" section) is not in 2nd Ed anymore. In
2nd Ed, after "Meaning of Semantic Relations", there is a new section on
"SKOS and linked vocabularies" that talks about the mapping relations,
and then a new section on "Concept Schemes". In fact, SKOS has its own
individual chapter in 2nd Ed instead of sharing a chapter with FOAF as
in 1st Ed. Towards the end of the chapter on SKOS in 2nd Ed, there is a
section on "SKOS Integrity" that specifically quotes the few integrity
conditions mentioned by Dave, i.e. any two things related by any
semantic relation (broader, narrower, related) are both members of the
class skos:Concept.
A basic set up is very easy:
[[[
Model data = FileManager.get().loadModel("data/test.rdf");
List<Rule> rules = Rule.rulesFromURL("file:data/test.rules");
GenericRuleReasoner reasoner = new GenericRuleReasoner(rules);
InfModel inf = ModelFactory.createInfModel(reasoner, data);
inf.setNsPrefixes( data );
inf.write(System.out, "Turtle");
]]]
where data/test.rdf is your file with entities defined and
data/test.rules is:
[[[
@prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:<http://www.w3.org/2002/07/owl#> .
@prefix xsd:<http://www.w3.org/2001/XMLSchema#> .
@prefix skos:<http://www.w3.org/2004/02/skos/core#> .
<snip>
example:Milk
a skos:Concept ;
skos:narrower example:MilkBySourceAnimal , example:SheepMilk ,
example:BuffaloMilk , example:CowMilk , example:GoatMilk .
...
Cool, thanks! One question though... from what I read on the jena docs page on
using the GenericRuleReasoner[1], I got the impression that if you
wanted to combine
custom rules with the "stock" rules, you had to do some sort of import in the
rule file (eg, your "test.rules").
Is that still the case? If so, do you happen to know how that @import bit works
that they mention? In particular, how would I know what the value of
the @import
would be? I'm guessing a path, but not sure where the "stock"
rdfs/owl/etc. rules
are stored...
[1]: http://jena.sourceforge.net/inference/#RDFSPlusRules
Thanks,
Phil
Cheers,
Dave H