I am trying to model the following situation:
- A degree may be Bachelor or Master
- A student may be BachelorStudent or MasterStudent
- A degree may have students: Bachelor degrees only have BachelorStudents and viceversa.
I want to experiment with the usage of the "only" restriction, therefore I have defined Bachelor, for example, as equivalent to "has only BachelorStudent". Therefore, I generated the following code using 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
) .
However, this leads to an inconsistency when I launch the reasoner. The provided explanation is the following:
I cannot figure out what I am doing wrong. Am I misunderstanding the use of "only", or are there any other mistakes?