-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Problem
There's no way to generate deterministic identifiers within expr: fields in transformation specs. This is needed when:
- A source entity (e.g., Visit) needs a stable UUID as its
id - Other entities (Conditions, Observations, etc.) need to reference that same Visit by its UUID
- The Visit spec and the referencing specs are processed independently — there's no cross-spec state
Without deterministic UUID generation, there's no way for independently processed specs to produce matching identifiers.
Proposed solution
Add a uuid5() function available in expr: fields that generates a UUID v5 from a namespace and a name string:
# In visit.yaml
id:
expr: 'uuid5("https://w3id.org/bdchm/Visit", {participant_id} + ":" + {visit_name})'
# In condition.yaml — produces the same UUID for the same inputs
associated_visit:
expr: 'uuid5("https://w3id.org/bdchm/Visit", {participant_id} + ":" + {visit_name})'UUID5 is deterministic — same namespace + same name always produces the same UUID — so specs processed independently will generate matching references without any shared state.
Context
The BioData Catalyst harmonized model (bdchm) requires Visit entities to have URI-based identifiers. Other entities reference Visits via associated_visit (range: Visit). Currently there's no way to mint these IDs during transformation, forcing workarounds like using visit names as temporary IDs.
Ref: linkml/dm-bip#235