Skip to content

Commit 6bdd1d3

Browse files
authored
Merge pull request #205 from sneakers-the-rat/extra-slots
add extra_slots metamodel slot
2 parents 03963c9 + 82d94f5 commit 6bdd1d3

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

linkml_model/model/schema/meta.yaml

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,73 @@ slots:
13511351
range: boolean
13521352
description: if true then induced/mangled slot names are not created for class_usage and attributes
13531353
status: testing
1354-
1354+
1355+
extra_slots:
1356+
description: |
1357+
How a class instance handles extra data not specified in the class definition.
1358+
Note that this does *not* define the constraints that are placed on additional slots defined by inheriting classes.
1359+
1360+
Possible values:
1361+
- `allowed: true` - allow all additional data
1362+
- `allowed: false` (or `allowed:` or `allowed: null` while `range_expression` is `null`) -
1363+
forbid all additional data (default)
1364+
- `range_expression: ...` - allow additional data if it matches the slot expression (see examples)
1365+
domain: class_definition
1366+
ifabsent: false
1367+
range: extra_slots_expression
1368+
in_subset:
1369+
- SpecificationSubset
1370+
- BasicSubset
1371+
examples:
1372+
- value:
1373+
allowed: true
1374+
description: Allow all additional data
1375+
- value:
1376+
allowed: false
1377+
description: Forbid any additional data
1378+
- value:
1379+
range_expression:
1380+
range: string
1381+
description: Allow additional data that are strings
1382+
- value:
1383+
range_expression:
1384+
range: AClassDefinition
1385+
description: Allow additional data if they are instances of the class definition "AClassDefinition"
1386+
- value:
1387+
range_expression:
1388+
any_of:
1389+
- range: string
1390+
- range: integer
1391+
description: allow additional data if they are either strings or integers
1392+
- value:
1393+
range_expression:
1394+
range: integer
1395+
multivalued: true
1396+
maximum_cardinality: 5
1397+
description: |
1398+
Allow additional data if they are lists of integers of at most length 5.
1399+
Note that this does *not* mean that a maximum of 5 extra slots are allowed.
1400+
- value:
1401+
range_expression:
1402+
range: integer
1403+
required: true
1404+
description: |
1405+
Allow additional data if they are integers.
1406+
`required` is meaningless in this context and ignored, since by definition all "extra" slots are optional.
1407+
- value:
1408+
allowed: false
1409+
range_expression:
1410+
range: string
1411+
description: |
1412+
A semantically *invalid* use of `extra_slots`, as extra slots will be forbidden and the
1413+
`anonymous_slot_expression` will be ignored.
1414+
1415+
allowed:
1416+
description: Whether or not something is allowed. Usage defined by context.
1417+
range: boolean
1418+
in_subset:
1419+
- SpecificationSubset
1420+
- BasicSubset
13551421

13561422
# -----------------------------------
13571423
# Slot definition slots
@@ -3023,6 +3089,7 @@ classes:
30233089
- represents_relationship
30243090
- disjoint_with
30253091
- children_are_mutually_disjoint
3092+
- extra_slots
30263093
slot_usage:
30273094
is_a:
30283095
range: class_definition
@@ -3226,6 +3293,18 @@ classes:
32263293
in_subset:
32273294
- SpecificationSubset
32283295

3296+
extra_slots_expression:
3297+
description: |
3298+
An expression that defines how to handle additional data in an instance of class
3299+
beyond the slots/attributes defined for that class.
3300+
See `extra_slots` for usage examples.
3301+
mixins:
3302+
- expression
3303+
slots:
3304+
- allowed
3305+
- range_expression
3306+
3307+
32293308
# ==================================
32303309
# Enumerations #
32313310
# ==================================

0 commit comments

Comments
 (0)