linkml / linkml

Linked Open Data Modeling Language
https://linkml.io/linkml
Other
311 stars 98 forks source link

Add a way to handle int64s serialized as strings #2142

Open cmungall opened 4 months ago

cmungall commented 4 months ago

Some frameworks will serialize what are internally ints as strings in JSON: https://protobuf.dev/programming-guides/proto3/#json

This means that the canonical JSON version of some databases may use strings for things such as genome positions: https://github.com/monarch-initiative/phenopacket-store/issues/97

It would be convenient to have a way of reading/writing these as strings but coercing them to ints.

  1. Add a new type, int_as_string
  2. add an annotation to the slot that gives serialization/coercion hints
  3. handle using linkml-map (a simple slot derivation)

See also