Cardinality and Conformance
The cardinality and conformance rules for conformance constraints in IGs (and entry into Trifolia) have certain rules that need to be followed. The information below uses the new cardinality syntax adopted in 2012.
Conformance Verb |
Cadinality |
Result |
Schematron Result |
SHALL |
m..n, where m > 1 and n ≥ m Forms 1..1 1..* 1..some number |
the element or attribute must be present at least m and no more than n times |
If the context node a is present, and the specified node b is absent, or is present more than n times, validation ought to yield an error message. The lower bound of 1 indicates to the human reader that absence is an absolute error. |
SHOULD |
0 .. n, where n ≥ 0 Forms 0..1 0..* 0..some number |
the element or attribute should be present at least 1 times and no more than n times |
If the context node is present, and the specified node is absent, or is present more than n times, validation ought to yield a warning message. The lower bound of 0 indicates to the human reader that absence is not an absolute error. |
MAY |
0 .. n, where n ≥ 0 Forms 0..1 0..* 0..some number |
the element or attribute may be present at least 1 times and no more than n times |
If the context node is present, and the specified node is absent, validation ought to yield no messages. If the context node is present, and the occurrences of the specified node are greater than n, ...? The lower bound of 0 indicates to the human reader that absence is not an absolute error. |
SHALL NOT |
0..0 |
the element or attribute is not allowed |
If the context node is present, and the specified node is present, validation ought to yield an error message. |
SHOULD NOT |
0..0 |
the element or attribute should not be present, but may be |
If the context node is present, and the specified node is present, validation ought to yield a warning message. |
Examples1
Scenario
An observation template has the constraint SHALL 1..1 effectiveTime
Result
When the context node is present (the observation) and effectiveTime is not present in the context node, validation will produce an error message.
Scenario
A "SHOULD effectiveTime" has the constraint "SHALL 1..1 high"
Result
When the context node is present (the effectiveTime), and high is not present within the context node, validation ought to produce an error message.
Note: isBranch constraints cannot be evaluated line by line as above. At least for SHALL constraints they must be evaluated as a whole.
Scenario
isBranch SHALL in the form "SHOULD 0..1 effectiveTime such that it SHALL 1..1 high"
Result
The parent of this branch/slice ought to throw an error if it contains no effectiveTime/high.
Other effectiveTime elements that contain no high element are not precluded by this constraint.