biolink / biolinkml

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

Add decimal to types.yaml #312

Closed cmungall closed 3 years ago

cmungall commented 3 years ago

Not clear this is the right way to do it, not 100% sure on the difference between repr and base.

Note that Decimal is part of python in the decimal package https://docs.python.org/3/library/decimal.html

hsolbrig commented 3 years ago

base has to reference either a Python builtin type or a class in biolinkml.utils.metamodelcore. repr turns out to be a bit confusing. At one point it served a real purpose, but I'm not sure that I understand what it is at this point. The documentation says: "representational form in yaml/python if different than representation in base", but it doesn't appear to be used anywhere...

Changes to the metamodel itself are a bit more involved, as the changes impact the processing itself. There is some really brief documentation in ModelChanges.md, but it may be a bit out of date. I'll go ahead and change Decimal to decimal in the base, remove the repr and run the documented process.

Also note that additional types CAN be defined in specific models, but "decimal" seems general enough to consider worth including in the base.

hsolbrig commented 3 years ago

ModelChanges.md has been updated. We still need unit tests to make sure that the decimal type delivers the desired behaviorl