From b1329f55298c6675c8e19a89488c681df3270413 Mon Sep 17 00:00:00 2001 From: Mark Andrew Miller Date: Fri, 13 May 2022 08:55:22 -0400 Subject: [PATCH] lock in version 4.0.0 and don't generate python for mixs legacy or new --- json/nmdc.linkml.json | 313 +++++++++++++++-------- jsonld-context/nmdc.context.jsonld | 2 +- jsonschema/nmdc.schema.json | 19 +- python/basic_slots.py | 2 +- python/core.py | 2 +- python/nmdc.py | 63 ++++- python/workflow_execution_activity.py | 2 +- {src/schema => reports}/mixs_legacy.yaml | 0 {src/schema => reports}/mixs_new.yaml | 0 9 files changed, 281 insertions(+), 122 deletions(-) rename {src/schema => reports}/mixs_legacy.yaml (100%) rename {src/schema => reports}/mixs_new.yaml (100%) diff --git a/json/nmdc.linkml.json b/json/nmdc.linkml.json index d032241425..7d9a8008e1 100644 --- a/json/nmdc.linkml.json +++ b/json/nmdc.linkml.json @@ -1,9 +1,9 @@ { "name": "NMDC", - "description": "Schema for National Microbiome Data Collaborative (NMDC).\n \nThis schema is organized into distinct modules:\n \n * a set of core types for representing data values\n * the mixs schema (auto-translated from mixs excel)\n * annotation schema\n * the NMDC schema itself", + "description": "Schema for National Microbiome Data Collaborative (NMDC).\nThis schema is organized into distinct modules:\n\n * a set of core types for representing data values\n * the mixs schema (auto-translated from mixs excel)\n * annotation schema\n * the NMDC schema itself", "title": "NMDC Schema", "id": "https://microbiomedata/schema", - "version": "2.1.0", + "version": "4.0.0", "license": "https://creativecommons.org/publicdomain/zero/1.0/", "prefixes": { "nmdc": { @@ -3480,6 +3480,12 @@ }, "has credit associations": { "name": "has credit associations", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Other researchers associated with this study." + } + }, "description": "This slot links a study to a credit association. The credit association will be linked to a person value and to a CRediT Contributor Roles term. Overall semantics: person should get credit X for their participation in the study", "from_schema": "https://microbiomedata/schema", "domain": "study", @@ -3521,6 +3527,12 @@ }, "applied roles": { "name": "applied roles", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Identify all CRediT roles associated with this contributor. CRediT Information: https://info.orcid.org/credit-for-research-contribution ; CRediT: https://credit.niso.org/" + } + }, "from_schema": "https://microbiomedata/schema", "domain": "credit association", "multivalued": true, @@ -3693,7 +3705,7 @@ }, "read based analysis activity set": { "name": "read based analysis activity set", - "description": "This property links a database object to the set of read based analysis activities.\n ", + "description": "This property links a database object to the set of read based analysis activities.", "from_schema": "https://microbiomedata/schema", "mixins": [ "object set" @@ -3768,12 +3780,12 @@ }, "instrument_name": { "name": "instrument_name", - "description": "The name of the instrument that was used for processing the sample.\n ", + "description": "The name of the instrument that was used for processing the sample.", "from_schema": "https://microbiomedata/schema" }, "gold_path_field": { "name": "gold_path_field", - "description": "This is a grouping for any of the gold path fields ", + "description": "This is a grouping for any of the gold path fields", "from_schema": "https://microbiomedata/schema", "is_a": "attribute", "abstract": true, @@ -21229,7 +21241,7 @@ }, "read based analysis activity set": { "name": "read based analysis activity set", - "description": "This property links a database object to the set of read based analysis activities.\n ", + "description": "This property links a database object to the set of read based analysis activities.", "from_schema": "https://microbiomedata/schema", "mixins": [ "object set" @@ -21607,8 +21619,10 @@ "tot_org_carb", "tot_org_c_meth", "tot_nitro_content", + "tot_nitro_cont_meth", "tot_phosp", "water_content", + "water_cont_soil_meth", "ecosystem", "ecosystem_category", "ecosystem_type", @@ -21631,9 +21645,7 @@ "subsurface_depth2", "GOLD sample identifiers", "INSDC biosample identifiers", - "INSDC secondary sample identifiers", - "tot_nitro_cont_meth", - "water_cont_soil_meth" + "INSDC secondary sample identifiers" ], "slot_usage": { "lat_lon": { @@ -25564,6 +25576,40 @@ "owner": "biosample", "range": "quantity value" }, + "tot_nitro_cont_meth": { + "name": "tot_nitro_cont_meth", + "aliases": [ + "total nitrogen content method" + ], + "annotations": { + "expected_value": { + "tag": "expected_value", + "value": "PMID,DOI or url" + }, + "occurrence": { + "tag": "occurrence", + "value": "1" + }, + "mixs_5_name": { + "tag": "mixs_5_name", + "value": "tot_nitro_content_meth" + } + }, + "description": "Reference or method used in determining the total nitrogen", + "title": "total nitrogen content method", + "from_schema": "https://microbiomedata/schema", + "source": "http://w3id.org/mixs/terms", + "see_also": [ + "https://github.com/microbiomedata/nmdc-schema/blob/issue-291-mixs-submod/util/rebuild_mixs_yaml.py" + ], + "is_a": "core field", + "string_serialization": "{PMID}|{DOI}|{URL}", + "slot_uri": "MIXS:0000338", + "multivalued": false, + "alias": "tot_nitro_cont_meth", + "owner": "biosample", + "range": "string" + }, "tot_phosp": { "name": "tot_phosp", "aliases": [ @@ -25635,6 +25681,40 @@ "owner": "biosample", "range": "quantity value" }, + "water_cont_soil_meth": { + "name": "water_cont_soil_meth", + "aliases": [ + "water content method" + ], + "annotations": { + "expected_value": { + "tag": "expected_value", + "value": "PMID,DOI or url" + }, + "occurrence": { + "tag": "occurrence", + "value": "1" + }, + "mixs_5_name": { + "tag": "mixs_5_name", + "value": "water_content_soil_meth" + } + }, + "description": "Reference or method used in determining the water content of soil", + "title": "water content method", + "from_schema": "https://microbiomedata/schema", + "source": "http://w3id.org/mixs/terms", + "see_also": [ + "https://github.com/microbiomedata/nmdc-schema/blob/issue-291-mixs-submod/util/rebuild_mixs_yaml.py" + ], + "is_a": "core field", + "string_serialization": "{PMID}|{DOI}|{URL}", + "slot_uri": "MIXS:0000323", + "multivalued": false, + "alias": "water_cont_soil_meth", + "owner": "biosample", + "range": "string" + }, "ecosystem": { "name": "ecosystem", "description": "An ecosystem is a combination of a physical environment (abiotic factors) and all the organisms (biotic factors) that interact with this environment. Ecosystem is in position 1/5 in a GOLD path.", @@ -25898,74 +25978,6 @@ "range": "external identifier", "pattern": "^biosample:(E|D|S)RS[0-9]{6,}$" }, - "tot_nitro_cont_meth": { - "name": "tot_nitro_cont_meth", - "aliases": [ - "total nitrogen content method" - ], - "annotations": { - "expected_value": { - "tag": "expected_value", - "value": "PMID,DOI or url" - }, - "occurrence": { - "tag": "occurrence", - "value": "1" - }, - "mixs_5_name": { - "tag": "mixs_5_name", - "value": "tot_nitro_content_meth" - } - }, - "description": "Reference or method used in determining the total nitrogen", - "title": "total nitrogen content method", - "from_schema": "https://microbiomedata/schema", - "source": "http://w3id.org/mixs/terms", - "see_also": [ - "https://github.com/microbiomedata/nmdc-schema/blob/issue-291-mixs-submod/util/rebuild_mixs_yaml.py" - ], - "is_a": "core field", - "string_serialization": "{PMID}|{DOI}|{URL}", - "slot_uri": "MIXS:0000338", - "multivalued": false, - "alias": "tot_nitro_cont_meth", - "owner": "biosample", - "range": "string" - }, - "water_cont_soil_meth": { - "name": "water_cont_soil_meth", - "aliases": [ - "water content method" - ], - "annotations": { - "expected_value": { - "tag": "expected_value", - "value": "PMID,DOI or url" - }, - "occurrence": { - "tag": "occurrence", - "value": "1" - }, - "mixs_5_name": { - "tag": "mixs_5_name", - "value": "water_content_soil_meth" - } - }, - "description": "Reference or method used in determining the water content of soil", - "title": "water content method", - "from_schema": "https://microbiomedata/schema", - "source": "http://w3id.org/mixs/terms", - "see_also": [ - "https://github.com/microbiomedata/nmdc-schema/blob/issue-291-mixs-submod/util/rebuild_mixs_yaml.py" - ], - "is_a": "core field", - "string_serialization": "{PMID}|{DOI}|{URL}", - "slot_uri": "MIXS:0000323", - "multivalued": false, - "alias": "water_cont_soil_meth", - "owner": "biosample", - "range": "string" - }, "id": { "name": "id", "description": "A unique identifier for a thing. Must be either a CURIE shorthand for a URI or a complete URI", @@ -26025,7 +26037,7 @@ "broad_mappings": [ "prov:Activity" ], - "description": "A study summarizes the overall goal of a research initiative and outlines the key objective of its underlying projects. ", + "description": "A study summarizes the overall goal of a research initiative and outlines the key objective of its underlying projects.", "alt_descriptions": { "embl.ena": { "source": "embl.ena", @@ -26071,7 +26083,76 @@ "slot_usage": { "doi": { "name": "doi", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "DOI associated with the data in this study. This is required when data is already generated." + } + }, "description": "The dataset citation for this study" + }, + "name": { + "name": "name", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide a name for the study your samples will belong with." + } + } + }, + "websites": { + "name": "websites", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Link to the Principal Investigator's research lab webpage or the study webpage associated with this collection of samples. Multiple links can be provided." + } + } + }, + "description": { + "name": "description", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide a brief description of your study." + } + } + }, + "notes": { + "name": "notes", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Add any additional notes or comments about this study." + } + } + }, + "alternative names": { + "name": "alternative names", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Project, study, or sample set names the are also associated with this submission or other names / identifiers for this study." + } + } + }, + "GOLD sample identifiers": { + "name": "GOLD sample identifiers", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide the GOLD study IDs associated with samples for this study." + } + } + }, + "INSDC bioproject identifiers": { + "name": "INSDC bioproject identifiers", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide the NCBI BioProject Accession Number associated with the listed NCBI BioProject Title." + } + } } }, "attributes": { @@ -26164,6 +26245,12 @@ }, "doi": { "name": "doi", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "DOI associated with the data in this study. This is required when data is already generated." + } + }, "description": "The dataset citation for this study", "from_schema": "https://microbiomedata/schema", "is_a": "attribute", @@ -26206,10 +26293,12 @@ }, "alternative names": { "name": "alternative names", - "exact_mappings": [ - "dcterms:alternative", - "skos:altLabel" - ], + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Project, study, or sample set names the are also associated with this submission or other names / identifiers for this study." + } + }, "description": "A list of alternative names used to refer to the entity. The distinction between name and alternative names is application-specific.", "from_schema": "https://microbiomedata/schema", "multivalued": true, @@ -26242,6 +26331,12 @@ }, "websites": { "name": "websites", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Link to the Principal Investigator's research lab webpage or the study webpage associated with this collection of samples. Multiple links can be provided." + } + }, "description": "A list of websites that are associated with the entity.", "from_schema": "https://microbiomedata/schema", "multivalued": true, @@ -26303,29 +26398,15 @@ }, "INSDC bioproject identifiers": { "name": "INSDC bioproject identifiers", - "aliases": [ - "NCBI bioproject identifiers", - "DDBJ bioproject identifiers" - ], - "description": "identifiers for corresponding project in INSDC Bioproject", - "comments": [ - "these are distinct IDs from INSDC SRA/ENA project identifiers, but are usually(?) one to one" - ], - "examples": [ - { - "value": "https://identifiers.org/bioproject:PRJNA366857", - "description": "Avena fatua rhizosphere microbial communities - H1_Rhizo_Litter_2 metatranscriptome" + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide the NCBI BioProject Accession Number associated with the listed NCBI BioProject Title." } - ], + }, + "description": "identifiers for corresponding project in INSDC Bioproject", "from_schema": "https://microbiomedata/schema", - "see_also": [ - "https://www.ncbi.nlm.nih.gov/bioproject/", - "https://www.ddbj.nig.ac.jp/bioproject/index-e.html" - ], "is_a": "study identifiers", - "mixins": [ - "INSDC identifiers" - ], "multivalued": true, "alias": "INSDC_bioproject_identifiers", "owner": "study", @@ -26402,6 +26483,12 @@ }, "has credit associations": { "name": "has credit associations", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Other researchers associated with this study." + } + }, "description": "This slot links a study to a credit association. The credit association will be linked to a person value and to a CRediT Contributor Roles term. Overall semantics: person should get credit X for their participation in the study", "from_schema": "https://microbiomedata/schema", "domain": "study", @@ -26435,6 +26522,12 @@ }, "name": { "name": "name", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide a name for the study your samples will belong with." + } + }, "description": "A human readable label for an entity", "from_schema": "https://microbiomedata/schema", "multivalued": false, @@ -26444,6 +26537,12 @@ }, "description": { "name": "description", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Provide a brief description of your study." + } + }, "description": "a human-readable description of a thing", "from_schema": "https://microbiomedata/schema", "slot_uri": "dcterms:description", @@ -26634,7 +26733,7 @@ }, "instrument_name": { "name": "instrument_name", - "description": "The name of the instrument that was used for processing the sample.\n ", + "description": "The name of the instrument that was used for processing the sample.", "from_schema": "https://microbiomedata/schema", "alias": "instrument_name", "owner": "omics processing", @@ -27107,7 +27206,7 @@ "credit table", "associated researchers" ], - "description": "This class supports binding associated researchers to studies. There will be at least a slot for a CRediT Contributor Role (https://casrai.org/credit/) and for a person value Specifically see the associated researchers tab on the NMDC_SampleMetadata-V4_CommentsForUpdates at https://docs.google.com/spreadsheets/d/1INlBo5eoqn2efn4H2P2i8rwRBtnbDVTqXrochJEAPko/edit#gid=0 ", + "description": "This class supports binding associated researchers to studies. There will be at least a slot for a CRediT Contributor Role (https://casrai.org/credit/) and for a person value Specifically see the associated researchers tab on the NMDC_SampleMetadata-V4_CommentsForUpdates at https://docs.google.com/spreadsheets/d/1INlBo5eoqn2efn4H2P2i8rwRBtnbDVTqXrochJEAPko/edit#gid=0", "from_schema": "https://microbiomedata/schema", "slots": [ "applies to person", @@ -27144,6 +27243,12 @@ }, "applied roles": { "name": "applied roles", + "annotations": { + "display_hint": { + "tag": "display_hint", + "value": "Identify all CRediT roles associated with this contributor. CRediT Information: https://info.orcid.org/credit-for-research-contribution ; CRediT: https://credit.niso.org/" + } + }, "from_schema": "https://microbiomedata/schema", "domain": "credit association", "multivalued": true, diff --git a/jsonld-context/nmdc.context.jsonld b/jsonld-context/nmdc.context.jsonld index 0fe8bb17a2..74cc4b7073 100644 --- a/jsonld-context/nmdc.context.jsonld +++ b/jsonld-context/nmdc.context.jsonld @@ -1,5 +1,5 @@ { - "_comments": "Auto generated from nmdc.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2022-05-06T11:21:32\n Schema: NMDC\n metamodel version: 1.7.0\n model version: 2.1.0\n \n id: https://microbiomedata/schema\n description: Schema for National Microbiome Data Collaborative (NMDC).\n \nThis schema is organized into distinct modules:\n \n * a set of core types for representing data values\n * the mixs schema (auto-translated from mixs excel)\n * annotation schema\n * the NMDC schema itself\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", + "_comments": "Auto generated from nmdc.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2022-05-13T08:53:07\n Schema: NMDC\n metamodel version: 1.7.0\n model version: 4.0.0\n \n id: https://microbiomedata/schema\n description: Schema for National Microbiome Data Collaborative (NMDC).\nThis schema is organized into distinct modules:\n\n * a set of core types for representing data values\n * the mixs schema (auto-translated from mixs excel)\n * annotation schema\n * the NMDC schema itself\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", "@context": { "CAS": "http://identifiers.org/cas/", "CATH": "http://identifiers.org/cath/", diff --git a/jsonschema/nmdc.schema.json b/jsonschema/nmdc.schema.json index 37bd324573..b04dc86173 100644 --- a/jsonschema/nmdc.schema.json +++ b/jsonschema/nmdc.schema.json @@ -1230,7 +1230,7 @@ "type": "array" }, "read_based_analysis_activity_set": { - "description": "This property links a database object to the set of read based analysis activities.\n ", + "description": "This property links a database object to the set of read based analysis activities.", "items": { "$ref": "#/$defs/ReadBasedAnalysisActivity" }, @@ -3238,7 +3238,7 @@ "type": "string" }, "instrument_name": { - "description": "The name of the instrument that was used for processing the sample.\n ", + "description": "The name of the instrument that was used for processing the sample.", "type": "string" }, "mod_date": { @@ -4298,6 +4298,14 @@ "additionalProperties": false, "description": "A study summarizes the overall goal of a research initiative and outlines the key objective of its underlying projects.", "properties": { + "GOLD_sample_identifiers": { + "description": "identifiers for corresponding sample in GOLD", + "items": { + "type": "string" + }, + "pattern": "^GOLD:Gb[0-9]+$", + "type": "array" + }, "GOLD_study_identifiers": { "description": "identifiers for corresponding project in GOLD", "items": { @@ -4414,6 +4422,9 @@ "description": "A human readable label for an entity", "type": "string" }, + "notes": { + "type": "string" + }, "objective": { "description": "The scientific objectives associated with the entity. It SHOULD correspond to scientific norms for objectives field in a structured abstract.", "type": "string" @@ -5028,7 +5039,7 @@ "type": "array" }, "read_based_analysis_activity_set": { - "description": "This property links a database object to the set of read based analysis activities.\n ", + "description": "This property links a database object to the set of read based analysis activities.", "items": { "$ref": "#/$defs/ReadBasedAnalysisActivity" }, @@ -5045,6 +5056,6 @@ "required": [], "title": "NMDC", "type": "object", - "version": "2.1.0" + "version": "4.0.0" } diff --git a/python/basic_slots.py b/python/basic_slots.py index 9d601b87cd..67166ca78c 100644 --- a/python/basic_slots.py +++ b/python/basic_slots.py @@ -1,5 +1,5 @@ # Auto generated from basic_slots.yaml by pythongen.py version: 0.9.0 -# Generation date: 2022-05-06T11:21:38 +# Generation date: 2022-05-13T08:53:13 # Schema: NMDC-Basic-Slots # # id: https://microbiomedata/schema/basic_slots diff --git a/python/core.py b/python/core.py index 16dd34a1aa..789bb876cb 100644 --- a/python/core.py +++ b/python/core.py @@ -1,5 +1,5 @@ # Auto generated from core.yaml by pythongen.py version: 0.9.0 -# Generation date: 2022-05-06T11:22:17 +# Generation date: 2022-05-13T08:53:26 # Schema: NMDC-Core # # id: https://microbiomedata/schema/core diff --git a/python/nmdc.py b/python/nmdc.py index a17bd51bd1..43be009653 100644 --- a/python/nmdc.py +++ b/python/nmdc.py @@ -1,5 +1,5 @@ # Auto generated from nmdc.yaml by pythongen.py version: 0.9.0 -# Generation date: 2022-05-06T11:22:11 +# Generation date: 2022-05-13T08:53:19 # Schema: NMDC # # id: https://microbiomedata/schema @@ -28,7 +28,7 @@ from linkml_runtime.utils.metamodelcore import Bool, URIorCURIE, XSDDateTime metamodel_version = "1.7.0" -version = "2.1.0" +version = "4.0.0" # Overwrite dataclasses _init_fn to add **kwargs in __init__ dataclasses._init_fn = dataclasses_init_fn_with_kwargs @@ -603,8 +603,10 @@ class Biosample(NamedThing): tot_org_carb: Optional[Union[dict, "QuantityValue"]] = None tot_org_c_meth: Optional[Union[dict, "TextValue"]] = None tot_nitro_content: Optional[Union[dict, "QuantityValue"]] = None + tot_nitro_cont_meth: Optional[str] = None tot_phosp: Optional[Union[dict, "QuantityValue"]] = None water_content: Optional[Union[dict, "QuantityValue"]] = None + water_cont_soil_meth: Optional[str] = None ecosystem: Optional[str] = None ecosystem_category: Optional[str] = None ecosystem_type: Optional[str] = None @@ -628,8 +630,6 @@ class Biosample(NamedThing): GOLD_sample_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list() INSDC_biosample_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list() INSDC_secondary_sample_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list() - tot_nitro_cont_meth: Optional[str] = None - water_cont_soil_meth: Optional[str] = None def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.id): @@ -998,12 +998,18 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self.tot_nitro_content is not None and not isinstance(self.tot_nitro_content, QuantityValue): self.tot_nitro_content = QuantityValue(**as_dict(self.tot_nitro_content)) + if self.tot_nitro_cont_meth is not None and not isinstance(self.tot_nitro_cont_meth, str): + self.tot_nitro_cont_meth = str(self.tot_nitro_cont_meth) + if self.tot_phosp is not None and not isinstance(self.tot_phosp, QuantityValue): self.tot_phosp = QuantityValue(**as_dict(self.tot_phosp)) if self.water_content is not None and not isinstance(self.water_content, QuantityValue): self.water_content = QuantityValue(**as_dict(self.water_content)) + if self.water_cont_soil_meth is not None and not isinstance(self.water_cont_soil_meth, str): + self.water_cont_soil_meth = str(self.water_cont_soil_meth) + if self.ecosystem is not None and not isinstance(self.ecosystem, str): self.ecosystem = str(self.ecosystem) @@ -1076,12 +1082,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.INSDC_secondary_sample_identifiers = [self.INSDC_secondary_sample_identifiers] if self.INSDC_secondary_sample_identifiers is not None else [] self.INSDC_secondary_sample_identifiers = [v if isinstance(v, ExternalIdentifier) else ExternalIdentifier(v) for v in self.INSDC_secondary_sample_identifiers] - if self.tot_nitro_cont_meth is not None and not isinstance(self.tot_nitro_cont_meth, str): - self.tot_nitro_cont_meth = str(self.tot_nitro_cont_meth) - - if self.water_cont_soil_meth is not None and not isinstance(self.water_cont_soil_meth, str): - self.water_cont_soil_meth = str(self.water_cont_soil_meth) - super().__post_init__(**kwargs) @@ -1124,6 +1124,10 @@ class Study(NamedThing): MGnify_project_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list() has_credit_associations: Optional[Union[Union[dict, "CreditAssociation"], List[Union[dict, "CreditAssociation"]]]] = empty_list() study_image: Optional[Union[Union[dict, "ImageValue"], List[Union[dict, "ImageValue"]]]] = empty_list() + name: Optional[str] = None + description: Optional[str] = None + notes: Optional[str] = None + GOLD_sample_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list() def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): if self._is_empty(self.id): @@ -1218,6 +1222,19 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): self.study_image = [self.study_image] if self.study_image is not None else [] self.study_image = [v if isinstance(v, ImageValue) else ImageValue(**as_dict(v)) for v in self.study_image] + if self.name is not None and not isinstance(self.name, str): + self.name = str(self.name) + + if self.description is not None and not isinstance(self.description, str): + self.description = str(self.description) + + if self.notes is not None and not isinstance(self.notes, str): + self.notes = str(self.notes) + + if not isinstance(self.GOLD_sample_identifiers, list): + self.GOLD_sample_identifiers = [self.GOLD_sample_identifiers] if self.GOLD_sample_identifiers is not None else [] + self.GOLD_sample_identifiers = [v if isinstance(v, ExternalIdentifier) else ExternalIdentifier(v) for v in self.GOLD_sample_identifiers] + super().__post_init__(**kwargs) @@ -7275,6 +7292,9 @@ class slots: slots.etl_software_version = Slot(uri=NMDC.etl_software_version, name="etl software version", curie=NMDC.curie('etl_software_version'), model_uri=NMDC.etl_software_version, domain=None, range=Optional[str]) +slots.notes = Slot(uri=NMDC.notes, name="notes", curie=NMDC.curie('notes'), + model_uri=NMDC.notes, domain=None, range=Optional[str]) + slots.metabolite_quantified = Slot(uri=NMDC.metabolite_quantified, name="metabolite quantified", curie=NMDC.curie('metabolite_quantified'), model_uri=NMDC.metabolite_quantified, domain=None, range=Optional[Union[str, ChemicalEntityId]]) @@ -7425,6 +7445,29 @@ class slots: slots.study_doi = Slot(uri=NMDC.doi, name="study_doi", curie=NMDC.curie('doi'), model_uri=NMDC.study_doi, domain=Study, range=Optional[Union[dict, "AttributeValue"]]) +slots.study_name = Slot(uri=NMDC.name, name="study_name", curie=NMDC.curie('name'), + model_uri=NMDC.study_name, domain=Study, range=Optional[str]) + +slots.study_websites = Slot(uri=NMDC.websites, name="study_websites", curie=NMDC.curie('websites'), + model_uri=NMDC.study_websites, domain=Study, range=Optional[Union[str, List[str]]]) + +slots.study_description = Slot(uri=DCTERMS.description, name="study_description", curie=DCTERMS.curie('description'), + model_uri=NMDC.study_description, domain=Study, range=Optional[str]) + +slots.study_notes = Slot(uri=NMDC.notes, name="study_notes", curie=NMDC.curie('notes'), + model_uri=NMDC.study_notes, domain=Study, range=Optional[str]) + +slots.study_alternative_names = Slot(uri=NMDC.alternative_names, name="study_alternative names", curie=NMDC.curie('alternative_names'), + model_uri=NMDC.study_alternative_names, domain=Study, range=Optional[Union[str, List[str]]]) + +slots.study_GOLD_sample_identifiers = Slot(uri=NMDC.GOLD_sample_identifiers, name="study_GOLD sample identifiers", curie=NMDC.curie('GOLD_sample_identifiers'), + model_uri=NMDC.study_GOLD_sample_identifiers, domain=Study, range=Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]], + pattern=re.compile(r'^GOLD:Gb[0-9]+$')) + +slots.study_INSDC_bioproject_identifiers = Slot(uri=NMDC.INSDC_bioproject_identifiers, name="study_INSDC bioproject identifiers", curie=NMDC.curie('INSDC_bioproject_identifiers'), + model_uri=NMDC.study_INSDC_bioproject_identifiers, domain=Study, range=Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]], + pattern=re.compile(r'^bioproject:PRJ[DEN][A-Z][0-9]+$')) + slots.biosample_processing_has_input = Slot(uri=NMDC.has_input, name="biosample processing_has input", curie=NMDC.curie('has_input'), model_uri=NMDC.biosample_processing_has_input, domain=BiosampleProcessing, range=Optional[Union[Union[str, BiosampleId], List[Union[str, BiosampleId]]]]) diff --git a/python/workflow_execution_activity.py b/python/workflow_execution_activity.py index f37a15973c..b40105144c 100644 --- a/python/workflow_execution_activity.py +++ b/python/workflow_execution_activity.py @@ -1,5 +1,5 @@ # Auto generated from workflow_execution_activity.yaml by pythongen.py version: 0.9.0 -# Generation date: 2022-05-06T11:22:05 +# Generation date: 2022-05-13T08:53:16 # Schema: NMDC-Workflow-Exectution # # id: https://microbiomedata/schema/workflow_execution_activity diff --git a/src/schema/mixs_legacy.yaml b/reports/mixs_legacy.yaml similarity index 100% rename from src/schema/mixs_legacy.yaml rename to reports/mixs_legacy.yaml diff --git a/src/schema/mixs_new.yaml b/reports/mixs_new.yaml similarity index 100% rename from src/schema/mixs_new.yaml rename to reports/mixs_new.yaml