{irreflexive}
+reviews
+managers0..n
Employee
0..n
1
+reviewed by
{asymmetric}
Employee
+managed by
Figure 7. Notation for irreflexive and asymmetric
constraints on reflexive associations
+rbA
+ra
R{acyclic}
Figure 8. Reflexive relationship with acyclic constraint
The following OCL expression captures disjoint const-raint between subclasses B and C of super class A:
context A
inv: B Æ forAll(b:B|
C Æ forAll(c:C|b.self<>c.self))
int}
UML does not provide built-in constraints for ref-lexive associations, except possibility to specify them as textual constraints in chosen language. As in other cases, for graphical notation we add corresponding tags to reflexive association relationships (Figure 7): “Irreflexive“, “Asymmetric“, “Acyclic“, “Intransi-tive“, “Symmetric“, and “Antisymmetric“. Before de-fining OCL expression for acyclic constraint on refle-xive relationship (the general case is represented in Figure 8) we have to introduce the transitive closure operation 0:
6. Integrity constraints on sets of objects
Equality constraint is used for groups of optional relationships or attributes. If used between two or more relationships it specifies equal dependency bet-ween them. This means that if class instance partici-pates in one relation, so it must participate in all other relationships constrained by this constraint; instances participating only in one relation could not exist 0, 0, 0, 0, 0. Analogously, equality constraint between attributes indicates that if one of attributes has value other attributes constrained by this constraint also must do so. UML specifies equality constraint as textual constraint in a note for class. Figure 9 presents suggested extension of UML graphical notation for equality constraints. Tagged value {equn} is proposed to mark optional attributes or relationships constrained by equality constraint. Equality constraint on group of optional attributes c1,…, cn of object type A can be defined by OCL expression:
context A
Figure 6. Notation for integrity constraints on generalization
relationship
Reflexive associations often have constraints. There are six types of constraints for reflexive rela-tionship analyzed in 0 (where they are named as “ring constraints”):
“Irreflexive” constraint prevents an instance from participating on both sides of a relationship at the same time, i.e., any instance of class A cannot have association with itself. “Asymmetric” constraint
Abstract. Integrity constraints are incident part of conceptual models, including part of semantics of problem domain. Analysis of the most important methods of conceptual modelling has revealed that none of them analyze the complete set of integrity const
Representation of Integrity Constraints in Conceptual Models inv: (self.c1.isUndefined() implies self.c2.isUndefined() … and self.ci.isUndefined() … and .isUndefined())) and
(self.c2.isUndefined() implies self.c1.isUndefined() and Self.c3.isUndefined() … and self.ci.isUndefined() … and .isUndefined()) … and
(self.ci.isUndefined() implies self.c1.isUndefined() and
Self.ci-1.isUndefined() … and self.ci+1.isUndefined() … and .isUndefined()) … and
(.isUndefined() implies self.c1.isUndefined() and self.ci.isUndefined() … and -1.isUndefined()) or
<<subset>>
(not(self.c1.isUndefined()) implies not(self.c2.isUndefined()) … and not(self.ci.isUndefined()) … and not(.isUndefined())) and
(not(self.c2.isUndefined()) implies not(self.c1.isUndefined()) and not(self.c3.isUndefined()) … and not(self.ci.isUndefined()) … and not(.isUndefined())) … and
(not(self.ci.isUndefined()) implies not(self.c1.isUndefined()) and not(self.ci-1.isUndefined()) …and not(self.ci+1.isUndefined()) …and not(.isUndefined())) … and
(not(.isUndefined()) implies (not(self.c1.isUndefined()) and not(self.ci.isUndefined()) …and not(-1.isUndefined()))
Employee
firstName{subset1}lastName{set1}address[0..1]{equ1}countryCode{R1}{equ1}personalCode{I1;EU1}passportNo[0..1]{D1}
socialSecurityNo[0..1]{D1}sex
birthday/age
+performerR2+performs1
Task
0..nname
{OR}
performer{R2}
+inspector+inspectsinspector{R3}
0..n1R3
Figure 9. Example of notation of integrity constraints on set of objects
Subset constraint between two relationships indi-cates that set of class instances participating in both
relationships is subset of class instances participating in one relationship 0, 0, 0, 0, 0. In other words, an instance of class must participate in one relationship before it can participate in another relationship. Analogously subset constraint can be defined on optional attributes. UML allows to specify subset constraints between associations by attaching the tagged value "{subset}" to the dependency arrow bet-ween the associations 0, 0 (for unification of representation, we rename “constraint label” used in original source with value of tag, defined by stereo-type of constrained element). Direction of the arrow is from subset to set. However UML does not provide a graphic notation for subset constraints defined by attributes. To present these subset constraints graphi-cally we introduce reflexive dependency for class with tag {subset} and tagged values {setn}/{subsetn} for attributes (groups of attributes) defining subset constraint on set of instances (Fig. 9). Let have object A with subset constraint on attributes v1,…,vn mar-ked with tag {subsetn} and p1,…, p2 marked with tag {setn}. This means that the set of object A