Skip to content

Commit

Permalink
lock in version 4.0.0
Browse files Browse the repository at this point in the history
and don't generate python for mixs legacy or new
  • Loading branch information
turbomam committed May 13, 2022
1 parent 97adfe0 commit b1329f5
Show file tree
Hide file tree
Showing 9 changed files with 281 additions and 122 deletions.
313 changes: 209 additions & 104 deletions json/nmdc.linkml.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jsonld-context/nmdc.context.jsonld
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
19 changes: 15 additions & 4 deletions jsonschema/nmdc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
},
Expand All @@ -5045,6 +5056,6 @@
"required": [],
"title": "NMDC",
"type": "object",
"version": "2.1.0"
"version": "4.0.0"
}

2 changes: 1 addition & 1 deletion python/basic_slots.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/core.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
63 changes: 53 additions & 10 deletions python/nmdc.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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]])

Expand Down Expand Up @@ -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]]]])

Expand Down
2 changes: 1 addition & 1 deletion python/workflow_execution_activity.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b1329f5

Please sign in to comment.