Skip to content
Merged
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
81 changes: 80 additions & 1 deletion linkml_model/model/schema/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,73 @@ slots:
range: boolean
description: if true then induced/mangled slot names are not created for class_usage and attributes
status: testing


extra_slots:
description: |
How a class instance handles extra data not specified in the class definition.
Note that this does *not* define the constraints that are placed on additional slots defined by inheriting classes.

Possible values:
- `allowed: true` - allow all additional data
- `allowed: false` (or `allowed:` or `allowed: null` while `range_expression` is `null`) -
forbid all additional data (default)
- `range_expression: ...` - allow additional data if it matches the slot expression (see examples)
domain: class_definition
ifabsent: false
range: extra_slots_expression
in_subset:
- SpecificationSubset
- BasicSubset
examples:
- value:
allowed: true
description: Allow all additional data
- value:
allowed: false
description: Forbid any additional data
- value:
range_expression:
range: string
description: Allow additional data that are strings
- value:
range_expression:
range: AClassDefinition
description: Allow additional data if they are instances of the class definition "AClassDefinition"
- value:
range_expression:
any_of:
- range: string
- range: integer
description: allow additional data if they are either strings or integers
- value:
range_expression:
range: integer
multivalued: true
maximum_cardinality: 5
description: |
Allow additional data if they are lists of integers of at most length 5.
Note that this does *not* mean that a maximum of 5 extra slots are allowed.
- value:
range_expression:
range: integer
required: true
description: |
Allow additional data if they are integers.
`required` is meaningless in this context and ignored, since by definition all "extra" slots are optional.
- value:
allowed: false
range_expression:
range: string
description: |
A semantically *invalid* use of `extra_slots`, as extra slots will be forbidden and the
`anonymous_slot_expression` will be ignored.

allowed:
description: Whether or not something is allowed. Usage defined by context.
range: boolean
in_subset:
- SpecificationSubset
- BasicSubset

# -----------------------------------
# Slot definition slots
Expand Down Expand Up @@ -3023,6 +3089,7 @@ classes:
- represents_relationship
- disjoint_with
- children_are_mutually_disjoint
- extra_slots
slot_usage:
is_a:
range: class_definition
Expand Down Expand Up @@ -3226,6 +3293,18 @@ classes:
in_subset:
- SpecificationSubset

extra_slots_expression:
description: |
An expression that defines how to handle additional data in an instance of class
beyond the slots/attributes defined for that class.
See `extra_slots` for usage examples.
mixins:
- expression
slots:
- allowed
- range_expression


# ==================================
# Enumerations #
# ==================================
Expand Down
Loading