Skip to content

Commit 29d36ae

Browse files
authored
Merge pull request #351 from microbiomedata/issue-345-ial-solution
with add *
2 parents cbe93e7 + 8657135 commit 29d36ae

18 files changed

+256
-247
lines changed

docs/schema-slides.html

Lines changed: 223 additions & 209 deletions
Large diffs are not rendered by default.

json/nmdc.linkml.json

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3664,7 +3664,8 @@
36643664
"slot_uri": "prov:qualifiedAssociation",
36653665
"multivalued": true,
36663666
"range": "credit association",
3667-
"inlined": true
3667+
"inlined": true,
3668+
"inlined_as_list": true
36683669
},
36693670
"study image": {
36703671
"name": "study image",
@@ -22265,7 +22266,6 @@
2226522266
}
2226622267
],
2226722268
"from_schema": "https://microbiomedata/schema",
22268-
"source": "https://www.ornl.gov/content/bio-scales-0",
2226922269
"aliases": [
2227022270
"zinc"
2227122271
],
@@ -22297,7 +22297,6 @@
2229722297
}
2229822298
],
2229922299
"from_schema": "https://microbiomedata/schema",
22300-
"source": "https://www.ornl.gov/content/bio-scales-0",
2230122300
"aliases": [
2230222301
"manganese"
2230322302
],
@@ -22329,7 +22328,6 @@
2232922328
}
2233022329
],
2233122330
"from_schema": "https://microbiomedata/schema",
22332-
"source": "https://www.ornl.gov/content/bio-scales-0",
2233322331
"aliases": [
2233422332
"ammonium nitrogen",
2233522333
"NH4-N"
@@ -22365,7 +22363,6 @@
2236522363
}
2236622364
],
2236722365
"from_schema": "https://microbiomedata/schema",
22368-
"source": "https://www.ornl.gov/content/bio-scales-0",
2236922366
"aliases": [
2237022367
"nitrate nitrogen",
2237122368
"NO3-N"
@@ -22398,7 +22395,6 @@
2239822395
}
2239922396
],
2240022397
"from_schema": "https://microbiomedata/schema",
22401-
"source": "https://www.ornl.gov/content/bio-scales-0",
2240222398
"aliases": [
2240322399
"nitrite nitrogen",
2240422400
"NO2-N"
@@ -22434,7 +22430,6 @@
2243422430
}
2243522431
],
2243622432
"from_schema": "https://microbiomedata/schema",
22437-
"source": "https://www.ornl.gov/content/bio-scales-0",
2243822433
"see_also": [
2243922434
"https://secure.caes.uga.edu/extension/publications/files/pdf/C%20874_5.PDF"
2244022435
],
@@ -22474,7 +22469,6 @@
2247422469
}
2247522470
],
2247622471
"from_schema": "https://microbiomedata/schema",
22477-
"source": "https://www.ornl.gov/content/bio-scales-0",
2247822472
"aliases": [
2247922473
"lbceq",
2248022474
"lime buffer capacity (at 5-day equilibrium)"
@@ -29413,7 +29407,6 @@
2941329407
}
2941429408
],
2941529409
"from_schema": "https://microbiomedata/schema",
29416-
"source": "https://www.ornl.gov/content/bio-scales-0",
2941729410
"aliases": [
2941829411
"zinc"
2941929412
],
@@ -29447,7 +29440,6 @@
2944729440
}
2944829441
],
2944929442
"from_schema": "https://microbiomedata/schema",
29450-
"source": "https://www.ornl.gov/content/bio-scales-0",
2945129443
"aliases": [
2945229444
"manganese"
2945329445
],
@@ -29481,7 +29473,6 @@
2948129473
}
2948229474
],
2948329475
"from_schema": "https://microbiomedata/schema",
29484-
"source": "https://www.ornl.gov/content/bio-scales-0",
2948529476
"aliases": [
2948629477
"ammonium nitrogen",
2948729478
"NH4-N"
@@ -29519,7 +29510,6 @@
2951929510
}
2952029511
],
2952129512
"from_schema": "https://microbiomedata/schema",
29522-
"source": "https://www.ornl.gov/content/bio-scales-0",
2952329513
"aliases": [
2952429514
"nitrate nitrogen",
2952529515
"NO3-N"
@@ -29554,7 +29544,6 @@
2955429544
}
2955529545
],
2955629546
"from_schema": "https://microbiomedata/schema",
29557-
"source": "https://www.ornl.gov/content/bio-scales-0",
2955829547
"aliases": [
2955929548
"nitrite nitrogen",
2956029549
"NO2-N"
@@ -29592,7 +29581,6 @@
2959229581
}
2959329582
],
2959429583
"from_schema": "https://microbiomedata/schema",
29595-
"source": "https://www.ornl.gov/content/bio-scales-0",
2959629584
"see_also": [
2959729585
"https://secure.caes.uga.edu/extension/publications/files/pdf/C%20874_5.PDF"
2959829586
],
@@ -29634,7 +29622,6 @@
2963429622
}
2963529623
],
2963629624
"from_schema": "https://microbiomedata/schema",
29637-
"source": "https://www.ornl.gov/content/bio-scales-0",
2963829625
"aliases": [
2963929626
"lbceq",
2964029627
"lime buffer capacity (at 5-day equilibrium)"
@@ -30164,7 +30151,7 @@
3016430151
"alias": "has_credit_associations",
3016530152
"owner": "study",
3016630153
"range": "credit association",
30167-
"inlined": true
30154+
"inlined_as_list": true
3016830155
},
3016930156
"study image": {
3017030157
"name": "study image",

jsonld-context/nmdc.context.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_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 ",
2+
"_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 ",
33
"@context": {
44
"CAS": "http://identifiers.org/cas/",
55
"CATH": "http://identifiers.org/cath/",

python/annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from annotation.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:49
2+
# Generation date: 2022-06-15T10:43:01
33
# Schema: NMDC-Annotation
44
#
55
# id: https://microbiomedata/schema/annotation

python/basic_slots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from basic_slots.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:38
2+
# Generation date: 2022-06-15T10:42:50
33
# Schema: NMDC-Basic-Slots
44
#
55
# id: https://microbiomedata/schema/basic_slots

python/bioscales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from bioscales.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:48:07
2+
# Generation date: 2022-06-15T10:43:19
33
# Schema: NMDC-Bioscales
44
#
55
# id: https://microbiomedata/schema/bioscales

python/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from core.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:48:16
2+
# Generation date: 2022-06-15T10:43:31
33
# Schema: NMDC-Core
44
#
55
# id: https://microbiomedata/schema/core

python/external_identifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from external_identifiers.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:53
2+
# Generation date: 2022-06-15T10:43:06
33
# Schema: NMDC-External-Identifiers
44
#
55
# id: https://microbiomedata/schema/external_identifiers

python/mixs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from mixs.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:57
2+
# Generation date: 2022-06-15T10:43:10
33
# Schema: mixs-schema
44
#
55
# id: https://microbiomedata/schema/mixs

python/nmdc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from nmdc.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:48:09
2+
# Generation date: 2022-06-15T10:43:24
33
# Schema: NMDC
44
#
55
# id: https://microbiomedata/schema
@@ -1681,7 +1681,9 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
16811681
self.MGnify_project_identifiers = [self.MGnify_project_identifiers] if self.MGnify_project_identifiers is not None else []
16821682
self.MGnify_project_identifiers = [v if isinstance(v, ExternalIdentifier) else ExternalIdentifier(v) for v in self.MGnify_project_identifiers]
16831683

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

16861688
if not isinstance(self.study_image, list):
16871689
self.study_image = [self.study_image] if self.study_image is not None else []

python/portal/emsl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from emsl.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:47
2+
# Generation date: 2022-06-15T10:43:00
33
# Schema: emsl
44
#
55
# id: https://microbiomedata/schema/emsl

python/portal/jgi_metagenomics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from jgi_metagenomics.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:40
2+
# Generation date: 2022-06-15T10:42:52
33
# Schema: jgi_metagenomics
44
#
55
# id: https://microbiomedata/schema/jgi_metagenomics

python/portal/jgi_metatranscriptomics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from jgi_metatranscriptomics.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:43
2+
# Generation date: 2022-06-15T10:42:56
33
# Schema: jgi_metatranscriptomics
44
#
55
# id: https://microbiomedata/schema/jgi_metatranscriptomics

python/portal/mixs_inspired.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from mixs_inspired.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:42
2+
# Generation date: 2022-06-15T10:42:54
33
# Schema: mixs_inspired
44
#
55
# id: https://microbiomedata/schema/mixs_inspired

python/portal/sample_id.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from sample_id.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:47:45
2+
# Generation date: 2022-06-15T10:42:58
33
# Schema: sample_id
44
#
55
# id: https://microbiomedata/schema/sample_id

python/prov.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from prov.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:48:04
2+
# Generation date: 2022-06-15T10:43:17
33
# Schema: NMDC-PROV
44
#
55
# id: https://microbiomedata/schema/prov

python/workflow_execution_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from workflow_execution_activity.yaml by pythongen.py version: 0.9.0
2-
# Generation date: 2022-06-03T12:48:01
2+
# Generation date: 2022-06-15T10:43:14
33
# Schema: NMDC-Workflow-Exectution
44
#
55
# id: https://microbiomedata/schema/workflow_execution_activity

test/test_credit_associations.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ def test_sum(self):
3333
validator.validate_object(ca1, target_class=CreditAssociation)
3434
validator.validate_object(ca2, target_class=CreditAssociation)
3535

36-
try:
37-
s.has_credit_associations.append(ca1)
38-
s.has_credit_associations.append(ca2)
39-
validator.validate_object(s, target_class=Study)
40-
except Exception as e:
41-
logging.error(traceback.format_exc())
36+
# try:
37+
# s.has_credit_associations.append(ca1)
38+
# s.has_credit_associations.append(ca2)
39+
# validator.validate_object(s, target_class=Study)
40+
# except Exception as e:
41+
# logging.error(traceback.format_exc())
42+
43+
s.has_credit_associations.append(ca1)
44+
s.has_credit_associations.append(ca2)
45+
validator.validate_object(s, target_class=Study)
46+
47+
print(s)
4248

4349
self.assertEqual(type(s), Study)
4450

0 commit comments

Comments
 (0)