问题
What's the correct way to set domains/ranges of data/object properties in OWL?
If I have two classes A
, B
and a data property hasName
:
<Declaration><Class IRI="#A"/></Declaration>
<Declaration><Class IRI="#B"/></Declaration>
<Declaration><DataProperty IRI="#hasName"/></Declaration>
<FunctionalDataProperty>
<DataProperty IRI="#hasName"/>
</FunctionalDataProperty>
<DataPropertyRange>
<DataProperty IRI="#hasName"/>
<Datatype abbreviatedIRI="xsd:string"/>
</DataPropertyRange>
I want to set class A
and class B
as solely domains for hasName
. I tried to do it in three ways, which approach bellow is correct?
Option 1 - infered domain results:
A
,B
andowl:Thing
<DataPropertyDomain> <DataProperty IRI="#hasName"/> <Class IRI="#A"/> </DataPropertyDomain> <DataPropertyDomain> <DataProperty IRI="#hasName"/> <Class IRI="#B"/> </DataPropertyDomain>
Option 2 - infered domain result:
owl:Thing
<DataPropertyDomain> <DataProperty IRI="#hasName"/> <ObjectUnionOf> <Class IRI="#A"/> <Class IRI="#B"/> </ObjectUnionOf> </DataPropertyDomain>
Option 3 - infered domain result:
owl:Thing
<EquivalentClasses> <Class IRI="#A"/> <DataExactCardinality cardinality="1"> <DataProperty IRI="#hasName"/> <Datatype abbreviatedIRI="xsd:string"/> </DataExactCardinality> </EquivalentClasses> <EquivalentClasses> <Class IRI="#B"/> <DataExactCardinality cardinality="1"> <DataProperty IRI="#hasName"/> <Datatype abbreviatedIRI="xsd:string"/> </DataExactCardinality> </EquivalentClasses>
From option 1, I got 3 results from HermiT reasoner: A
, B
, and owl:Thing
, but when I read this post he said that I wrote wrong semantics and should've use owl:unionOf
.
Then I tried to express the classes like in option 2, but when I infered again, I only get the class owl:Thing
, not A
or B
.
With option 3, I set the classes as domains in the equivalent class axioms. It could work but then I cannot use the powerful reasoner tool to infer:
Set<OWLClass> classes = reasoner.getDataPropertyDomains(hasNameProperty, false).getFlattened();
回答1:
First and most important point: Domain and range for a property hasName
in OWL semantics are not restrictions on hasName
! Instead, those axioms are used to infer types of individuals that are related via the property hasName
.
Option 1
Regarding your example, it declares multiple domains for the property hasName
, which means the intersection of those classes, i.e. A and B
.
Option 2
This is indeed the most common way.
Option 3
I don't get what you're doing here. But in OWL the Open World Assumption (OWA) holds, which means unknown information is not considered to be false. It's just unknown. Thus, if you have an individual a
that is only related to an individual x
via property hasName
a standard OWL reasoner cannot (and must not) conclude that a
belongs to class A
.
Note, the semantic equivalent subClassOf axiom for a domain axiom in OWL is (in pseudo Manchester Syntax)
hasName Domain: A
(hasName some owl:Thing) SubClassOf: A
来源:https://stackoverflow.com/questions/42595841/define-mutiple-domains-ranges-in-a-same-propery-in-owl