Skip to content

Commit 6a92ddf

Browse files
update to class-based extra expression
1 parent e9a7322 commit 6a92ddf

File tree

1 file changed

+50
-18
lines changed

1 file changed

+50
-18
lines changed

linkml_model/model/schema/meta.yaml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,46 +1358,66 @@ slots:
13581358
Note that this does *not* define the constraints that are placed on additional slots defined by inheriting classes.
13591359
13601360
Possible values:
1361-
- true: allow any additional data
1362-
- false: (default) forbid any additional data
1363-
- anonymous_slot_expression: allow only data matching this anonymous slot expression
1361+
- `allowed: true` - allow all additional data
1362+
- `allowed: false` (or `allowed:` or `allowed: null` while `slot_expression` is `null`) -
1363+
forbid all additional data (default)
1364+
- `slot_expression: ...` - allow additional data if it matches the slot expression (see examples)
13641365
domain: class_definition
13651366
ifabsent: false
1366-
any_of:
1367-
- range: boolean
1368-
- range: anonymous_slot_expression
1367+
range: extra_slots_expression
13691368
in_subset:
13701369
- SpecificationSubset
13711370
- BasicSubset
13721371
examples:
1373-
- value: true
1372+
- value:
1373+
allowed: true
13741374
description: Allow all additional data
1375-
- value: false
1375+
- value:
1376+
allowed: false
13761377
description: Forbid any additional data
13771378
- value:
1378-
range: string
1379+
slot_expression:
1380+
range: string
13791381
description: Allow additional data that are strings
13801382
- value:
1381-
range: AClassDefinition
1383+
slot_expression:
1384+
range: AClassDefinition
13821385
description: Allow additional data if they are instances of the class definition "AClassDefinition"
13831386
- value:
1384-
any_of:
1385-
- range: string
1386-
- range: integer
1387+
slot_expression:
1388+
any_of:
1389+
- range: string
1390+
- range: integer
13871391
description: allow additional data if they are either strings or integers
13881392
- value:
1389-
range: integer
1390-
multivalued: true
1391-
maximum_cardinality: 5
1393+
slot_expression:
1394+
range: integer
1395+
multivalued: true
1396+
maximum_cardinality: 5
13921397
description: |
13931398
Allow additional data if they are lists of integers of at most length 5.
13941399
Note that this does *not* mean that a maximum of 5 extra slots are allowed.
13951400
- value:
1396-
range: integer
1397-
required: true
1401+
slot_expression:
1402+
range: integer
1403+
required: true
13981404
description: |
13991405
Allow additional data if they are integers.
14001406
`required` is meaningless in this context and ignored, since by definition all "extra" slots are optional.
1407+
- value:
1408+
allowed: false
1409+
slot_expression:
1410+
range: string
1411+
description: |
1412+
A semantically *invalid* use of `extra_slots`, as extra slots will be forbidden and the
1413+
`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
14011421

14021422
# -----------------------------------
14031423
# Slot definition slots
@@ -3273,6 +3293,18 @@ classes:
32733293
in_subset:
32743294
- SpecificationSubset
32753295

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+
- slot_expression
3306+
3307+
32763308
# ==================================
32773309
# Enumerations #
32783310
# ==================================

0 commit comments

Comments
 (0)