我尝试创建可能最简单的本体,由两个类(A,B)和两个类之间的关系(R)组成。我还想声明 A的每个人必须与其他人有关系R.
:R rdf:type owl:ObjectProperty ;
rdfs:domain :A ;
rdfs:range :B .
:A rdf:type owl:Class ;
rdfs:subClassOf owl:Thing ,
[ rdf:type owl:Restriction ;
owl:onProperty :R ;
owl:someValuesFrom :B
] ;
owl:disjointWith :B .
:B rdf:type owl:Class ;
rdfs:subClassOf owl:Thing .
现在有些人:
:a1 rdf:type :A , owl:NamedIndividual ; :R :b1 .
:a2 rdf:type :A , owl:NamedIndividual .
:b1 rdf:type :B , owl:NamedIndividual .
但是理由并没有抱怨a2没有关系R.为什么?
(注意:我在Protégé创建了本体;我尝试过Fact ++和HermiT reasoners)
答案 0 :(得分:2)
I also want to state that every individual of A must have a relation R with some other individual.
You have done this correctly. When you go on to assert that
:a1 rdf:type :A , owl:NamedIndividual ; :R :b1 . :a2 rdf:type :A , owl:NamedIndividual . :b1 rdf:type :B , owl:NamedIndividual .
the reasoner will correctly infer there is some value, let's call it X, such that :a2 :R X and that X rdf:type :B. OWL reasoning uses the open world assumption. This means that if something is not explicitly stated to be true or false, it is not assumed to be false or true, but rather unknown. E.g., you could correctly assert that
Human ⊑ ∃ hasMother.Human
that is, that every Human has some Human as a mother. If I say that
DanielWebster ∈ Human
and that's all that I say; I haven't made an inconsistency. There are just things that are true that we don't know yet. We know that DanielWebster has a mother, but we don't know who she is.
If you want to close the world, you could do a few things, but the results may not be what you want. First, you could make B an enumerated class. That is, you could explicitly list the individuals of B:
B ≡ {b1}
That actually won't lead to an inconsistency, though. In fact, the reasoner will infer that since a2 must be related to some B, and the only B is b1, that a2 is related by R to b1.
答案 1 :(得分:1)
您也可以使用同等效果。
:一只猫头鹰:equivalentClass [rdf:type owl:Restriction; 猫头鹰:onProperty:R; owl:someValuesFrom owl:Thing ];
您不需要为R编写域约束。等效的将会处理它。您仍然需要编写范围约束。
但是理由并没有抱怨a2没有关系R.为什么?
回答这个问题。您需要了解Open world assumption。语义网是开放世界的假设。我在下面的评论中提到了一些研究论文,将一些概念或角色作为封闭世界的假设。例如,在您的示例中,如果将R作为闭合谓词。你会得到你问的错误。这完全是一个理论上的想法。