From 1886e33d93eb1c5a6809353ec52ac0fe5b6f85cc Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Fri, 18 Aug 2023 12:16:23 -0400 Subject: [PATCH 01/20] Update allowed-values overview As part of usnistgov/metaschema#411, use IETF BCP-14 languages as used with other parts of the specification. Change the wording to address how implementers would follow constraint directives in their processor, and align example to be like computer model themes with tutorials and other documentation. --- .../specification/syntax/constraints.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index e20806adc..da8a05632 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -14,27 +14,25 @@ TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 ## Enumerated values -Additionally, flags may be constrained to a set of known values listed in advance. +One kind of Metaschema constraint is restricting assembly, field, or flag value(s) with `allowed-values` enumerations. Metaschema processors MUST process `allowed-values` enumerations as defined with the `allow-other` attribute. -This restriction can be either: +1. When the `allow-other` attribute is defined as `allow-other="no"`, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). +2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MUST loosely validate content instances with enumerations: both `enum` values and other values are valid. +3. When the `allow-other` attribute is not explicitly defined, the Metaschema processor MUST strictly validate content instances. The implied default is `allow-other="no"`. -1. strict (values must be in the list for document validity with `allow-other="no"` attribute for an `allowed-values` element) or -2. loose (i.e. for documentation only, no effect in schemas, with `allow-other="yes"`). - -If an `allowed-values` constraint does not have the `allow-other` attribute defined, the default is `allow-other="no"`, resulting in strict validation where the only valid values are those in the list. - -Within `allowed-values` of a `constraint`, an `enum` element's `@value` attribute assigns the permissible value, while its data content provides documentation. For example: +Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. ```xml - - Hash algorithm - Method by which a hash is derived + + Computer Form Factor + The type of computer in the example application's data model. - Documentation for one permissible option. - Documentation for another permissible option. + this text value documents the domain and information model's meaning of a laptop + this text value documents the domain and information model's meaning of a desktop - ... + ... + ``` ## `define-flag` constraints From efad9163666a68672ab0f10b4f1941a9f91b180f Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 22 Aug 2023 15:03:07 -0400 Subject: [PATCH 02/20] Correct poorly worded assembly constraint explanation. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index da8a05632..b00f84ded 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -14,7 +14,9 @@ TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 ## Enumerated values -One kind of Metaschema constraint is restricting assembly, field, or flag value(s) with `allowed-values` enumerations. Metaschema processors MUST process `allowed-values` enumerations as defined with the `allow-other` attribute. +One kind of Metaschema constraint is restricting field, or flag value(s) with `allowed-values` enumerations. Metaschema processors MUST process `allowed-values` enumerations. + +For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: 1. When the `allow-other` attribute is defined as `allow-other="no"`, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). 2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MUST loosely validate content instances with enumerations: both `enum` values and other values are valid. From 98aa212725e29cc312833e649a6bafad70cbc65a Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 23 Aug 2023 10:44:01 -0400 Subject: [PATCH 03/20] Per PR feedback, integrate allow-other bullet 3 into 1. --- website/content/specification/syntax/constraints.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index b00f84ded..2008c5f3b 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -18,9 +18,8 @@ One kind of Metaschema constraint is restricting field, or flag value(s) with `a For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: -1. When the `allow-other` attribute is defined as `allow-other="no"`, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). +1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). 2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MUST loosely validate content instances with enumerations: both `enum` values and other values are valid. -3. When the `allow-other` attribute is not explicitly defined, the Metaschema processor MUST strictly validate content instances. The implied default is `allow-other="no"`. Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. From 049664b783ed0e167e426004766cd25dca452a7b Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 23 Aug 2023 12:21:17 -0400 Subject: [PATCH 04/20] Take Dave's suggestion to make L24 sentence informational. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 2008c5f3b..27fccd85e 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -21,7 +21,9 @@ For an `allowed-values` enumeration, the following applies for the `allow-other` 1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). 2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MUST loosely validate content instances with enumerations: both `enum` values and other values are valid. -Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. +Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. + +A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. ```xml From 797f794e1658e4bc90c5e254ade6def939889ef3 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 23 Aug 2023 12:36:05 -0400 Subject: [PATCH 05/20] Tighten up definition of what loose (vs strict) is for constraints. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 27fccd85e..2148b8404 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -19,7 +19,7 @@ One kind of Metaschema constraint is restricting field, or flag value(s) with `a For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: 1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). -2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MUST loosely validate content instances with enumerations: both `enum` values and other values are valid. +2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MAY loosely validate content instances with enumerations. A validation warning MAY be raised for any value that does not match an enumerated value. Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. From 23a6dcdb2775222b5b3664b0f85ade20d646fe46 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 30 Aug 2023 01:27:17 -0400 Subject: [PATCH 06/20] Add suggestion for better informational constraint description Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 2148b8404..e82569d29 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -14,7 +14,9 @@ TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 ## Enumerated values -One kind of Metaschema constraint is restricting field, or flag value(s) with `allowed-values` enumerations. Metaschema processors MUST process `allowed-values` enumerations. +The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. + +Metaschema processors MUST process `allowed-values` enumerations. For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: From fcef640a4e10737de861fdf878852e6f5aa25fba Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 30 Aug 2023 01:27:42 -0400 Subject: [PATCH 07/20] Add terminology description first. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index e82569d29..31894a2ed 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -18,6 +18,11 @@ The `allowed-values` constraint is a kind of Metaschema constraint that restrict Metaschema processors MUST process `allowed-values` enumerations. +Value restriction can be either strict or loose. + +- strict: only defined `enum` values are valid for the given target(s) +- loose: both `enum` values and other values are valid + For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: 1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). From d30d744b65826b24ec455c6582c5baaeaf7be9a2 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Wed, 30 Aug 2023 01:28:09 -0400 Subject: [PATCH 08/20] Add MUST requirement for validation error. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 31894a2ed..8336c6873 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -25,7 +25,7 @@ Value restriction can be either strict or loose. For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: -1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations: only defined `enum` values are valid for the given target(s). +1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations. A validation error MUST be raised for any value that does not match an enumerated value. 2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MAY loosely validate content instances with enumerations. A validation warning MAY be raised for any value that does not match an enumerated value. Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. From e194de99ccbc77794e69902a20cd7c42c833f55c Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Thu, 31 Aug 2023 12:16:58 -0400 Subject: [PATCH 09/20] Add more comprehensive treatment of allowed-values Flesh out earlier draft with detailed coverage of allowed-values constraints and semantics. Define `@allow-other` and `@extension` attributes. Co-authored-by: David Waltermire --- .../specification/syntax/constraints.md | 59 +++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 8336c6873..c70587db3 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -23,12 +23,63 @@ Value restriction can be either strict or loose. - strict: only defined `enum` values are valid for the given target(s) - loose: both `enum` values and other values are valid -For an `allowed-values` enumeration, the following applies for the `allow-other` attribute: +### `` -1. When the `allow-other` attribute is defined as `allow-other="no"` or not explicitly defined, the processor MUST strictly validate content instances with enumerations. A validation error MUST be raised for any value that does not match an enumerated value. -2. When the `allow-other` attribute is defined as `allow-other="yes"`, the processor MAY loosely validate content instances with enumerations. A validation warning MAY be raised for any value that does not match an enumerated value. +The `@target` attribute of an `` constraint is used to determine the specific content values the constraint applies to. By evaluating the `@target`, it is possible to identify the *target set* of `` constraints targeting a given value. -Within `allowed-values` of a `constraint`, a Metaschema processor MUST strictly or loosely validate `enum` values with the `@value` attribute. +The *source* of each allowed `` constraint in the *target set* is identified as one of the following sources: + +- **model:** The constraint is defined *in* a Metaschema module. +- **external:** The constraint is defined *outside* a Metaschema module, e.g. external constraints. + +The *target set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. + +Once the *target set* of `` constraints is validated, the `@allow-other` attribute is used to determine the *expected value set* for a given content value. + +The following subsections detail the processing requirements for the `@extension` and `@allow-other` attributes. + +#### `@extension` + +For each `` constraint, the `@extension` attribute MUST be one of the following values. + +- **`none`:** There can be no other matching `` constraint for the same target value. This is the least permissive option. + +- **`model`:** (default) Multiple matching `` constraints are allowed for the same target value as long as the constraints are defined in the same model. Constraints sourced from outside the model are not allowed. + + All allowed-values constraints declared within a Metaschema model matching the same @target can be combined. If a matching constraint within the model has allow-other="no", then constraints declared externally from the model are not allowed. **This is the implicit default value if no `@extension` is provided.** + +- **`external`:** Multiple matching `` constraints are allowed for the same target value, which can be sourced from within the model or externally through a set of external constraints. + + All allowed-values constraints, declared within the model and externally through an extension, that match the same @target can be combined. This is the most permissive option. + +One of the following requirements MUST apply when processing a value's *target set* to validate it. + +1. The *target set* MUST contain a single `` constraint with the `@extension` attribute value `none`. +1. All `` constraints in the *target set* MUST have the `@extension` attribute value `model` and originate from a *model* source. +1. All `` constraints in the *target set* MUST have the `@extension` attribute value `external` and originate from either a *model* or *extension* source. +1. An error MUST be raised indicating the *target set* is invalid. + +#### `@allow-other` + +The *expected value set* can be considered *open* or *closed*. + +- **open:** In an open set, the actual value can be any value. The *expected value set* provides suggested values. +- **closed:** In a closed set, the actual value is expected to match a value in the *expected value set*. + +For each `` constraint, the `@allow-other` attribute MUST be one of the following values. + +- **`yes`:** Identifies the *expected value set* as *open*, as long as no other `` constraint in the *target set* has `@allow-other="no"` declared explicitly or implicitly. +- **`no`:** (default) Identifies the *expected value set* as *closed*. **This is the implicit default value if no `@allow-other` is provided.** + +One of the following requirements MUST apply when processing the a value's *target set* to determine the *expected value set*. + +1. One `` constraint in the *target set* MUST have the `@allow-other` attribute value `no`. The *expected value set* is *closed*. + + The actual value MUST match one of the enumerated values declared on any of the `` constraints in the *target set**target set*. An error MUST be produced to indicate that the value doesn't match one of the enumerated values. + +2. All `` constraints in the *target set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. + + Any type appropriate actual value MUST be allowed. A warning MAY be produced to indicate that the value doesn't match one of the enumerated values. A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. From cee26fd673ff48dfc204a085e28d6a1ebb25f217 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Thu, 31 Aug 2023 13:00:29 -0400 Subject: [PATCH 10/20] Remove leftover strict or loose wording. Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index c70587db3..a129db696 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -18,7 +18,6 @@ The `allowed-values` constraint is a kind of Metaschema constraint that restrict Metaschema processors MUST process `allowed-values` enumerations. -Value restriction can be either strict or loose. - strict: only defined `enum` values are valid for the given target(s) - loose: both `enum` values and other values are valid From 63ed30d9e3f24f010d9d14f157e7fc09d876b5c7 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Thu, 31 Aug 2023 13:02:08 -0400 Subject: [PATCH 11/20] Apply missed suggestions from draft sync Co-authored-by: David Waltermire --- website/content/specification/syntax/constraints.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index a129db696..7e856dea4 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -18,12 +18,6 @@ The `allowed-values` constraint is a kind of Metaschema constraint that restrict Metaschema processors MUST process `allowed-values` enumerations. - -- strict: only defined `enum` values are valid for the given target(s) -- loose: both `enum` values and other values are valid - -### `` - The `@target` attribute of an `` constraint is used to determine the specific content values the constraint applies to. By evaluating the `@target`, it is possible to identify the *target set* of `` constraints targeting a given value. The *source* of each allowed `` constraint in the *target set* is identified as one of the following sources: @@ -37,7 +31,7 @@ Once the *target set* of `` constraints is validated, the `@allo The following subsections detail the processing requirements for the `@extension` and `@allow-other` attributes. -#### `@extension` +### `@extension` For each `` constraint, the `@extension` attribute MUST be one of the following values. @@ -58,7 +52,7 @@ One of the following requirements MUST apply when processing a value's *target s 1. All `` constraints in the *target set* MUST have the `@extension` attribute value `external` and originate from either a *model* or *extension* source. 1. An error MUST be raised indicating the *target set* is invalid. -#### `@allow-other` +### `@allow-other` The *expected value set* can be considered *open* or *closed*. From 7d80a92fd96c9b3b10d9da7fa5c1a717aafd0ab3 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 5 Sep 2023 13:58:58 -0400 Subject: [PATCH 12/20] Hyphenate type-appropriate, per PR review. Co-authored-by: Wendell Piez --- website/content/specification/syntax/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 7e856dea4..e16d7f516 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -72,7 +72,7 @@ One of the following requirements MUST apply when processing the a value's *targ 2. All `` constraints in the *target set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. - Any type appropriate actual value MUST be allowed. A warning MAY be produced to indicate that the value doesn't match one of the enumerated values. + Any type-appropriate actual value MUST be allowed. A warning MAY be produced to indicate that the value doesn't match one of the enumerated values. A Metaschema processor MAY use the text value of the `enum`'s XML element as documentation for a given allowed value enumeration. Below is an example. From d5084319131f61eb4595ae9a693bbeab0ca9690a Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 5 Sep 2023 14:02:36 -0400 Subject: [PATCH 13/20] Edit target to targeting set, per PR review. Co-authored-by: Wendell Piez --- website/content/specification/syntax/constraints.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index e16d7f516..7e97430dd 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -18,7 +18,7 @@ The `allowed-values` constraint is a kind of Metaschema constraint that restrict Metaschema processors MUST process `allowed-values` enumerations. -The `@target` attribute of an `` constraint is used to determine the specific content values the constraint applies to. By evaluating the `@target`, it is possible to identify the *target set* of `` constraints targeting a given value. +The `@target` attribute of an `` constraint is used to determine the specific content values the constraint applies to. For any given value or node, it is possible to identify the *targeting set* of `` constraints based on their `@target` attributes. If the value or node among is among those being targeted, the constraint is a member of its targeting set. The *source* of each allowed `` constraint in the *target set* is identified as one of the following sources: @@ -27,7 +27,7 @@ The *source* of each allowed `` constraint in the *target set* i The *target set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. -Once the *target set* of `` constraints is validated, the `@allow-other` attribute is used to determine the *expected value set* for a given content value. +Once the *targeting set* of `` constraints is determined, their respective `@allow-other` attributes are used to determine the *expected value set* for a given content value. The following subsections detail the processing requirements for the `@extension` and `@allow-other` attributes. @@ -64,13 +64,13 @@ For each `` constraint, the `@allow-other` attribute MUST be one - **`yes`:** Identifies the *expected value set* as *open*, as long as no other `` constraint in the *target set* has `@allow-other="no"` declared explicitly or implicitly. - **`no`:** (default) Identifies the *expected value set* as *closed*. **This is the implicit default value if no `@allow-other` is provided.** -One of the following requirements MUST apply when processing the a value's *target set* to determine the *expected value set*. +One of the following requirements MUST apply when processing a value's *targeting set* of `` constraints to determine the *expected value set*. 1. One `` constraint in the *target set* MUST have the `@allow-other` attribute value `no`. The *expected value set* is *closed*. - The actual value MUST match one of the enumerated values declared on any of the `` constraints in the *target set**target set*. An error MUST be produced to indicate that the value doesn't match one of the enumerated values. + The actual value MUST match one of the enumerated values declared on any of the `` constraints in the *targeting set*. An error MUST be produced to indicate that the value doesn't match one of the enumerated values. -2. All `` constraints in the *target set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. +2. All `` constraints in the *targeting set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. Any type-appropriate actual value MUST be allowed. A warning MAY be produced to indicate that the value doesn't match one of the enumerated values. From b2bafddfc97ebcd524eb24cd6ac0059db56e6abb Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Mon, 16 Oct 2023 17:23:28 -0400 Subject: [PATCH 14/20] Add `@id`, `@level`, and `@target` for #411. --- .../content/specification/syntax/constraints.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 7e97430dd..8dbaaa32e 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -12,6 +12,20 @@ TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 ## Common Constraint Data +Metaschema modules can define different kinds of constraints to support data validation, inter-documenting indices, and intra-document indices. Below are constraint data that modules may include within any of those different constraint types. + +### `@id` + +A constraint MAY have an OPTIONAL `@id` attribute so Metaschema processors MAY identify use the identifier for processing constraints and/or referencing them in output for later analysis. + +### `@level` + +A constraint MAY have an OPTIONAL `@level` attribute so Metaschema processors MAY perform conditional processing and/or presentation of constraint violations based on the value of applicable constraints for a document. If defined, a `@level` MUST have a value of either `INFORMATIONAL`, `WARNING`, `ERROR`, or `CRITICAL`. + +### `@target` + +A constraint MAY have a `@target`. A `@target` value is a valid a Metapath expression. In a document conforming to a Metaschema module, a Metaschema processor MUST process the constraint to any path in that model definition that matches the given Metapath expression. If a `@target` value is not defined, a Metaschema processor must process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). For [assemblies](#define-assembly-constraints), a Metaschema processor MUST NOT process any constraint within its `model` with a value of `target="."`. + ## Enumerated values The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. From 0169854205b4745b5c89d24311f6bef86d631b85 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 17 Oct 2023 11:43:55 -0400 Subject: [PATCH 15/20] Adjust `@id` and `@level` wording per PR feedback. --- website/content/specification/syntax/constraints.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 8dbaaa32e..2e95d9a09 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -16,16 +16,20 @@ Metaschema modules can define different kinds of constraints to support data val ### `@id` -A constraint MAY have an OPTIONAL `@id` attribute so Metaschema processors MAY identify use the identifier for processing constraints and/or referencing them in output for later analysis. +A constraint MAY have an OPTIONAL `@id` attribute, which provides an identifier for the constraint. Metaschema processors MAY use the identifier for processing constraints and/or referencing them in output for later analysis. ### `@level` -A constraint MAY have an OPTIONAL `@level` attribute so Metaschema processors MAY perform conditional processing and/or presentation of constraint violations based on the value of applicable constraints for a document. If defined, a `@level` MUST have a value of either `INFORMATIONAL`, `WARNING`, `ERROR`, or `CRITICAL`. +A constraint MAY have an OPTIONAL `@level` attribute, which identifies the severity level of a violation of the constraint. If defined, a `@level` MUST have a value of either: `INFORMATIONAL`, `WARNING`, `ERROR`, or `CRITICAL`. Metaschema processors MAY perform conditional processing and/or presentation of constraint violations based on the level value. ### `@target` A constraint MAY have a `@target`. A `@target` value is a valid a Metapath expression. In a document conforming to a Metaschema module, a Metaschema processor MUST process the constraint to any path in that model definition that matches the given Metapath expression. If a `@target` value is not defined, a Metaschema processor must process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). For [assemblies](#define-assembly-constraints), a Metaschema processor MUST NOT process any constraint within its `model` with a value of `target="."`. +## Constraint Processing + +### Fatal versus Non-Fatal Errors + ## Enumerated values The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. From f22ea1bfb50b906f856a0da976bc53bda7299cc8 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Fri, 20 Oct 2023 17:54:58 -0400 Subject: [PATCH 16/20] [WIP] Tighten wording and reorganization reqs. Co-authored-by: David Waltermire --- .../specification/syntax/constraints.md | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 2e95d9a09..42deeaf5d 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -24,34 +24,57 @@ A constraint MAY have an OPTIONAL `@level` attribute, which identifies the sever ### `@target` -A constraint MAY have a `@target`. A `@target` value is a valid a Metapath expression. In a document conforming to a Metaschema module, a Metaschema processor MUST process the constraint to any path in that model definition that matches the given Metapath expression. If a `@target` value is not defined, a Metaschema processor must process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). For [assemblies](#define-assembly-constraints), a Metaschema processor MUST NOT process any constraint within its `model` with a value of `target="."`. +The *target* of a constraint identifies the content nodes that a constraint applies to. + +A *target* can apply to any node(s) in the document instance(s). There is no guarantee the constraint is a child of its respective assembly, field, or flag. + +When validating content, any constraint whose target does not match any content node MUST be ignored. + +A constraint MAY have a `@target`. A `@target` value is a valid Metapath expression. In a document conforming to a Metaschema module, a Metaschema processor MUST process the constraint to any path in that model definition that matches the given Metapath expression. + +If a `@target` value is not defined, a Metaschema processor must process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). ## Constraint Processing -### Fatal versus Non-Fatal Errors +### Processing Error Handling -## Enumerated values +Processing errors occur when a defect in the constraint definition causes an unintended error to occur during constraint processing. This differs from a validation error that results from not meeting the requirement of a constraint. -The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. +- If a processing error occurs while processing a constraint, which can result from evaluating a Metapath expression, the error SHOULD be reported. +- If a processing error occurs while processing a constraint, then the document instance being validated MUST NOT be considered valid. This is due to the inability to make a conclusion around validity, since some constraints were not validated due to errors. -Metaschema processors MUST process `allowed-values` enumerations. +## Enumerated values -The `@target` attribute of an `` constraint is used to determine the specific content values the constraint applies to. For any given value or node, it is possible to identify the *targeting set* of `` constraints based on their `@target` attributes. If the value or node among is among those being targeted, the constraint is a member of its targeting set. +The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. -The *source* of each allowed `` constraint in the *target set* is identified as one of the following sources: +Each `allowed-values` constraint has a *source* that will be either: - **model:** The constraint is defined *in* a Metaschema module. - **external:** The constraint is defined *outside* a Metaschema module, e.g. external constraints. -The *target set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. +The `@target` of an `` constraint specifies the node(s) in a document instance whose value is restricted by the constraint. + +### Enumerated value processing -Once the *targeting set* of `` constraints is determined, their respective `@allow-other` attributes are used to determine the *expected value set* for a given content value. +Metaschema processors MUST process `` constraints. + +The constraint's `@target` MUST be evaluated as a Metapath expression relative to the node instances of the definition it is enclosed in. These nodes will be the *focus* for Metapath evaluation. Thus, the target is evaluated relative to any node that is an instance of that definition. + +The sequence of nodes that result from Metapath evaluation are the constraints *target node(s)*. + +The nodes resulting from evaluating an `` `@target` are intended to be *field* or *flag* nodes, which have a value. If these nodes are an instance of an *assembly*, a Metaschema processor error SHOULD be raised. + +Multiple `` constraints can apply to a given *target node*. Fo a given *target node*, it is necessary to determine which `` constraints apply to its value. This can be done through a full instance transversal or any other means that is capable of accurately determining the set of `` constraints that target a given node. This set of `` constraints is considered the *applicable set*. + +The `` `@allow-other` attribute determines the *expected value set* for a given content value. + +The *target set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. The following subsections detail the processing requirements for the `@extension` and `@allow-other` attributes. ### `@extension` -For each `` constraint, the `@extension` attribute MUST be one of the following values. +For each `` constraints the *applicable set*, the `@extension` attribute MUST be one of the following values. - **`none`:** There can be no other matching `` constraint for the same target value. This is the least permissive option. @@ -112,3 +135,6 @@ A Metaschema processor MAY use the text value of the `enum`'s XML element as doc ## `define-field` constraints ## `define-assembly` constraints + +## External Constraints + From 984508a511168ab6e58c5578a49d5b6fdeb622a8 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Fri, 17 Nov 2023 10:42:00 -0500 Subject: [PATCH 17/20] More reorganization of common constraint data section and intro. Co-authored-by: David Waltermire --- .../specification/syntax/constraints.md | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 42deeaf5d..66990ffa4 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -8,31 +8,39 @@ weight: 50 **Note: This section of the specification is still a work in progress.** +Metaschema modules can define different kinds of constraints to support data validation within and between document instances. + TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 ## Common Constraint Data -Metaschema modules can define different kinds of constraints to support data validation, inter-documenting indices, and intra-document indices. Below are constraint data that modules may include within any of those different constraint types. +Each individual constraint allows the following data. ### `@id` -A constraint MAY have an OPTIONAL `@id` attribute, which provides an identifier for the constraint. Metaschema processors MAY use the identifier for processing constraints and/or referencing them in output for later analysis. +A constraint MAY have an OPTIONAL `@id` attribute, which provides an identifier for the constraint. + +Metaschema processors MAY use the identifier for processing constraints and/or referencing them in output for later analysis. ### `@level` -A constraint MAY have an OPTIONAL `@level` attribute, which identifies the severity level of a violation of the constraint. If defined, a `@level` MUST have a value of either: `INFORMATIONAL`, `WARNING`, `ERROR`, or `CRITICAL`. Metaschema processors MAY perform conditional processing and/or presentation of constraint violations based on the level value. +A constraint MAY have an OPTIONAL `@level` attribute, which identifies the severity level of a violation of the constraint. + +If defined, a `@level` MUST have a value of either: `INFORMATIONAL`, `WARNING`, `ERROR`, or `CRITICAL`. + +Metaschema processors MAY perform conditional processing and/or presentation of constraint violations based on the level value. ### `@target` The *target* of a constraint identifies the content nodes that a constraint applies to. -A *target* can apply to any node(s) in the document instance(s). There is no guarantee the constraint is a child of its respective assembly, field, or flag. +Not all constraint types require a `@target`. Each constraint type defines if the `@target` is required, optional, or implicit. -When validating content, any constraint whose target does not match any content node MUST be ignored. +When provided, the value of a `@target` MUST be a valid Metapath expression. -A constraint MAY have a `@target`. A `@target` value is a valid Metapath expression. In a document conforming to a Metaschema module, a Metaschema processor MUST process the constraint to any path in that model definition that matches the given Metapath expression. +If a `@target` value is not defined, a Metaschema processor MUST process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). -If a `@target` value is not defined, a Metaschema processor must process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). +A *target* can apply to any node(s) in the document instance(s). There is no guarantee the constraint *target* is a child of its respective assembly, field, or flag. Thus, a Metaschema processor MUST resolve the Metapath expression to identify the actual target nodes that the constraint applies to. If no resulting target nodes are identified, then the constraint MUST be ignore. ## Constraint Processing From 095817faeb5dba1fb0691153c760e9d0fea23558 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Fri, 17 Nov 2023 12:22:38 -0500 Subject: [PATCH 18/20] Tighten up enumerated value processing section. Co-authored-by: David Waltermire --- .../specification/syntax/constraints.md | 81 ++++++++++++++----- 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 66990ffa4..4227f83b1 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -10,8 +10,6 @@ weight: 50 Metaschema modules can define different kinds of constraints to support data validation within and between document instances. -TODO: P3: Address issue https://github.com/usnistgov/metaschema/issues/325 - ## Common Constraint Data Each individual constraint allows the following data. @@ -44,6 +42,43 @@ A *target* can apply to any node(s) in the document instance(s). There is no gua ## Constraint Processing +In a Metaschema-based document instance, each node in the document instance is associated with a definition in a Metaschema module. Thus, a given content node has one and only one associated definition. + +A constraint is defined relative to an assembly, field, or flag [definition](../definitions/) in a Metaschema module. + +All constraints associated with a definition MUST be evaluated against all associated content nodes. + +Constraints may be declared internally within a definition or as an external set of constraints associated with a definition. To determine the evaluation order, internal and external constraints associated with a definition need to be combined. + +Declaration order MUST be determined in the following way. + +1. Internal constraints defined directly in the definition are ordered first according to their original order. +2. External constraints are appended in the order the external constraints were provided to the processor. + +Each constraint MUST be evaluated in declaration order. + +For example: + +Given the Metaschema module definitions below: + +``` +Assembly(name="asmA") + Field(name="fldX) + Flag(name="flgS") + Assembly(name="asmB") + Flag(name="flgT") +``` + +Constraint evaluation would be handled depth-first as follows: + +- When document node `asmA` is processed, constraints defined on that node's definition will be evaluated. +- When document node `fldX` is processed, constraints defined on that node's definition will be evaluated. +- and so on... + +Note: The target of the constraint does not affect this evaluation order, but may affect what resulting node the constraint applies to. + +When a constraint is evaluated against the associated content node, this node is considered the constraints *evaluation focus*. + ### Processing Error Handling Processing errors occur when a defect in the constraint definition causes an unintended error to occur during constraint processing. This differs from a validation error that results from not meeting the requirement of a constraint. @@ -53,12 +88,12 @@ Processing errors occur when a defect in the constraint definition causes an uni ## Enumerated values -The `allowed-values` constraint is a kind of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. +The `allowed-values` constraint is a type of Metaschema constraint that restricts field or flag value(s) based on an enumerated set of permitted values. Each `allowed-values` constraint has a *source* that will be either: -- **model:** The constraint is defined *in* a Metaschema module. -- **external:** The constraint is defined *outside* a Metaschema module, e.g. external constraints. +- **model:** The constraint is defined *in* a Metaschema module, i.e. an internal constraint. +- **external:** The constraint is defined *outside* a Metaschema module, i.e. an external constraint. The `@target` of an `` constraint specifies the node(s) in a document instance whose value is restricted by the constraint. @@ -66,21 +101,25 @@ The `@target` of an `` constraint specifies the node(s) in a doc Metaschema processors MUST process `` constraints. -The constraint's `@target` MUST be evaluated as a Metapath expression relative to the node instances of the definition it is enclosed in. These nodes will be the *focus* for Metapath evaluation. Thus, the target is evaluated relative to any node that is an instance of that definition. +The constraint's `@target` is a Metapath expression that identifies the node values the constraint applies to. + +When evaluating the `@target` metapath expression, the Metapath focus MUST be the constraint's *evaluation focus*. Thus, the targets are determined in the context in where the constraint is declared. The sequence of nodes that result from Metapath evaluation are the constraints *target node(s)*. The nodes resulting from evaluating an `` `@target` are intended to be *field* or *flag* nodes, which have a value. If these nodes are an instance of an *assembly*, a Metaschema processor error SHOULD be raised. -Multiple `` constraints can apply to a given *target node*. Fo a given *target node*, it is necessary to determine which `` constraints apply to its value. This can be done through a full instance transversal or any other means that is capable of accurately determining the set of `` constraints that target a given node. This set of `` constraints is considered the *applicable set*. +Multiple `` constraints can apply to a given *target node*, which may be declared by constraints defined on different content nodes. Implementations will need a means to determine the complete set of `` constraints that apply to a given *target node*, which is referred to as the *target node's* "*applicable set*". + +This may be handled using a two phased evaluation that first resolves the `` constraints associated with each *target node* determining the *applicable set*, then, second, evaluates the *applicable set* for each *target node*. Other implementations may be possible and are allowed if they result in the same effective behavior. -The `` `@allow-other` attribute determines the *expected value set* for a given content value. +The *applicable set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. -The *target set* of `` constraints is verified for correctness using the `@extension` attribute on each set member. +For each `` in the *applicable set*, the `@allow-other` attribute is used to determine the *expected value set* for a given content value. The following subsections detail the processing requirements for the `@extension` and `@allow-other` attributes. -### `@extension` +#### `@extension` For each `` constraints the *applicable set*, the `@extension` attribute MUST be one of the following values. @@ -94,14 +133,14 @@ For each `` constraints the *applicable set*, the `@extension` a All allowed-values constraints, declared within the model and externally through an extension, that match the same @target can be combined. This is the most permissive option. -One of the following requirements MUST apply when processing a value's *target set* to validate it. +One of the following requirements MUST apply when processing a value's *applicable set* to validate it. -1. The *target set* MUST contain a single `` constraint with the `@extension` attribute value `none`. -1. All `` constraints in the *target set* MUST have the `@extension` attribute value `model` and originate from a *model* source. -1. All `` constraints in the *target set* MUST have the `@extension` attribute value `external` and originate from either a *model* or *extension* source. -1. An error MUST be raised indicating the *target set* is invalid. +1. The *applicable set* MUST contain a single `` constraint with the `@extension` attribute value `none`. +1. All `` constraints in the *applicable set* MUST have the `@extension` attribute value `model` and originate from a *model* source. +1. All `` constraints in the *applicable set* MUST have the `@extension` attribute value `external` and originate from either a *model* or *extension* source. +1. An error MUST be raised indicating the *applicable set* is invalid. -### `@allow-other` +#### `@allow-other` The *expected value set* can be considered *open* or *closed*. @@ -110,16 +149,18 @@ The *expected value set* can be considered *open* or *closed*. For each `` constraint, the `@allow-other` attribute MUST be one of the following values. -- **`yes`:** Identifies the *expected value set* as *open*, as long as no other `` constraint in the *target set* has `@allow-other="no"` declared explicitly or implicitly. +- **`yes`:** Identifies the *expected value set* as *open*, as long as no other `` constraint in the *applicable set* has `@allow-other="no"` declared explicitly or implicitly. - **`no`:** (default) Identifies the *expected value set* as *closed*. **This is the implicit default value if no `@allow-other` is provided.** One of the following requirements MUST apply when processing a value's *targeting set* of `` constraints to determine the *expected value set*. -1. One `` constraint in the *target set* MUST have the `@allow-other` attribute value `no`. The *expected value set* is *closed*. +1. One `` constraint in the *applicable set* MUST have the `@allow-other` attribute value `no`. The *expected value set* is *closed*. The actual value MUST match one of the enumerated values declared on any of the `` constraints in the *targeting set*. An error MUST be produced to indicate that the value doesn't match one of the enumerated values. - -2. All `` constraints in the *targeting set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. + + It is possible to require a value that does not align with the value node's Metaschema data type. In such cases, this creates a situation where both the data type and a closed value requirement cannot be met. In such cases, the constraint processor MUST report this as an error. + +2. All `` constraints in the *applicable set* MUST have the `@allow-other` attribute value `yes`. The *expected value set* is *open*. Any type-appropriate actual value MUST be allowed. A warning MAY be produced to indicate that the value doesn't match one of the enumerated values. From e7123971ab922b32f5edc3173e988f38d4b234ed Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Fri, 17 Nov 2023 12:34:28 -0500 Subject: [PATCH 19/20] Finalize inventory of different definition types. Co-authored-by: David Waltermire --- .../specification/syntax/constraints.md | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 4227f83b1..78e58ec68 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -10,6 +10,40 @@ weight: 50 Metaschema modules can define different kinds of constraints to support data validation within and between document instances. +The types of constraints allowed for a given definition + +## `` constraints + +The following constraint types are allowed for `` definitions. + +- [``](#enumerated-values) +- `` +- `` +- `` + +For each of these constraint types, use of the `@target` attribute is prohibited. This is because a flag constraint may only target the flag, since a flag has no child nodes. + +## `` constraints + +The following constraint types are allowed for `` definitions. + +- [``](#enumerated-values) +- `` +- `` +- `` + +## `` constraints + +The following constraint types are allowed for `` definitions. + +- [``](#enumerated-values) +- `` +- `` +- `` +- `` +- `` +- `` + ## Common Constraint Data Each individual constraint allows the following data. @@ -179,11 +213,6 @@ A Metaschema processor MAY use the text value of the `enum`'s XML element as doc ``` -## `define-flag` constraints - -## `define-field` constraints - -## `define-assembly` constraints - ## External Constraints +TBD From f445e5392a6aa28ea94497416cd932937585e026 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Tue, 5 Dec 2023 13:53:21 -0500 Subject: [PATCH 20/20] Fix typo in target attribute explanation Fix typo pointed out by @wendellpiez in PR review, ignore->ignored, in the section about the target attribute. Co-authored-by: Wendell Piez --- website/content/specification/syntax/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/specification/syntax/constraints.md b/website/content/specification/syntax/constraints.md index 78e58ec68..8ac96ec12 100644 --- a/website/content/specification/syntax/constraints.md +++ b/website/content/specification/syntax/constraints.md @@ -72,7 +72,7 @@ When provided, the value of a `@target` MUST be a valid Metapath expression. If a `@target` value is not defined, a Metaschema processor MUST process the value as `target="."`, the current context of that constraint definition in a module, for a [field](#define-field-constraints) or [flag](#define-flag-constraints). -A *target* can apply to any node(s) in the document instance(s). There is no guarantee the constraint *target* is a child of its respective assembly, field, or flag. Thus, a Metaschema processor MUST resolve the Metapath expression to identify the actual target nodes that the constraint applies to. If no resulting target nodes are identified, then the constraint MUST be ignore. +A *target* can apply to any node(s) in the document instance(s). There is no guarantee the constraint *target* is a child of its respective assembly, field, or flag. Thus, a Metaschema processor MUST resolve the Metapath expression to identify the actual target nodes that the constraint applies to. If no resulting target nodes are identified, then the constraint MUST be ignored. ## Constraint Processing