【问题标题】:Using only constraint in owl leads to inconsistency在 owl 中仅使用约束会导致不一致
【发布时间】:2021-12-17 22:48:45
【问题描述】:

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

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

我想尝试使用“only”限制,因此我将Bachelor 定义为等同于“只有BachelorStudent”。 因此,我使用 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
                        ) .

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

【问题讨论】:

    标签: owl ontology protege reasoner hermit


    【解决方案1】:

    问题如下:用公理:

    Master EquivalentTo has only MasterStudent
    

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

    Bachelor 也是如此。所以,如果一个事物没有has 属性,它必须同时属于BachelorMaster。但是如果存在这样的东西,那么它将违反BachelorMaster之间的不相交关系。所以我们必须得出结论,一切都具有has 属性。这意味着一切都是Degree(因为has 的域)并且与Student 相关(因为has 的范围)。所以存在学生,因为一切都是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)
    

    【讨论】:

      猜你喜欢
      • 2018-04-23
      • 2015-12-17
      • 2017-05-27
      • 2011-11-27
      • 1970-01-01
      • 1970-01-01
      • 2014-02-07
      • 2015-05-06
      • 2014-12-06
      相关资源
      最近更新 更多