Reputation: 4481
I'm trying to develop an ontology to represent a curricula, and in this curricula a student must take 6 elective courses (and has a long list of courses from which to choose).
Right now I have this classes:
- Course
--- Elective (defined class by isElective = true && type = Course)
And all my possible elective courses are instances of the type Course
with the data property isElective
set to true.
But I want to represent that this 6 elective courses must be taken in a certain way, for instance, a student needs to take 4 of this courses on the last year (Year
is a class) of the curricula.
I have been thinking of how to define this placeholder/abstract class, which as I have read isn't possible and doesn't make sense, and came across punning but I don't know if it is what I'm looking for.
Let's say I define a subclass of Course
called ElectivePlaceholder
, and then then 4 instances of this class where:
ElectiveX instanceOf ElectivePlaceholder
Year5 instanceOf Year
ElectiveX isPartOf Year5
Then I want to have a way to represent that a student choose to take AdvancedMaths
(instance of Elective
, aka instance of Course
with isElective
set to true) as it's ElectiveX
.
How would I do that? Would punning be useful? Since it allows an object to treated as both a class and an individual.
Update
What I'm trying to model is not what a student chooses but the curricula itself.
Each curricula individual has different requirements as to how many elective courses the students must undertake and in which years. I need to represent this in a way either on the Curricula
individual or the Year
individual (so it can be inferred for the Curricula
).
Right now:
YearX partOf CurriculaX
Upvotes: 0
Views: 255
Reputation: 4787
Punning will not solve your problem. Punning allows you to refer to say Course
as both an OWL class and an OWL individual.
You can achieve your desired result by defining your ontology as follows:
ObjectProperty: hasCourse
Domain: Curricula
Range: Course
Class: Curricula
SubClassOf:
taughtInYear some xsd:integer,
hasCourse some Course
Class: CurriculaDifficult
SubClassOf:
Curricula,
hasCourse min 4 ElectiveCourse,
hasCourse max 9 Course
Class: CurriculaEasy
SubClassOf:
Curricula,
hasCourse min 1 ElectiveCourse,
hasCourse max 3 Course
Class: ElectiveCourse
SubClassOf: Course
DisjointWith: NonElectiveCourse
Class: NonElectiveCourse
SubClassOf: Course
DisjointWith: ElectiveCourse
Class: Course
Individual: AdvancedMaths
Types: ElectiveCourse
Individual: curriculaEasy2018
Types: CurriculaEasy
Facts:
taughtInYear 2018,
hasCourse someCourseA,
hasCourse someCourseB,
hasCourse someElectiveCourseA
Class Student:
SubClassOf: takeCurricula some Curricula
Individual: student123
Types: Student
Facts:
takeCurricula curriculaEasy2018
A couple of things to note are:
(1) Abstract classes (that are well regarded programming concepts) cannot be represented in OWL. I explain some surprising things that OWL lacks coming from a programming background here.
(2) Rather than having isElective
as a property that you associate with a Course
it is better to model it as ElectiveCourse
versus NonElectiveCourse
that are disjoint. Reason being that if you ever want to extend the definition of NonElectiveCourse
you can do that. This is also in coding the reason why it is best to avoid flags.
(3) You have to close your Curricula
in some way by stating what the maximum number of courses are otherwise, due to the open world assumption, the reasoner will have no way to know that you have not specified at least 4 ElectiveCourse
s. I have written about this here.
** UPDATE **
So you can add CurruculaEasy
and CurruculaDifficult
classes with different numbers of requirements for electives as shown above. You can add a Curricula
that is the super class of CurruculaEasy
and CurriculaDifficult
. For Curricula
you add that it subclasses taughtInYear some xsd:integer
as shown above.
Upvotes: 2