Skip to content

Integrate storage_unit annotations into slot modification process #351

@pkalita-lbl

Description

@pkalita-lbl

In microbiomedata/nmdc-schema#2599, a storage_unit annotation was added to slots with range QuantityValue. This annotation contains a pipe-delimited list of permissible values from UnitEnum (i.e. valid UCUM codes) that represent which unit(s) we expect when populating the QuantityValue.has_unit slot.

Currently the submission-schema build process replaces the range of QuantityValue with string and applies pattern that looks like {number} {unit} -- where unit is essentially any string. This task is to update the build process as follows:

  • For any incoming nmdc-schema slot with a range that is QuantityValue, check for a storage_unit annotation.
    • If the storage_unit annotation is a single UnitEnum permissible value
      • Change the submission-schema slot's range to float
      • Set the submission-schema slot's unit with the annotation value and the title of the permissible value, if available
    • If the storage_unit contains a pipe-separated list of UnitEnum permissible values:
      • Change the submission-schema slot's range to string
      • Set the submission-schema slot's pattern to a regex incorporating the pipe-separated unit list (e.g. the value should like {number} unit_a|unit_b)
    • Otherwise
      • Change the submission-schema slot's range to string
      • Set the submission-schema slot's pattern to the generic {number} {unit} regex

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions