biolink / biolinkml

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

gen-py-classes generating extra slot info #228

Closed wdduncan closed 4 years ago

wdduncan commented 4 years ago

For reference see https://github.com/microbiomedata/nmdc-metadata/pull/139.

When running gen-py-classes on nmdc.yaml, we are getting extra slots of the form <x value>_has_raw value, <y value>_has_unit. For example:

slots.quantity_value_has_raw_value = Slot(uri=NMDC.has_raw_value, name="quantity value_has raw value", curie=NMDC.curie('has_raw_value'),
                      model_uri=NMDC.quantity_value_has_raw_value, domain=QuantityValue, range=Optional[str])
slots.quantity_value_has_unit = Slot(uri=NMDC.has_unit, name="quantity value_has unit", curie=NMDC.curie('has_unit'),
                      model_uri=NMDC.quantity_value_has_unit, domain=QuantityValue, range=Optional[str])

Is this behavior correct?

cc @cmungall @deepakunni3

cmungall commented 4 years ago

We may be able to close this in favor of the more general #231

it's not clear the existing python behavior is so bad. we don't have an easy mechanism for compound keys here, hence the manifestation of the induced primary key

wdduncan commented 4 years ago

Yes. Let's close in favor of #231.