我正在尝试模拟以下情况:
- 学位可以是学士或硕士
- 学生可能是本科生或硕士生
- 学位可能有学生:学士学位只有本科生,反之亦然。
我想尝试使用“唯一”限制,因此我定义了学士学位,例如,等同于“只有学士学位学生”。因此,我使用 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
) .
但是,当我启动推理器时,这会导致不一致。提供的解释如下:
我无法弄清楚我做错了什么。我误解了“仅”的使用,还是有其他错误?