The definition of extra_slots in LinkML’s own schema contains some examples:
extra_slots:
description: [...]
examples:
- value:
allowed: true
description: Allow all 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
But the value slot in the example class has no explicit range, meaning it defaults to having a string range. Therefore, the above uses of value are invalid, as correctly pointed out by the LinkML validator:
[ERROR] [meta.yaml/0] {'allowed': True} is not of type 'string', 'null' in /slots/extra_slots/examples/0/value
The example class has a separate value_object slot (aliased to object), specifically intended to represent example values that are not simple scalars. This is what should have been used here:
extra_slots:
description: [...]
examples:
- object:
allowed: true
description: Allow all additional data
- object:
range_expression:
range: string
description: Allow additional data that are strings
- object:
range_expression:
range: AClassDefinition
description: Allow additional data if they are instances of the class definition
The definition of
extra_slotsin LinkML’s own schema contains some examples:But the
valueslot in theexampleclass has no explicit range, meaning it defaults to having astringrange. Therefore, the above uses ofvalueare invalid, as correctly pointed out by the LinkML validator:The
exampleclass has a separatevalue_objectslot (aliased toobject), specifically intended to represent example values that are not simple scalars. This is what should have been used here: