如何根据其基数 class 在 class 中指定个人
How to classificate individuals in a class according to its cardinality
我创建了这个 ontology,其中包含两个 classes Car、Person 和对象 属性 hasCar,其中 Person 作为域,Car 作为范围。
我想在 multiCarOwner 和 OnlyCar person 中 classify individuals(Persons),这是代表这个的 ontology:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.owl-ontologies.com/Car.owl#"
xml:base="http://www.owl-ontologies.com/Car.owl"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.owl-ontologies.com/Car.owl"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#hasCar -->
<owl:ObjectProperty rdf:about="http://www.owl- ontologies.com/Car.owl#hasCar">
<rdfs:range rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<rdfs:domain rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#Car -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Car"/>
<!-- http://www.owl-ontologies.com/Car.owl#CarOwner -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:allValuesFrom rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#MultiCarOwner -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#MultiCarOwner">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:minCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#OnlyCar -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#OnlyCar">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#Person -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#Alice -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Alice">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_7"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Bob -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Bob">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Car_2 -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Car_7 -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// General axioms
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<rdf:Description>
<rdf:type rdf:resource="&owl;AllDifferent"/>
<owl:distinctMembers rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2"/>
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7"/>
</owl:distinctMembers>
</rdf:Description>
但是,当我创建个人时,推理器没有给我想要的结果,我希望 "OnlyCar" class 的成员为:"individuals with exactly 1 Car."
推理的结果是偏的,因为protegé中的个体标签显示如下:
上图显示 "Bob" 个人作为 CarOwner 会员,但我希望 "bob" 成为 "onlyCar" class.
的会员
-我遇到了 OWA 问题?
-有办法完成我想要的吗?
The images above show the "Bob" individual as a CarOwner member but i want that "bob" as member of "onlyCar" class. -I am facing an OWA problem ? -There is a way to accomplish what i want?
你说过鲍勃拥有一辆车,但你没有说过鲍勃没有拥有任何其他汽车。话虽如此,你不能确定他只有一辆车。您需要向 bob 添加另一个类型断言,即:
hasCar only {Car_2}
那么,既然你知道他拥有Car_2而且你知道他只拥有 Car_2,你将能够推断 bob 是
的一个元素
hasCar exactly 1 Car
我创建了这个 ontology,其中包含两个 classes Car、Person 和对象 属性 hasCar,其中 Person 作为域,Car 作为范围。
我想在 multiCarOwner 和 OnlyCar person 中 classify individuals(Persons),这是代表这个的 ontology:
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.owl-ontologies.com/Car.owl#"
xml:base="http://www.owl-ontologies.com/Car.owl"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.owl-ontologies.com/Car.owl"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Object Properties
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#hasCar -->
<owl:ObjectProperty rdf:about="http://www.owl- ontologies.com/Car.owl#hasCar">
<rdfs:range rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<rdfs:domain rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
</owl:ObjectProperty>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#Car -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Car"/>
<!-- http://www.owl-ontologies.com/Car.owl#CarOwner -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:allValuesFrom rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:Restriction>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#MultiCarOwner -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#MultiCarOwner">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">2</owl:minCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#OnlyCar -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#OnlyCar">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#CarOwner"/>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.owl-ontologies.com/Car.owl#hasCar"/>
<owl:onClass rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
<owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<!-- http://www.owl-ontologies.com/Car.owl#Person -->
<owl:Class rdf:about="http://www.owl-ontologies.com/Car.owl#Person"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://www.owl-ontologies.com/Car.owl#Alice -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Alice">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_7"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Bob -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Bob">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Person"/>
<hasCar rdf:resource="http://www.owl-ontologies.com/Car.owl#Car_2"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Car_2 -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>
<!-- http://www.owl-ontologies.com/Car.owl#Car_7 -->
<owl:NamedIndividual rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7">
<rdf:type rdf:resource="http://www.owl-ontologies.com/Car.owl#Car"/>
</owl:NamedIndividual>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// General axioms
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<rdf:Description>
<rdf:type rdf:resource="&owl;AllDifferent"/>
<owl:distinctMembers rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_2"/>
<rdf:Description rdf:about="http://www.owl-ontologies.com/Car.owl#Car_7"/>
</owl:distinctMembers>
</rdf:Description>
但是,当我创建个人时,推理器没有给我想要的结果,我希望 "OnlyCar" class 的成员为:"individuals with exactly 1 Car."
推理的结果是偏的,因为protegé中的个体标签显示如下:
上图显示 "Bob" 个人作为 CarOwner 会员,但我希望 "bob" 成为 "onlyCar" class.
的会员-我遇到了 OWA 问题? -有办法完成我想要的吗?
The images above show the "Bob" individual as a CarOwner member but i want that "bob" as member of "onlyCar" class. -I am facing an OWA problem ? -There is a way to accomplish what i want?
你说过鲍勃拥有一辆车,但你没有说过鲍勃没有拥有任何其他汽车。话虽如此,你不能确定他只有一辆车。您需要向 bob 添加另一个类型断言,即:
hasCar only {Car_2}
那么,既然你知道他拥有Car_2而且你知道他只拥有 Car_2,你将能够推断 bob 是
的一个元素hasCar exactly 1 Car