biolink / biolinkml

DEPRECATED: replaced by linkml
https://github.com/linkml/linkml
Creative Commons Zero v1.0 Universal
23 stars 12 forks source link

Dynamically extending meta.yaml #126

Closed cmungall closed 3 years ago

cmungall commented 4 years ago

Sometimes we might want to dynamically extend the metamodel, to adorn classes with new properties. E.g.

slots:
   curator_note:
     domain: Definition

   slot1:
       curator_note: this is a test

This fails because curator_note is not in meta.py

Of course, we can simply keep adding properties to meta.yaml, but this doesn't scale well

perhaps it would be possible to declare all meta.Elements to be open, such that arbitrary keys can be inserted, perhaps with another layer of checking?

Or maybe it's possible to dynamically extend the meta.py object model at run time? E.g if a domain is encountered where the referenced class is known by introspection, add the slot dynamically?