=== Base Templates !CardinalityEnd1Min, !CardinalityEnd1Max, !CardinalityEnd1MinMax, !CardinalityEnd2Min, !CardinalityEnd2Max, and !CardinalityEnd2MinMax === Are templates for expressing cardinality constraints on relations. [[br]] [[br]]!CardinalityEnd1MinMax(a, b) means that a is a relation and b and c are integers, and that [[br]]the first role of a has b as minimum, c as maximum cardinality. The other templates in this [[br]]group follow the same pattern. [[br]] [[br]]!CardinalityEnd1Min [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMinimumCardinality INTEGER [[br]] [[br]]!CardinalityEnd1Max [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMaximumCardinality INTEGER [[br]] [[br]]!CardinalityEnd1MinMax [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMinimumCardinality INTEGER [[br]]3 valMaximumCardinality INTEGER [[br]] [[br]]!CardinalityEnd2Min [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMinimumCardinality INTEGER [[br]] [[br]]!CardinalityEnd2Max [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMaximumCardinality INTEGER [[br]] [[br]]!CardinalityEnd2MinMax [[br]] [[br]]Roles: [[br]]1 hasRelationship !ClassOfRelationship [[br]]2 valMinimumCardinality INTEGER [[br]]3 valMaximumCardinality INTEGER [[br]] [[br]]Axiom: [[br]] {{{ CardinalityEnd1Min(x1, x2) <-> ClassOfRelationship(x1) & INTEGER(x2) & exists u(CardinalityMin(u, x2) & hasEnd1Cardinality(x1, u)) . }}} [[br]]Axiom: [[br]] {{{ CardinalityEnd1Max(x1, x2) <-> ClassOfRelationship(x1) & INTEGER(x2) & exists u(CardinalityMax(u, x2) & hasEnd1Cardinality(x1, u)) . }}} [[br]]Axiom: [[br]] {{{ CardinalityEnd1MinMax(x1, x2, x3) <-> ClassOfRelationship(x1) & INTEGER(x2) & INTEGER(x3) & exists u(CardinalityMinMax(u, x2, x3) & hasEnd1Cardinality(x1, u)) . }}} [[br]]Axiom: [[br]] {{{ CardinalityEnd2Min(x1, x2) <-> ClassOfRelationship(x1) & INTEGER(x2) & exists u(CardinalityMin(u, x2)& hasEnd2Cardinality(x1, u)) . }}} [[br]]Axiom: [[br]] {{{ CardinalityEnd2Max(x1, x2) <-> ClassOfRelationship(x1) & INTEGER(x2) & exists u(CardinalityMax(u, x2)& hasEnd2Cardinality(x1, u)) . }}} [[br]]Axiom: [[br]] {{{ CardinalityEnd2MinMax(x1, x2, x3) <-> ClassOfRelationship(x1) & INTEGER(x2) & INTEGER(x3) & exists u(CardinalityMinMax(u, x2, x3)& hasEnd2Cardinality(x1, u)) . }}} [[br]]NOTE For unlimited minimum or maximum cardinalities, assign the values 0 and * cardinality, [[br]]respectively. See the definitions of templates !CardinalityMin, etc., above. [[br]] [[br]]NOTE What constitutes the first and second roles of a relation is stated in the table of prototemplates [[br]](D.1, page 103). [[br]] [[br]]NOTE Let R be a relation to which a cardinality n1 : m1 is assigned to the first role, and a cardinality [[br]]n2 : m2 to the second. This means that (1) each instance of the first role is R-related to at least [[br]]n2 and at most m2 distinct instances of the second role, and (2) each instance of the second role is [[br]]related to at least n1 and at most m1 distinct instances of the first role. [[br]] [[br]]EXAMPLE The statement !CardinalityEnd1MinMax(6 M8 bolt assembly, 6, 6) is suitable for expressing [[br]]an example of a constraint given in ISO 15926-2, clause 4.10.3, that “[t]he [[br]]class_of_relationship_with_signature ‘6 M8 bolt assembly’ has a cardinality such that each ‘6 of [[br]]M8 bolts’ is linked by exactly 6 relationships to different M8 bolts at all times”. The expansion of [[br]]this statement is shown in the following diagram. [[br]]