| 1 | === Base Templates !CardinalityEnd1Min, !CardinalityEnd1Max, !CardinalityEnd1MinMax, !CardinalityEnd2Min, !CardinalityEnd2Max, and !CardinalityEnd2MinMax === |
| 2 | |
| 3 | Are templates for expressing cardinality constraints on relations. |
| 4 | [[br]] |
| 5 | [[br]]!CardinalityEnd1MinMax(a, b) means that a is a relation and b and c are integers, and that |
| 6 | [[br]]the first role of a has b as minimum, c as maximum cardinality. The other templates in this |
| 7 | [[br]]group follow the same pattern. |
| 8 | [[br]] |
| 9 | [[br]]!CardinalityEnd1Min |
| 10 | [[br]] |
| 11 | [[br]]Roles: |
| 12 | [[br]]1 hasRelationship !ClassOfRelationship |
| 13 | [[br]]2 valMinimumCardinality INTEGER |
| 14 | [[br]] |
| 15 | [[br]]!CardinalityEnd1Max |
| 16 | [[br]] |
| 17 | [[br]]Roles: |
| 18 | [[br]]1 hasRelationship !ClassOfRelationship |
| 19 | [[br]]2 valMaximumCardinality INTEGER |
| 20 | [[br]] |
| 21 | [[br]]!CardinalityEnd1MinMax |
| 22 | [[br]] |
| 23 | [[br]]Roles: |
| 24 | [[br]]1 hasRelationship !ClassOfRelationship |
| 25 | [[br]]2 valMinimumCardinality INTEGER |
| 26 | [[br]]3 valMaximumCardinality INTEGER |
| 27 | [[br]] |
| 28 | [[br]]!CardinalityEnd2Min |
| 29 | [[br]] |
| 30 | [[br]]Roles: |
| 31 | [[br]]1 hasRelationship !ClassOfRelationship |
| 32 | [[br]]2 valMinimumCardinality INTEGER |
| 33 | [[br]] |
| 34 | [[br]]!CardinalityEnd2Max |
| 35 | [[br]] |
| 36 | [[br]]Roles: |
| 37 | [[br]]1 hasRelationship !ClassOfRelationship |
| 38 | [[br]]2 valMaximumCardinality INTEGER |
| 39 | [[br]] |
| 40 | [[br]]!CardinalityEnd2MinMax |
| 41 | [[br]] |
| 42 | [[br]]Roles: |
| 43 | [[br]]1 hasRelationship !ClassOfRelationship |
| 44 | [[br]]2 valMinimumCardinality INTEGER |
| 45 | [[br]]3 valMaximumCardinality INTEGER |
| 46 | [[br]] |
| 47 | [[br]]Axiom: |
| 48 | [[br]] |
| 49 | {{{ |
| 50 | CardinalityEnd1Min(x1, x2) <-> |
| 51 | ClassOfRelationship(x1) & |
| 52 | INTEGER(x2) & |
| 53 | exists u(CardinalityMin(u, x2) & hasEnd1Cardinality(x1, u)) . |
| 54 | |
| 55 | }}} |
| 56 | [[br]]Axiom: |
| 57 | [[br]] |
| 58 | {{{ |
| 59 | CardinalityEnd1Max(x1, x2) <-> |
| 60 | ClassOfRelationship(x1) & |
| 61 | INTEGER(x2) & |
| 62 | exists u(CardinalityMax(u, x2) & hasEnd1Cardinality(x1, u)) . |
| 63 | |
| 64 | }}} |
| 65 | [[br]]Axiom: |
| 66 | [[br]] |
| 67 | {{{ |
| 68 | CardinalityEnd1MinMax(x1, x2, x3) <-> |
| 69 | ClassOfRelationship(x1) & |
| 70 | INTEGER(x2) & |
| 71 | INTEGER(x3) & |
| 72 | exists u(CardinalityMinMax(u, x2, x3) & |
| 73 | hasEnd1Cardinality(x1, u)) . |
| 74 | |
| 75 | }}} |
| 76 | [[br]]Axiom: |
| 77 | [[br]] |
| 78 | {{{ |
| 79 | CardinalityEnd2Min(x1, x2) <-> |
| 80 | ClassOfRelationship(x1) & |
| 81 | INTEGER(x2) & |
| 82 | exists u(CardinalityMin(u, x2)& |
| 83 | hasEnd2Cardinality(x1, u)) . |
| 84 | |
| 85 | }}} |
| 86 | [[br]]Axiom: |
| 87 | [[br]] |
| 88 | {{{ |
| 89 | CardinalityEnd2Max(x1, x2) <-> |
| 90 | ClassOfRelationship(x1) & |
| 91 | INTEGER(x2) & |
| 92 | exists u(CardinalityMax(u, x2)& |
| 93 | hasEnd2Cardinality(x1, u)) . |
| 94 | |
| 95 | }}} |
| 96 | [[br]]Axiom: |
| 97 | [[br]] |
| 98 | {{{ |
| 99 | CardinalityEnd2MinMax(x1, x2, x3) <-> |
| 100 | ClassOfRelationship(x1) & |
| 101 | INTEGER(x2) & |
| 102 | INTEGER(x3) & |
| 103 | exists u(CardinalityMinMax(u, x2, x3)& |
| 104 | hasEnd2Cardinality(x1, u)) . |
| 105 | |
| 106 | }}} |
| 107 | [[br]]NOTE For unlimited minimum or maximum cardinalities, assign the values 0 and * cardinality, |
| 108 | [[br]]respectively. See the definitions of templates !CardinalityMin, etc., above. |
| 109 | [[br]] |
| 110 | [[br]]NOTE What constitutes the first and second roles of a relation is stated in the table of prototemplates |
| 111 | [[br]](D.1, page 103). |
| 112 | [[br]] |
| 113 | [[br]]NOTE Let R be a relation to which a cardinality n1 : m1 is assigned to the first role, and a cardinality |
| 114 | [[br]]n2 : m2 to the second. This means that (1) each instance of the first role is R-related to at least |
| 115 | [[br]]n2 and at most m2 distinct instances of the second role, and (2) each instance of the second role is |
| 116 | [[br]]related to at least n1 and at most m1 distinct instances of the first role. |
| 117 | [[br]] |
| 118 | [[br]]EXAMPLE The statement !CardinalityEnd1MinMax(6 M8 bolt assembly, 6, 6) is suitable for expressing |
| 119 | [[br]]an example of a constraint given in ISO 15926-2, clause 4.10.3, that “[t]he |
| 120 | [[br]]class_of_relationship_with_signature ‘6 M8 bolt assembly’ has a cardinality such that each ‘6 of |
| 121 | [[br]]M8 bolts’ is linked by exactly 6 relationships to different M8 bolts at all times”. The expansion of |
| 122 | [[br]]this statement is shown in the following diagram. |
| 123 | [[br]] |