Protege中如何根据属性触发类等价推理

问题描述 投票:0回答:1

我希望 Protégé 推断某个类(或个人)如果具有特定属性,则等同于另一个类。

以下是显示该问题的最小片段。我希望推理者能够弄清楚疫苗导致自闭症是一种医学阴谋论。

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .

:involves rdf:type rdf:ObjectProperty . 
:Medicine rdf:type owl:Class .
:SecretPlan rdf:type owl:Class .

:MedicalConspiracyTheory a owl:Class ;
  rdfs:label "Medical Conspiracy Theory" ;
  owl:equivalentClass [ 
    rdf:type owl:Restriction ;
    owl:onProperty :involves ;
    owl:someValuesFrom [
      rdf:type owl:Class ;
      owl:intersectionOf ( :SecretPlan :Medicine )
    ]
  ] .

:VaccinesCauseAutism a owl:Class;
  rdfs:label "Vaccines Cause Autism" ;
  :involves :SecretPlan, :Medicine .

我在这里做错了什么?

owl protege
1个回答
0
投票

原来的方法不起作用,因为推理器无法处理 :involves 属性的对象是类。它仅适用于实例。

以下代码有效 - 我创建了 :SecretPlan 和 :Medicine 类的两个匿名实例,这似乎可以解决问题。

我还必须重写equivalentClass代码,但我不知道为什么 - 据我所知,新版本与旧版本基本相同,但旧版本不起作用。如果有人可以对此进行解释,我将非常感激。

此版本的代码运行良好:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:involves rdf:type owl:ObjectProperty .
:Medicine rdf:type owl:Class .
:SecretPlan rdf:type owl:Class .

:MedicalConspiracyTheory rdf:type owl:Class ;
  rdfs:label "Medical Conspiracy Theory" ;
  owl:equivalentClass [
    owl:intersectionOf (
      [ rdf:type owl:Restriction ;
        owl:onProperty :involves ;              
        owl:someValuesFrom :Medicine
      ]                                  
      [ rdf:type owl:Restriction ;
        owl:onProperty :involves ;
        owl:someValuesFrom :SecretPlan
      ]                                               
    ) ;                                        
    rdf:type owl:Class                  
  ] .                                

:VaccinesCauseAutism rdf:type owl:NamedIndividual;
  :involves 
    [rdf:type owl:NamedIndividual,:Medicine ],
    [rdf:type owl:NamedIndividual,:SecretPlan ];
  rdfs:label "Vaccines Cause Autism" .
© www.soinside.com 2019 - 2024. All rights reserved.