【发布时间】: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