nmdc-schema 11.13.0__tar.gz → 11.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/PKG-INFO +4 -3
- nmdc_schema-11.14.0/nmdc_schema/migrators/migrator_from_11_13_0_to_11_14_0.py +35 -0
- nmdc_schema-11.14.0/nmdc_schema/migrators/partials/migrator_from_11_13_0_to_11_14_0/__init__.py +28 -0
- nmdc_schema-11.14.0/nmdc_schema/migrators/partials/migrator_from_11_13_0_to_11_14_0/migrator_from_11_13_0_to_11_14_0_part_1.py +113 -0
- nmdc_schema-11.14.0/nmdc_schema/migrators/partials/migrator_from_11_13_0_to_11_14_0/migrator_from_11_13_0_to_11_14_0_part_2.py +40 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc-pydantic.py +10148 -11316
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc.py +181 -27
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc.schema.json +83 -17
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_materialized_patterns.json +10826 -10717
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_materialized_patterns.schema.json +83 -16
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_materialized_patterns.yaml +7882 -7804
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/pyproject.toml +15 -12
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/LICENSE +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/README.md +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/README.md +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/anyuri_strings_to_iris.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/dump_single_modality.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/get_json_schema.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/get_nmdc_view.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/gold-to-mixs.sssom.tsv +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/id_helpers.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migration_recursion.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/.docker/.env.example +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/.docker/docker-compose.yaml +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/.docker/mongoKeyFile +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/.docker/mongo_init/initialize_replica_set.sh +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/.docker/wait-for-it.sh +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/README.md +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/adapters/adapter_base.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/adapters/dictionary_adapter.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/adapters/mongo_adapter.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/adapters/test_dictionary_adapter.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/adapters/test_mongo_adapter.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/assets/migrator_from_10_2_0_to_11_0_0_part_08/instrument_set.yaml +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/assets/migrator_from_11_7_to_11_8/data_category_map.yaml +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/assets/migrator_from_8_1_to_9_0/study_dois_changes.yaml +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/assets/migrator_from_9_1_to_9_2/websites_dois.yaml +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/cli/README.md +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/cli/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/cli/create_migrator.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/cli/migrator.py.template +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/cli/run_migrator.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/helpers.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migration_reporter.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_base.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_0_0_to_10_1_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_2_0_to_11_0_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_3_0_to_10_4_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_4_0_to_10_5_4.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_5_4_to_10_5_5.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_5_5_to_10_5_6.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_5_6_to_10_6_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_10_6_0_to_10_7_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_0_3_to_11_1_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_10_0_to_11_11_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_11_0_to_11_13_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_1_0_to_11_2_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_3_0_to_11_4_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_4_0_to_11_5_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_5_0_to_11_5_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_5_1_to_11_6_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_6_0_to_11_6_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_6_1_to_11_7_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_7_0_to_11_8_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_8_0_to_11_9_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_11_9_1_to_11_10_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_1_0_0_to_EXAMPLE.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_7_7_2_to_7_8_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_7_8_0_to_8_0_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_8_0_to_8_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_8_1_to_9_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_9_1_to_9_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/migrator_from_9_3_to_10_0.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/README.md +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_01.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_02.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_03.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_04.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_05.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_06.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_07.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_08.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_09.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_10.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_11.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_12.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_13.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_14.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_15.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_10_2_0_to_11_0_0/migrator_from_10_2_0_to_11_0_0_part_16.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_0_3_to_11_1_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_0_3_to_11_1_0/migrator_from_11_0_3_to_11_1_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_0_3_to_11_1_0/migrator_from_11_0_3_to_11_1_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_0_3_to_11_1_0/migrator_from_11_0_3_to_11_1_0_part_3.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_10_0_to_11_11_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_10_0_to_11_11_0/migrator_from_11_10_0_to_11_11_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_10_0_to_11_11_0/migrator_from_11_10_0_to_11_11_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_11_0_to_11_13_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_11_0_to_11_13_0/migrator_from_11_11_0_to_11_13_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_11_0_to_11_13_0/migrator_from_11_11_0_to_11_13_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_11_0_to_11_13_0/migrator_from_11_11_0_to_11_13_0_part_3.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_1_0_to_11_2_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_1_0_to_11_2_0/migrator_from_11_1_0_to_11_2_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_1_0_to_11_2_0/migrator_from_11_1_0_to_11_2_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_5_1_to_11_6_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_5_1_to_11_6_0/migrator_from_11_5_1_to_11_6_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_5_1_to_11_6_0/migrator_from_11_5_1_to_11_6_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/migrator_from_11_7_0_to_11_8_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/migrator_from_11_7_0_to_11_8_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/migrator_from_11_7_0_to_11_8_0_part_3.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/migrator_from_11_7_0_to_11_8_0_part_4.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_7_0_to_11_8_0/migrator_from_11_7_0_to_11_8_0_part_5.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_8_0_to_11_9_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_8_0_to_11_9_0/migrator_from_11_8_0_to_11_9_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_8_0_to_11_9_0/migrator_from_11_8_0_to_11_9_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_9_1_to_11_10_0/__init__.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_9_1_to_11_10_0/migrator_from_11_9_1_to_11_10_0_part_1.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_9_1_to_11_10_0/migrator_from_11_9_1_to_11_10_0_part_2.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/migrators/partials/migrator_from_11_9_1_to_11_10_0/migrator_from_11_9_1_to_11_10_0_part_3.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_data.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_schema_validation_plugin.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/nmdc_version.py +0 -0
- {nmdc_schema-11.13.0 → nmdc_schema-11.14.0}/nmdc_schema/validate_nmdc_json.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nmdc_schema
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.14.0
|
|
4
4
|
Summary: Schema resources for the National Microbiome Data Collaborative (NMDC)
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -25,13 +25,14 @@ Requires-Dist: curies (>=0.9.0,<0.10.0)
|
|
|
25
25
|
Requires-Dist: deprecated (>=1,<2)
|
|
26
26
|
Requires-Dist: jsonasobj2 (>=1,<2)
|
|
27
27
|
Requires-Dist: jsonschema (>=4,<5)
|
|
28
|
-
Requires-Dist: linkml (>=1.9.
|
|
29
|
-
Requires-Dist: linkml-runtime (>=1.9.
|
|
28
|
+
Requires-Dist: linkml (>=1.9.6,<2.0.0)
|
|
29
|
+
Requires-Dist: linkml-runtime (>=1.9.5,<2.0.0)
|
|
30
30
|
Requires-Dist: pymongo (>=4.7.2,<5.0.0)
|
|
31
31
|
Requires-Dist: python-dotenv
|
|
32
32
|
Requires-Dist: pyyaml (>=6,<7)
|
|
33
33
|
Requires-Dist: rdflib (>=6.2.0,<7.0.0)
|
|
34
34
|
Requires-Dist: requests (>=2,<3)
|
|
35
|
+
Requires-Dist: urllib3 (>=2.6.0)
|
|
35
36
|
Project-URL: Documentation, https://microbiomedata.github.io/nmdc-schema/
|
|
36
37
|
Project-URL: Homepage, https://microbiomedata.github.io/nmdc-schema/
|
|
37
38
|
Project-URL: Repository, https://github.com/microbiomedata/nmdc-schema
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from nmdc_schema.migrators.migrator_base import MigratorBase
|
|
2
|
+
from nmdc_schema.migrators.partials.migrator_from_11_13_0_to_11_14_0 import (
|
|
3
|
+
get_migrator_classes,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migrator(MigratorBase):
|
|
8
|
+
r"""
|
|
9
|
+
Migrates a database between two schemas.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
_from_version = "11.13.0"
|
|
13
|
+
_to_version = "11.14.0"
|
|
14
|
+
|
|
15
|
+
def upgrade(self, commit_changes: bool = False) -> None:
|
|
16
|
+
r"""
|
|
17
|
+
Migrates the database from conforming to the original schema, to conforming to the new schema.
|
|
18
|
+
|
|
19
|
+
This migrator uses partial migrators. It runs them in the order in which they are returned by
|
|
20
|
+
the `get_migrator_classes` function.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
commit_changes: If True, commits the changes. If False (default), performs a dry run or rollback.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
migrator_classes = get_migrator_classes()
|
|
27
|
+
num_migrators = len(migrator_classes)
|
|
28
|
+
for idx, migrator_class in enumerate(migrator_classes):
|
|
29
|
+
self.logger.info(f"Running migrator {idx + 1} of {num_migrators}")
|
|
30
|
+
self.logger.debug(
|
|
31
|
+
f"Migrating from {migrator_class.get_origin_version()} "
|
|
32
|
+
f"to {migrator_class.get_destination_version()}"
|
|
33
|
+
)
|
|
34
|
+
migrator = migrator_class(adapter=self.adapter, logger=self.logger)
|
|
35
|
+
migrator.upgrade(commit_changes=commit_changes)
|
nmdc_schema-11.14.0/nmdc_schema/migrators/partials/migrator_from_11_13_0_to_11_14_0/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from typing import List, Type
|
|
2
|
+
|
|
3
|
+
from nmdc_schema.migrators.migrator_base import MigratorBase
|
|
4
|
+
from nmdc_schema.migrators.partials.migrator_from_11_13_0_to_11_14_0 import (
|
|
5
|
+
migrator_from_11_13_0_to_11_14_0_part_1,
|
|
6
|
+
migrator_from_11_13_0_to_11_14_0_part_2
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_migrator_classes() -> List[Type[MigratorBase]]:
|
|
11
|
+
r"""
|
|
12
|
+
Returns a list of migrator classes in the order in which they (i.e. their `upgrade` methods)
|
|
13
|
+
were designed to be run.
|
|
14
|
+
|
|
15
|
+
>>> migrator_classes = get_migrator_classes()
|
|
16
|
+
>>> type(migrator_classes) is list and len(migrator_classes) > 0 # the function returns a list
|
|
17
|
+
True
|
|
18
|
+
>>> from inspect import isclass
|
|
19
|
+
>>> all(isclass(c) for c in migrator_classes) # each list item is a class
|
|
20
|
+
True
|
|
21
|
+
>>> all(callable(getattr(c, "upgrade")) for c in migrator_classes) # each class has an `upgrade` method
|
|
22
|
+
True
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
return [
|
|
26
|
+
migrator_from_11_13_0_to_11_14_0_part_1.Migrator,
|
|
27
|
+
migrator_from_11_13_0_to_11_14_0_part_2.Migrator
|
|
28
|
+
]
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
from linkml.validator import Validator
|
|
2
|
+
|
|
3
|
+
from nmdc_schema.migrators.migrator_base import MigratorBase
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from nmdc_schema.migrators.helpers import create_schema_view, get_classes_with_slots_by_range, \
|
|
7
|
+
get_database_collections_for_class
|
|
8
|
+
from nmdc_schema import NmdcSchemaValidationPlugin
|
|
9
|
+
|
|
10
|
+
project_root = Path(__file__).parent.parent.parent
|
|
11
|
+
sys.path.insert(0, str(project_root))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Migrator(MigratorBase):
|
|
15
|
+
r"""A check-only migrator that raises an exception if any QuantityValue's has_unit slot
|
|
16
|
+
is not valid against the slot's storage_unit or UnitEnum constraints."""
|
|
17
|
+
|
|
18
|
+
_from_version = '11.13.0'
|
|
19
|
+
_to_version = '11.14.0_part_1'
|
|
20
|
+
|
|
21
|
+
def __init__(self, *args, **kwargs):
|
|
22
|
+
super().__init__(*args, **kwargs)
|
|
23
|
+
|
|
24
|
+
self.schema_view = create_schema_view()
|
|
25
|
+
self.validator = Validator(
|
|
26
|
+
self.schema_view.schema,
|
|
27
|
+
# This is intentionally *only* using the NMDC plugin, because this migrator is *only*
|
|
28
|
+
# concerned with validating the QuantityValue-related constraints that the plugin
|
|
29
|
+
# implements.
|
|
30
|
+
validation_plugins=[
|
|
31
|
+
NmdcSchemaValidationPlugin()
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
def upgrade(self, commit_changes: bool = False) -> None:
|
|
36
|
+
r'''
|
|
37
|
+
Migrates the database from conforming to the original schema, to conforming to the new schema.
|
|
38
|
+
'''
|
|
39
|
+
|
|
40
|
+
# Get the schema classes which have slots with range QuantityValue
|
|
41
|
+
classes_with_qv_slots = get_classes_with_slots_by_range(self.schema_view, 'QuantityValue')
|
|
42
|
+
|
|
43
|
+
# Get the Database collection names that can hold these classes
|
|
44
|
+
eligible_collection_names = set()
|
|
45
|
+
for class_name in classes_with_qv_slots.keys():
|
|
46
|
+
collection_names = get_database_collections_for_class(self.schema_view, class_name)
|
|
47
|
+
eligible_collection_names.update(collection_names)
|
|
48
|
+
|
|
49
|
+
# Apply migrator through collections
|
|
50
|
+
self.logger.info("Checking QuantityValue units against UnitEnum and storage_units constraints")
|
|
51
|
+
for collection_name in eligible_collection_names:
|
|
52
|
+
self.logger.info(f" Checking collection '{collection_name}'")
|
|
53
|
+
self.adapter.do_for_each_document(collection_name, self.confirm_units_fit_unitenum_and_storage_units)
|
|
54
|
+
|
|
55
|
+
def confirm_units_fit_unitenum_and_storage_units(self, document: dict) -> None:
|
|
56
|
+
r'''
|
|
57
|
+
Raise an exception if the QuantityValue's has_unit slot is not valid against slot's storage_unit or UnitEnum constraints.
|
|
58
|
+
|
|
59
|
+
>>> m = Migrator()
|
|
60
|
+
|
|
61
|
+
# Test: valid QuantityValue with proper units in biosample
|
|
62
|
+
>>> valid_biosample = {
|
|
63
|
+
... "id": "test1",
|
|
64
|
+
... "type": "nmdc:Biosample",
|
|
65
|
+
... "bulk_elect_conductivity": {
|
|
66
|
+
... "type": "nmdc:QuantityValue",
|
|
67
|
+
... "has_unit": "mS/cm",
|
|
68
|
+
... "has_numeric_value": 25.0
|
|
69
|
+
... }
|
|
70
|
+
... }
|
|
71
|
+
>>> m.confirm_units_fit_unitenum_and_storage_units(valid_biosample) # Should not raise
|
|
72
|
+
|
|
73
|
+
# Test: unit not allowed for bulk_elect_conductivity's storage_units
|
|
74
|
+
>>> invalid_biosample_storage = {
|
|
75
|
+
... "id": "test2",
|
|
76
|
+
... "type": "nmdc:Biosample",
|
|
77
|
+
... "bulk_elect_conductivity": {
|
|
78
|
+
... "type": "nmdc:QuantityValue",
|
|
79
|
+
... "has_unit": "Cel",
|
|
80
|
+
... "has_numeric_value": 25.0
|
|
81
|
+
... }
|
|
82
|
+
... }
|
|
83
|
+
>>> m.confirm_units_fit_unitenum_and_storage_units(invalid_biosample_storage)
|
|
84
|
+
Traceback (most recent call last):
|
|
85
|
+
...
|
|
86
|
+
ValueError: In test2:
|
|
87
|
+
QuantityValue at /bulk_elect_conductivity has unit 'Cel' which is not allowed for slot 'bulk_elect_conductivity' (allowed: mS/cm)
|
|
88
|
+
|
|
89
|
+
# Test: unit not allowed for substances_volume's storage_units
|
|
90
|
+
>>> invalid_chem_storage = {
|
|
91
|
+
... "id": "test3",
|
|
92
|
+
... "type": "nmdc:ChemicalConversionProcess",
|
|
93
|
+
... "substances_volume": {
|
|
94
|
+
... "type": "nmdc:QuantityValue",
|
|
95
|
+
... "has_unit": "J/K", # Wrong unit type for substances_volume
|
|
96
|
+
... "has_numeric_value": 25.0
|
|
97
|
+
... }
|
|
98
|
+
... }
|
|
99
|
+
>>> m.confirm_units_fit_unitenum_and_storage_units(invalid_chem_storage)
|
|
100
|
+
Traceback (most recent call last):
|
|
101
|
+
...
|
|
102
|
+
ValueError: In test3:
|
|
103
|
+
QuantityValue at /substances_volume has unit 'J/K' which is not allowed for slot 'substances_volume' (allowed: mL)
|
|
104
|
+
'''
|
|
105
|
+
|
|
106
|
+
document_id = document.get('id', '<unknown id>')
|
|
107
|
+
document_type = document.get('type')
|
|
108
|
+
if not document_type:
|
|
109
|
+
raise ValueError(f"Unable to infer target_class for document with id '{document_id}'")
|
|
110
|
+
target_class = document_type.replace('nmdc:', '')
|
|
111
|
+
report = self.validator.validate(document, target_class)
|
|
112
|
+
if report.results:
|
|
113
|
+
raise ValueError(f"In {document_id}:\n" + "\n".join(" " + result.message for result in report.results))
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from nmdc_schema.migrators.migrator_base import MigratorBase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Migrator(MigratorBase):
|
|
5
|
+
r"""
|
|
6
|
+
Migrates a database between two schemas.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
_from_version = "11.14.0_part_1"
|
|
10
|
+
_to_version = "11.14.0_part_2"
|
|
11
|
+
|
|
12
|
+
def upgrade(self, commit_changes: bool = False) -> None:
|
|
13
|
+
r"""
|
|
14
|
+
Migrates the database from conforming to the original schema, to conforming to the new schema.
|
|
15
|
+
"""
|
|
16
|
+
self.adapter.do_for_each_document("processed_sample_set", self.confirm_empty)
|
|
17
|
+
|
|
18
|
+
def confirm_empty(self, processedsample: dict) -> None:
|
|
19
|
+
r"""
|
|
20
|
+
If a processedsample has a value for 'biomaterial_purity' raise an exception.
|
|
21
|
+
|
|
22
|
+
>>> m = Migrator()
|
|
23
|
+
|
|
24
|
+
# Test: processed sample has biomaterial_purity value
|
|
25
|
+
>>> m.confirm_empty({"id": 1, "type": "nmdc:ProcessedSample", "biomaterial_purity": ["Test_Value"]})
|
|
26
|
+
Traceback (most recent call last):
|
|
27
|
+
...
|
|
28
|
+
ValueError: Biosample 1 'biomaterial_purity' values include: ['Test_Value']
|
|
29
|
+
|
|
30
|
+
# Test: valid processedsample
|
|
31
|
+
>>> m.confirm_empty({"id": 3, "type": "nmdc:ProcessedSample"}) is None
|
|
32
|
+
True
|
|
33
|
+
"""
|
|
34
|
+
bp_values = processedsample.get("biomaterial_purity", [])
|
|
35
|
+
biosample_id = processedsample.get("id")
|
|
36
|
+
|
|
37
|
+
if len(bp_values)>0:
|
|
38
|
+
raise ValueError(
|
|
39
|
+
f"Biosample {biosample_id} 'biomaterial_purity' values include: {bp_values}"
|
|
40
|
+
)
|