Skip to content

Commit

Permalink
Document index constraint for usnistgov#490.
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-stein-nist committed Jan 4, 2024
1 parent fd6d730 commit bf11093
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/content/specification/syntax/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ And the following document.
The expect constraint would pass for each `sibling` in the `parent` named "p1", and would fail for each `sibling` in the `parent` named "p2".


## `index` constraints

The `index` constraint is a type of Metaschema constraint that defines an index of document instance nodes addressable by key.

The `@name` attribute of an `<index>` constraint specifies the identity of the index. The constraint MUST define the name. A Metaschema processor MAY use the name of index to uniquely identify the index from others during processing.

The `@target` attribute of an `<index>` constraint defines the node(s) in a document instance to index. The index MUST define a `@target` with a Metapath expression. The processor MUST index only The document instance node(s) resulting from its evaluation.

The `<key-field>` child element of an `<index>` constraint defines the attribute or element value that is the key for each entry in the index. The `<key-field>` element MUST define a `@target` attribute with a Metapath expression evaluated relative to [the evaluation focus](#constraint-processing) of each entry of the matches of the constraint's `@target`.

A Metaschema processor MAY process a valid, well-formed index where the `@target` or the `<key-field>` `@target` evaluation does not return any document instance node(s), such that the index is empty.

## Enumerated 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.
Expand Down

0 comments on commit bf11093

Please sign in to comment.