0

我正在尝试模拟以下情况:

  • 学位可以是学士或硕士
  • 学生可能是本科生或硕士生
  • 学位可能有学生:学士学位只有本科生,反之亦然。

我想尝试使用“唯一”限制,因此我定义了学士学位,例如,等同于“只有学士学位学生”。因此,我使用 Protegé 生成了以下代码:

:has rdf:type owl:ObjectProperty ;
    rdfs:domain :Degree ;
    rdfs:range :Student .

:Bachelor rdf:type owl:Class ;
    owl:equivalentClass [ rdf:type owl:Restriction ;
                          owl:onProperty :has ;
                          owl:allValuesFrom :BachelorStudent
                        ] ;
    rdfs:subClassOf :Degree ;
    owl:disjointWith :Master .

:BachelorStudent rdf:type owl:Class ;
    rdfs:subClassOf :Student ;
    owl:disjointWith :MasterStudent .

:Degree rdf:type owl:Class ;
    owl:disjointWith :Student ;
    owl:disjointUnionOf ( :Bachelor
                          :Master
                        ) .

:Master rdf:type owl:Class ;
    owl:equivalentClass [ rdf:type owl:Restriction ;
                          owl:onProperty :has ;
                          owl:allValuesFrom :MasterStudent
                        ] ;
    rdfs:subClassOf :Degree .

:MasterStudent rdf:type owl:Class ;
    rdfs:subClassOf :Student .

:Student rdf:type owl:Class ;
    owl:disjointUnionOf ( :BachelorStudent
                          :MasterStudent
                        ) .

但是,当我启动推理器时,这会导致不一致。提供的解释如下: 不一致的解释 我无法弄清楚我做错了什么。我误解了“仅”的使用,还是有其他错误?

4

1 回答 1

2

问题如下:使用公理:

Master EquivalentTo has only MasterStudent

因此,没有属性的东西has被归类为Master(has only MasterStudent包含根本没有has属性的东西)。如果这听起来很奇怪,请想想课堂hasChild only Person。这个类标识这样的事物,如果他们有孩子,那么孩子就是人。显然,人们属于这个阶层,即使他们没有孩子。

对于Bachelor. 所以,如果一个事物没有has属性,它必须同时属于BachelorMasterBachelor但是如果存在这样的东西,那么它就会违反和之间的不相交关系Master。所以我们必须得出结论,一切都有has属性。这意味着一切都是 a Degree(因为 的域has)并且与 a 相关Student(因为 的范围has)。所以存在学生,因为一切都是 a Degree,所以这些学生是度数,这违反了 和 之间的不相交StudentDegree

现在,您的模型的问题在于您使用了等价公理。您应该改为使用子类关系,并添加所有学位必须has与至少一些学生有关系,如下所示:

Master SubClassOf has only MasterStudent
Master SubClassOf has some Student
Bachelor SubClassOf has only BachelorStudent
Bachelor SubClassOf has some Student

甚至,如果您希望它受到更多限制:

Master EquivalentTo (has only MasterStudent and has some Student)
Bachelor EquivalentTo (has only MasterStudent and has some Student)
于 2021-12-18T08:55:06.207 回答