Add "type_designator_mapping" slot.#262
Conversation
Add a new `type_designator_mapping` slot. That slot is intended to be used in a slot_definition for a slot that is set as the type designator slot for the class it belongs to. It allows to define custom mappings to match a type designator value with the type to be designated. Such mappings can be used to provide more ways to reference a given class in a type designator value (beyond the default way of using the class name, URI, or CURIE). It also allows to provide a "fallback" mechanism, by which a loader or validator can be made to accept an otherwise unrecognised designated type, through the use of "wildcards" (shell-like patterns). This implements the idea evoked in linkml/linkml#3701.
8ba7e46 to
082d0b5
Compare
|
@cmungall This proposal has the following differences compared to what we discussed in linkml/linkml#3701: (A) The keys in the So for example, the map entry that would act as the ultimate fallback (recognising anything) would be just This is because I am not convinced we need the expressivity of full regular expressions here – this seems “overkill” to me. However I don’t have too much of a strong opinion here. If you (or anyone else for that matter) believe regular expressions would really be beneficial here, that’s fine with me, happy to change. (B) I introduced the notion of “longest match”, in that the designated type to be effectively used has to be found by searching for the longest matching entry in the This is because the Consider the example coming from the linkml/linkml#3701 ticket: type_designator_mapping:
TC: TargetingComponent
LC: LoadingComponent
"*": FrobnicatorComponentThere is no intrinsic guarantee that the The “longest match” rule avoids this situation. |
Add a new
type_designator_mappingslot.That slot is intended to be used in a slot_definition for a slot that is set as the type designator slot for the class it belongs to.
It allows to define custom mappings to match a type designator value with the type to be designated. Such mappings can be used to provide more ways to reference a given class in a type designator value (beyond the default way of using the class name, URI, or CURIE).
This implements the idea evoked in linkml/linkml#3701.