Skip to content

Commit

Permalink
Merge pull request #292 from microbiomedata/issue-291-mixs-submod
Browse files Browse the repository at this point in the history
Integrate MIxS 6 submodule with nmdc-schema, make new import
  • Loading branch information
turbomam authored May 13, 2022
2 parents f2f7ec3 + 6e47d83 commit ef3883b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions util/rebuild_mixs_yaml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pprint

import pandas as pd
from linkml_runtime import SchemaView
Expand Down Expand Up @@ -175,12 +174,15 @@ def cli(
logger.warning(exc)

for i in rwn_lod:
logger.info(i)
temp = nmdc_dict["classes"][i["class"]]["slots"]
# pprint.pprint(temp)
temp.remove(i["slot_raw"])
temp.append(i["match"])
nmdc_dict["classes"][i["class"]]["slots"] = temp
try:
logger.info(i)
temp = nmdc_dict['classes'][i['class']]['slots']
temp.remove(i['slot_raw'])
temp.append(i['match'])
nmdc_dict['classes'][i['class']]['slots'] = temp
except ValueError:
logger.error(f"'slot_row' not in {i}")

# todo save to a different file?
# flow style?
with open(current_nmdc_root_in, "w") as outfile:
Expand Down Expand Up @@ -270,9 +272,6 @@ def cli(
] = mixs_5_view.schema.slots[current_slot_name][current_use_legacy]
rebuild_mixs_schema.slots[current_slot_name].see_also.append(legacy_see_also)

# todo this is way too ad-hoc
rebuild_mixs_schema.slots["add_recov_method"].pattern = None

yaml_dumper.dump(rebuild_mixs_schema, output_yaml)


Expand Down

0 comments on commit ef3883b

Please sign in to comment.