Hi,

On Fri, 2011-09-02 at 22:34 -0400, Phillip Rhodes wrote: 
> Hi all, I have a question about using SKOS with Jena:  I'm looking
> at the section of "Semantic Web for the Working Ontologist", on page
> 166-167 where it talks about "Special Purpose Inference" and trying
> to figure out how (or if) this works with Jena.  I have a sample
> little rdf file cooked up that looks like:
> 
> (leaving out namespace declarations and such to save space)
> 
>       <rdf:Description rdf:about="&example;Milk">
>               <rdf:type rdf:resource="&skos;Concept" />
>               <skos:narrower rdf:resource="&example;MilkBySourceAnimal" />
>       </rdf:Description>      

I don't think that is legal.

I'm not an expert on SKOS:Collections but as far as I can see from the
spec [1] the range of skos:narrower is skos:Concept (S19, S21, S22) and
skos:Collection is disjoint from skos:Concept (S37). So you can't have a
Collection as a narrowing of a Concept. 
        
>       <rdf:Description rdf:about="&example;MilkBySourceAnimal">
>               <rdfs:label>Milk by source animal</rdfs:label>
>               <rdf:type rdf:resource="&skos;Collection" />
>               <skos:member rdf:resource="&example;BuffaloMilk" />
>               <skos:member rdf:resource="&example;GoatMilk" />
>               <skos:member rdf:resource="&example;CowMilk" />
>               <skos:member rdf:resource="&example;SheepMilk" />               
>       </rdf:Description>
>       
>       
>       <rdf:Description rdf:about="&example;BuffaloMilk">
>               <rdf:type rdf:resource="&skos;Concept" />
>               <skos:prefLabel>Buffalo Milk</skos:prefLabel>
>       </rdf:Description>
> 
>       <rdf:Description rdf:about="&example;CowMilk">
>               <rdf:type rdf:resource="&skos;Concept" />
>               <skos:prefLabel>Cow Milk</skos:prefLabel>
>       </rdf:Description>
> 
>       <rdf:Description rdf:about="&example;GoatMilk">
>               <rdf:type rdf:resource="&skos;Concept" />
>               <skos:prefLabel>Goat Milk</skos:prefLabel>
>       </rdf:Description>
>       
>       <rdf:Description rdf:about="&example;SheepMilk">
>               <rdf:type rdf:resource="&skos;Concept" />
>               <skos:prefLabel>Sheep Milk</skos:prefLabel>
>       </rdf:Description>
> 
> And I'm loading this into Jena, along with the skos vocabulary, like so:
> 
>               // load some data that uses RDFS
>               Model data = 
> FileManager.get().loadModel("file:data/skos/ex33/data.rdf");
>               
>               Model skosData = 
> FileManager.get().loadModel("file:data/skos/skos.rdf");
>               data.add(skosData);
>               
>               
>               Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
>               InfModel infmodel = ModelFactory.createInfModel(reasoner, data 
> );
> 
> Now if I'm understanding what this book is telling me, SKOS inference rule say
> that I should see triples in the form of:
> 
> example:Milk  skos:narrower  example:GoatMilk
> example:Milk skos:narrower example:SheepMilk

I don't think so. Even if your SKOS were not illegal there's nothing in
the spec [1] that I can see that connects skos:narrower with
skos:member. 

I don't have a copy of the book to hand, can you clarify exactly what it
is saying about inference over skos:member?

> etc.  But I don't see these.  Is there something extra I need to do to
> enable this particular bit
> of inference, or is my understanding here simply wrong, or what?  I
> note that the book says
> that "SKOS does not model the answer to this question in RDFS-Plus,
> but instead specifies a
> special purpose rule as part of the SKOS specification,"  so I'm
> guessing there's some extra
> "magic" missing, but if anyone can shed any light on this it would be
> much appreciated.

Most of SKOS inference is inherited from OWL and so indeed combining
instance data, the SKOS axioms and an OWL reasoner should be enough for
most cases (though I recommend using OWLMicro as the default OWL
reasoner).

There are some special purpose inference rules in SKOS. Jena does not
have them built in but it would be fairly easy to express then in
JenaRules and use a GenericRuleReasoner. In the case of Collections the
only special case rule I can see is S36 which relates skos:member to
skos:memberList - but you aren't using skos:memberList in your case.

Dave

[1] http://www.w3.org/TR/2009/REC-skos-reference-20090818/


Reply via email to