microbiomedata / nmdc-schema

National Microbiome Data Collaborative (NMDC) unified data model
https://microbiomedata.github.io/nmdc-schema/
Creative Commons Zero v1.0 Universal
26 stars 8 forks source link

YAMLGenerator:Unrecognized prefix #232

Closed turbomam closed 1 year ago

turbomam commented 2 years ago

poetry run gen-yaml nmdc-schema/src/schema/nmdc.yaml > target/nmdc_generated.yaml

WARNING:YAMLGenerator:Unrecognized prefix: rdfs WARNING:YAMLGenerator:Unrecognized prefix: insdc.srs WARNING:YAMLGenerator:Unrecognized prefix: mgnify WARNING:YAMLGenerator:Unrecognized prefix: UniProtKB WARNING:YAMLGenerator:Unrecognized prefix: gtpo WARNING:YAMLGenerator:Unrecognized prefix: COG WARNING:YAMLGenerator:Unrecognized prefix: MetaCyc WARNING:YAMLGenerator:Unrecognized prefix: EC WARNING:YAMLGenerator:Unrecognized prefix: MetaNetX WARNING:YAMLGenerator:Unrecognized prefix: RetroRules

turbomam commented 1 year ago

I think I have eliminated these warnings by adding placeholder expansions for those prefixes.

There are no warnings or errors from this now:

poetry run gen-linkml --format yaml  src/schema/nmdc.yaml > /dev/null

poetry run gen-yaml src/schema/nmdc.yaml > /dev/null actually errors out now

poetry run gen-yaml src/schema/nmdc.yaml > /dev/null
INFO:root:class "database" slot "nmdc schema version" does not reference an existing slot. New slot was created. INFO:root:class "database" slot "date created" does not reference an existing slot. New slot was created. INFO:root:class "database" slot "etl software version" does not reference an existing slot. New slot was created. INFO:root:class "study" slot "notes" does not reference an existing slot. New slot was created. INFO:root:class "pathway" slot "has_part" does not reference an existing slot. New slot was created. INFO:root:class "reaction participant" slot "chemical" does not reference an existing slot. New slot was created. INFO:root:class "reaction participant" slot "stoichiometry" does not reference an existing slot. New slot was created. INFO:root:class "metaproteomics analysis activity" slot "has peptide quantifications" does not reference an existing slot. New slot was created. Traceback (most recent call last): File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/bin/gen-yaml", line 8, in sys.exit(cli()) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/linkml/generators/yamlgen.py", line 46, in cli print(gen.serialize(args)) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/linkml/generators/yamlgen.py", line 30, in serialize return as_yaml(self.schema) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 285, in as_yaml return yaml.dump(element, Dumper=yaml.SafeDumper, sort_keys=False) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/init.py", line 253, in dump return dump_all([data], stream, Dumper=Dumper, **kwds) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/init.py", line 241, in dump_all dumper.represent(data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 27, in represent node = self.represent_data(data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 52, in represent_data node = self.yaml_multi_representers[data_type](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 269, in root_representer return dumper.represent_data(rval) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 48, in represent_data node = self.yaml_representers[data_types[0]](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 207, in represent_dict return self.represent_mapping('tag:yaml.org,2002:map', data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 118, in represent_mapping node_value = self.represent_data(item_value) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 48, in represent_data node = self.yaml_representers[data_types[0]](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 207, in represent_dict return self.represent_mapping('tag:yaml.org,2002:map', data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 118, in represent_mapping node_value = self.represent_data(item_value) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 52, in represent_data node = self.yaml_multi_representers[data_type](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/linkml_runtime/utils/yamlutils.py", line 269, in root_representer return dumper.represent_data(rval) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 48, in represent_data node = self.yaml_representers[data_types[0]](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 207, in represent_dict return self.represent_mapping('tag:yaml.org,2002:map', data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 118, in represent_mapping node_value = self.represent_data(item_value) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 58, in represent_data node = self.yaml_representers[None](self, data) File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/nmdc-schema-MTtWF7zd-py3.9/lib/python3.9/site-packages/yaml/representer.py", line 231, in represent_undefined raise RepresenterError("cannot represent an object", data) yaml.representer.RepresenterError: ('cannot represent an object', JsonObj(expected_value=Annotation(tag='expected_value', value='decimal degrees, limit to 8 decimal points', extensions={}, annotations={}))) (nmdc-schema-MTtWF7zd-py3.9)