Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions linkml_model/model/schema/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,29 @@ slots:
exact_mappings:
- cdisc:PermissibleValue

is_open:
Comment thread
noelmcloughlin marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A boolean feels right here. id_prefixes_are_closed (line 249) is the precedent: one slot builds the set, another says if it's exhaustive. is_open: true is also the top case of a future open_to: <expr>, so this forecloses nothing.

domain: enum_expression
Comment thread
noelmcloughlin marked this conversation as resolved.
range: boolean
description: >-
Whether the enumeration is open, meaning that values outside of the set of
permissible values are allowed. If true, the enumeration is open and data values
that are not in the set of permissible values are permitted (though they SHOULD be
drawn from the permissible values if available). If false (runtime default), the
enumeration is closed and data values MUST be drawn from the set of permissible values.
ifabsent: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop ifabsent: false. It materializes False on every enum and the dumper emits it, so all schemas grow an is_open: false line. No other boolean slot in the metamodel uses ifabsent.

comments:
Comment thread
noelmcloughlin marked this conversation as resolved.
- An open enumeration is analogous to the `allow-other="yes"` construct in the OSCAL Metamodel.
- When an enum is open, the permissible values are advisory - they document the recommended

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contradicts the description above. Open means the value set isn't exhaustive, not that other constraints vanish — a slot pattern should still hold. The "maps to a plain string" bit is a JSON Schema lowering detail; leave that to linkml#3712 and remove the reference to JSON Schema.

or expected values but do not constrain the range. In JSON Schema this maps to a plain string.
see_also:
- https://pages.nist.gov/metaschema/specification/syntax/constraints/#allow-other
- https://github.com/linkml/linkml/issues/127
- https://github.com/linkml/linkml/pull/3712
in_subset:
- SpecificationSubset
# BasicSubset

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the commented-out # BasicSubset.

status: testing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth a tests/input/examples/schema_definition-open-enums.yaml so make test-examples covers it.


enum_uri:
aliases:
- public ID
Expand Down Expand Up @@ -2782,6 +2805,7 @@ classes:
- code_set_version
- pv_formula
- permissible_values
- is_open
- include
- minus
- inherits
Expand Down
Loading