A co-occurrence constraint specifies the minimum and maximum number of times an object or combination of objects can co-occur in the relationships of a relationship set with another object or combination of objects.
Notationally, we write co-occurrence constraints by listing one or more object class names on the left and right of a right-pointing arrow and by providing a list of min:max pairs above the arrow. In an ORM, we place a co-occurrence constraint close to the relationship set to which it applies.
For instance:
Figure 1. Sample co-occurrence constraints
This example means that each triple object student, course and semester in respective object class Student, Course and
Semester can have one and only one grade in object class Grade. If the minimum and maximum numbers above
the arrow are all 1s, then this is the same as generalized Functional Dependency.
To properly form co-occurrence constraints, several restrictions must be observed:
Here is a
short quiz so you can test your understanding of co-occurrence constraints.
Go to the
Go to
OSA Tutorial
ORM
Constraints
Participation Constraints
Object-class Cardinality Constraints