linkml / linkml-model

Link Modeling Language (LinkML) model
https://linkml.github.io/linkml-model/docs/
34 stars 16 forks source link

Include LABEL in Permissible Value Formula Options #171

Closed nicholsn closed 10 months ago

nicholsn commented 10 months ago

This PR adds LABEL as a permissible value for the PvFormulaOptions enum.

Background

The Ontology Access Kit (OAK) has a utility for expanding linkml dynamic enums called vskit that allows users to configure the representation of the values used for an enum in their linkml schema. For example, if you wanted to use a CODE representation (i.e., OBI:0000123 --> 0000123) as your enum then you could use:

enums:
  example_enum:
    pv_meaning: CODE
    reachable_from:
      source_ontology: obo:efo
...

And that will give you

enums:
  example_enum:
    pv_meaning: CODE
    permissible_values:
      EFO:0009971:
        text: 0009971
        meaning: EFO:0009971
...

However if I try to use the LABEL

enums:
  example_enum:
    pv_meaning: LABEL
    reachable_from:
      source_ontology: obo:efo
...

I'll get an error because LABEL is not defined in the pv_formula_options enum, even though OAK has a case where LABEL could be used to set the permissible value to the human readable label.

ValueError: Unknown PvFormulaOptions enumeration code: LABEL

Including the LABEL enum will allow vskit to use the the human readable label as an enum.

nicholsn commented 10 months ago

@sierra-moxon any chance this can be merged to keep in sync with https://github.com/INCATools/ontology-access-kit/pull/677?