Database Reference
In-Depth Information
Figure 10: Constraint orthogonality
In the metamodel fragment of Figure 9, role occurrences are used for constraints that
may potentially involve a conceptual join. A conceptual join occurs when passing through
an object type while navigating a conceptual schema. The join requires that the object play-
ing the entry role to the object type is the same object playing the exit role when leaving
the object type, and may be an inner or outer join. Join constraints in ORM apply to role
projections over paths that may involve one or more conceptual joins, and special care is
needed to disambiguate the role paths, as discussed by Halpin (2002).
ORM constraints are orthogonal, both semantically and syntactically, making it easier to
master the constraint language. For example, Figure 10(a) shows a simple exclusion constraint
(circled “X”), indicating that nobody can be allocated both a bus pass and a parking bay (and
they might be allocated neither). Figure 10(b) shows an inclusive-or constraint (circled dot),
indicating that each employee must have a social security number or a passport number (or
perhaps both). Figure 10(c) shows an exclusive-or constraint, (circled dot superimposed on
X) obtained by orthogonally combining an inclusive-or constraint with a simple exclusion
constraint, indicating that each line item must be for a product or a service but not both. In
each of these three cases, the individual roles are clearly optional.
Contrast this with the Barker ER notation for exclusive arcs in Figure 3, where the
optional roles in the xor constraint on line item appear mandatory (solid line) if taken
individually. The Barker notation is not context-free, since a solid line for a role means dif-
ferent things in different contexts. This lack of orthogonality makes the notation harder to
understand. A similar comment applies to IE. Moreover, neither Barker ER nor IE supports
the concept of an inclusive-or constraint at all—in fact, their choice of notation for xor
prevents an intuitive extension to their constraint language for this case.
As another example of orthogonality, ORM constraints may be applied wherever they
make sense. For example, the notion of mutual exclusion applies between compatible roles,
or between compatible role-pairs, etc. As a simple example, Figure 10(d) shows an exclusion
constraint between Person-Book pairs (nobody who wrote a topic may review that same
topic). Although the exclusive arc in Barker ER does enable a simple exclusion constraint
Search WWH ::




Custom Search