Skip to content

Commit

Permalink
with add *
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomam committed Jun 15, 2022
1 parent a19ea1b commit 8657135
Show file tree
Hide file tree
Showing 18 changed files with 256 additions and 247 deletions.
432 changes: 223 additions & 209 deletions docs/schema-slides.html

Large diffs are not rendered by default.

19 changes: 3 additions & 16 deletions json/nmdc.linkml.json
Original file line number Diff line number Diff line change
Expand Up @@ -3664,7 +3664,8 @@
"slot_uri": "prov:qualifiedAssociation",
"multivalued": true,
"range": "credit association",
"inlined": true
"inlined": true,
"inlined_as_list": true
},
"study image": {
"name": "study image",
Expand Down Expand Up @@ -22265,7 +22266,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"zinc"
],
Expand Down Expand Up @@ -22297,7 +22297,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"manganese"
],
Expand Down Expand Up @@ -22329,7 +22328,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"ammonium nitrogen",
"NH4-N"
Expand Down Expand Up @@ -22365,7 +22363,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"nitrate nitrogen",
"NO3-N"
Expand Down Expand Up @@ -22398,7 +22395,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"nitrite nitrogen",
"NO2-N"
Expand Down Expand Up @@ -22434,7 +22430,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"see_also": [
"https://secure.caes.uga.edu/extension/publications/files/pdf/C%20874_5.PDF"
],
Expand Down Expand Up @@ -22474,7 +22469,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"lbceq",
"lime buffer capacity (at 5-day equilibrium)"
Expand Down Expand Up @@ -29413,7 +29407,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"zinc"
],
Expand Down Expand Up @@ -29447,7 +29440,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"manganese"
],
Expand Down Expand Up @@ -29481,7 +29473,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"ammonium nitrogen",
"NH4-N"
Expand Down Expand Up @@ -29519,7 +29510,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"nitrate nitrogen",
"NO3-N"
Expand Down Expand Up @@ -29554,7 +29544,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"nitrite nitrogen",
"NO2-N"
Expand Down Expand Up @@ -29592,7 +29581,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"see_also": [
"https://secure.caes.uga.edu/extension/publications/files/pdf/C%20874_5.PDF"
],
Expand Down Expand Up @@ -29634,7 +29622,6 @@
}
],
"from_schema": "https://microbiomedata/schema",
"source": "https://www.ornl.gov/content/bio-scales-0",
"aliases": [
"lbceq",
"lime buffer capacity (at 5-day equilibrium)"
Expand Down Expand Up @@ -30164,7 +30151,7 @@
"alias": "has_credit_associations",
"owner": "study",
"range": "credit association",
"inlined": true
"inlined_as_list": true
},
"study image": {
"name": "study image",
Expand Down
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-06-03T12:47:32\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 ",
"_comments": "Auto generated from nmdc.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2022-06-15T10:42:44\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
2 changes: 1 addition & 1 deletion python/annotation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from annotation.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:49
# Generation date: 2022-06-15T10:43:01
# Schema: NMDC-Annotation
#
# id: https://microbiomedata/schema/annotation
Expand Down
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-06-03T12:47:38
# Generation date: 2022-06-15T10:42:50
# Schema: NMDC-Basic-Slots
#
# id: https://microbiomedata/schema/basic_slots
Expand Down
2 changes: 1 addition & 1 deletion python/bioscales.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from bioscales.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:48:07
# Generation date: 2022-06-15T10:43:19
# Schema: NMDC-Bioscales
#
# id: https://microbiomedata/schema/bioscales
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-06-03T12:48:16
# Generation date: 2022-06-15T10:43:31
# Schema: NMDC-Core
#
# id: https://microbiomedata/schema/core
Expand Down
2 changes: 1 addition & 1 deletion python/external_identifiers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from external_identifiers.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:53
# Generation date: 2022-06-15T10:43:06
# Schema: NMDC-External-Identifiers
#
# id: https://microbiomedata/schema/external_identifiers
Expand Down
2 changes: 1 addition & 1 deletion python/mixs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from mixs.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:57
# Generation date: 2022-06-15T10:43:10
# Schema: mixs-schema
#
# id: https://microbiomedata/schema/mixs
Expand Down
6 changes: 4 additions & 2 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-06-03T12:48:09
# Generation date: 2022-06-15T10:43:24
# Schema: NMDC
#
# id: https://microbiomedata/schema
Expand Down Expand Up @@ -1681,7 +1681,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
self.MGnify_project_identifiers = [self.MGnify_project_identifiers] if self.MGnify_project_identifiers is not None else []
self.MGnify_project_identifiers = [v if isinstance(v, ExternalIdentifier) else ExternalIdentifier(v) for v in self.MGnify_project_identifiers]

self._normalize_inlined_as_dict(slot_name="has_credit_associations", slot_type=CreditAssociation, key_name="applies to person", keyed=False)
if not isinstance(self.has_credit_associations, list):
self.has_credit_associations = [self.has_credit_associations] if self.has_credit_associations is not None else []
self.has_credit_associations = [v if isinstance(v, CreditAssociation) else CreditAssociation(**as_dict(v)) for v in self.has_credit_associations]

if not isinstance(self.study_image, list):
self.study_image = [self.study_image] if self.study_image is not None else []
Expand Down
2 changes: 1 addition & 1 deletion python/portal/emsl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from emsl.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:47
# Generation date: 2022-06-15T10:43:00
# Schema: emsl
#
# id: https://microbiomedata/schema/emsl
Expand Down
2 changes: 1 addition & 1 deletion python/portal/jgi_metagenomics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from jgi_metagenomics.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:40
# Generation date: 2022-06-15T10:42:52
# Schema: jgi_metagenomics
#
# id: https://microbiomedata/schema/jgi_metagenomics
Expand Down
2 changes: 1 addition & 1 deletion python/portal/jgi_metatranscriptomics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from jgi_metatranscriptomics.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:43
# Generation date: 2022-06-15T10:42:56
# Schema: jgi_metatranscriptomics
#
# id: https://microbiomedata/schema/jgi_metatranscriptomics
Expand Down
2 changes: 1 addition & 1 deletion python/portal/mixs_inspired.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from mixs_inspired.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:42
# Generation date: 2022-06-15T10:42:54
# Schema: mixs_inspired
#
# id: https://microbiomedata/schema/mixs_inspired
Expand Down
2 changes: 1 addition & 1 deletion python/portal/sample_id.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from sample_id.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:47:45
# Generation date: 2022-06-15T10:42:58
# Schema: sample_id
#
# id: https://microbiomedata/schema/sample_id
Expand Down
2 changes: 1 addition & 1 deletion python/prov.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Auto generated from prov.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-06-03T12:48:04
# Generation date: 2022-06-15T10:43:17
# Schema: NMDC-PROV
#
# id: https://microbiomedata/schema/prov
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-06-03T12:48:01
# Generation date: 2022-06-15T10:43:14
# Schema: NMDC-Workflow-Exectution
#
# id: https://microbiomedata/schema/workflow_execution_activity
Expand Down
18 changes: 12 additions & 6 deletions test/test_credit_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ def test_sum(self):
validator.validate_object(ca1, target_class=CreditAssociation)
validator.validate_object(ca2, target_class=CreditAssociation)

try:
s.has_credit_associations.append(ca1)
s.has_credit_associations.append(ca2)
validator.validate_object(s, target_class=Study)
except Exception as e:
logging.error(traceback.format_exc())
# try:
# s.has_credit_associations.append(ca1)
# s.has_credit_associations.append(ca2)
# validator.validate_object(s, target_class=Study)
# except Exception as e:
# logging.error(traceback.format_exc())

s.has_credit_associations.append(ca1)
s.has_credit_associations.append(ca2)
validator.validate_object(s, target_class=Study)

print(s)

self.assertEqual(type(s), Study)

Expand Down

0 comments on commit 8657135

Please sign in to comment.