anngvu / retold

Enabling interop between linked data modelling frameworks/formats
Eclipse Public License 2.0
0 stars 0 forks source link

Handle more translation of LinkML constraints to schematic validation rules syntax #16

Open anngvu opened 5 months ago

anngvu commented 5 months ago

Currently, data modelers who write LinkML but are schematic-conscious include schematic validation rules directly as annotations in YAML for the most straightforward interop. However, there are LinkML modelers who do not necessarily think of schematic JSON-LD as a main target and specify constraints in pure LinkML. So an example min-max constraint in LinkML like:

age:
  description: Human age in years.
  range: float
  minimum_value: 0
  maximum_value: 120

would be translated to schematic syntax: inRange 0 120 error.

However, not all translations are possible. A lot of translation from LinkML constraints to schematic validation rules will be approximate or impossible, so this will cover the easy subset that can be translated well.