biolink / biolinkml

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

Proposed changes for issue #159 #301

Closed hsolbrig closed 3 years ago

hsolbrig commented 3 years ago

Also added a from_yaml loader in yamlutils.py -- a skeleton at the moment but something we could enhance as time goes on.

hsolbrig commented 3 years ago

So this is a first cut at templating. Give it a look-see: Basic documentation is at: https://github.com/biolink/biolinkml/blob/templates/biolinkml/generators/string_template.md

Notes, observations and the like: 1) This does require a new package ("parse") to be loaded from pypi. Will this be an issue? 2) At the moment, this only works with class definitions -- it can be asserted in slots, types, subsets and schemas, but we don't do anything with it at the moment. Should we leave it there in anticipation of future functionality or just constrain it down to classes? 3) I can see that formatting requirements may end up depending on what is being emitted. Maybe it would make sense to switch from a single formatting string to a dictionary of formatting strings (with a default and enough syntactic sugar to support what we've got above) but with a way to specify which format to use programmatically as well as having the generators (ShEx, OWL, RDF, JSON, ...) supply pre-defined keys to allow format tailoring