How can I infer OWL domains/ranges of a given data/object property with a reasoner?
For example, I have two classes Rat
, Bird
and a data property hasName
. I want these classes to be the solely domains of hasName
:
<Declaration><Class IRI="#Rat"/></Declaration>
<Declaration><Class IRI="#Bird"/></Declaration>
<Declaration><DataProperty IRI="#hasName"/></Declaration>
<DataPropertyDomain>
<DataProperty IRI="#hasName"/>
<ObjectUnionOf>
<Class IRI="#Rat"/>
<Class IRI="#Bird"/>
</ObjectUnionOf>
</DataPropertyDomain>
When I used HermiT reasoner to infer domain, I got the owl:Thing
class, and not Rat
or Bird
:
Set<OWLClass> inferedDomains = hermitReasoner
.getDataPropertyDomains(hasNameProperty, false)
.getFlattened();
I can manually extract the domains by using owl-api to read DataPropertyDomainAxioms
of hasName
, to get Rat
, Bird
classes. But then I'll unable to get other inferable classes (e.g. Rat
has an equivalent class Mouse
).
So I'd like to use inference engines to infer the result, such as:
- Reasoners: HermiT, FacT++,...
- SQWRL rule engines: Drools,...
Is there any approach to achieve such results?