On Tuesday, March 19, 2013 03:07:29 PM Ed Swing wrote:
> On to my next unexplainable thing in Jena - Property domains.
> The code below is trying to identify what properties apply to a class 
> based on the property domain. Here's the code:
> package ontology;

(fx:snip)

> Several of these are incorrect. For instance, organizationsInBody explicitly 
> has a domain of NewsArticle:
> 
>        <owl:ObjectProperty rdf:ID="organizationsInBody">
>               <rdfs:domain rdf:resource="#NewsArticle" />
>               <rdfs:range rdf:resource="#Organization" />
>        </owl:ObjectProperty>

That doesn't make the printed answer incorrect ...

> The Javadoc description for getDomain() is "Answer a resource that represents 
> the domain class of this property. If there is more than one such resource, an
> arbitrary selection is made."

... because if there are multiple domain classes, /somehow/ Jena has to
choose one. (It chooses the first one that turns up when doing whatever
the code "naturally" does.)

> If the domain of a property can be generalized into Thing (trivially true) 
> then this
> method is useless - all it has to do is return Thing every time to be 
> technically correct.

Whether or not the range generalises to Thing is going to depend
on how much inference the model has been asked to do and whether
the Jena implementors are trying to be more than just "technically correct".

It looks like getDomain() isn't the method you're looking for; something
based on listDomain() (exactly what I don't know) may be more useful.

Chris

-- 
"I know it was late, but Mountjoy never bothers,                /Archer's Goon/
 so long as it's the full two thousand words."

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)

Reply via email to