问题
I was hoping I could defined Elective_Course
in such a way that all individuals that are partOf
a Knowledge_Unit
and are not of type Core_Course
are Elective_Course
s.
For Course
I have this:
I thought maybe something on the lines of (partOf only Knowledge_unit) and not(Core_Course)
would do the trick, but it doesn't work.
Maybe it is because I need and only
with the inverse property of partOf
, but I haven't defined that property since I didn't need it for the rest. So I could say in Knowledge_Unit
that hasPart only Course
and then not(Core_Course)
on the Elective_Course
.
But I'm lost, so any help or links to examples are welcome.
The full ontology is available here
回答1:
The problem you are experiencing is due to the open world assumption in OWL and Description Logics. This means the reasoner will only infer new inferences from explicitly stated information and not from absence of information.
So to achieve your desired result you have to state that Core_Course
and Elective_Course
are disjoint. Then you can do one of two things:
(1) State for each individual that is an elective that it is of type not
(Core_Course)
. But then you could just as well state it as of type Elective_Course
.
(2) Define all your knowledge unit individuals as say core1, core2, ... coren, elective1, elective2, ..., electivek
. Then set Knowledge_Unit
equivalent to all individuals and Core_Course
to all core course individuals, i.e.
Class: Knowledge_Unit
EquivalentTo: {core1, core2, ... coren, elective1, elective2, ..., electivek}
Class: Core_Course
SubClassOf: Knowledge_Unit,
EquivalentTo: {core1, core2, ... coren}
Update: 20180510
Wrt universal property restrictions like partOf only KnowledgeUnit
, it is important to understand that it also includes individuals for which it is known that they do not take part in any partOf
relation. This can lead to entailments that can be difficult to understand. I have written about this here.
来源:https://stackoverflow.com/questions/49961407/type-inference-using-class-expresions-on-protege