linkml / schema-automator

Automated assistance for the schema development lifecycle
https://linkml.io/schema-automator/
BSD 3-Clause "New" or "Revised" License
36 stars 13 forks source link

enum_annotator.py chokes on some of the enums from the NMDC DH model #35

Closed turbomam closed 2 years ago

turbomam commented 2 years ago

linkml_model_enrichment/annotators/enum_annotator.py

Run make all in microbiomedata/DataHarmonizer to get target/soil_biosample_modular_annotated.yaml. That already has fao_class_enum already pretty well annotated.

turbomam commented 2 years ago
poetry run enum_annotator \
--modelfile soil_biosample_modular.yaml \
--ontology_string ENVO \
--max_cosine 0.1 \
--trim_parentheticals \
--requested_enum_name analysis_type_enum  

metabolomics Traceback (most recent call last): File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/bin/enum_annotator", line 8, in sys.exit(enum_annotator()) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/linkml_model_enrichment/annotators/enum_annotator.py", line 307, in enum_annotator raw_through_annotations = enum_name_mapping_frame.merge(annotations_from_terms, how='left', on="iri", File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/pandas/core/frame.py", line 9190, in merge return merge( File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 106, in merge op = _MergeOperation( File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 699, in init ) = self._get_merge_keys() File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 1096, in _get_merge_keys right_keys.append(right._get_label_or_level_values(rk)) File "/home/mark/.cache/pypoetry/virtualenvs/linkml-round-trips-2m4fR-mZ-py3.9/lib/python3.9/site-packages/pandas/core/generic.py", line 1779, in _get_label_or_level_values raise KeyError(key) KeyError: 'iri'