Skip to content

Commit

Permalink
Merge pull request #644 from microbiomedata/issue-639-embargoed
Browse files Browse the repository at this point in the history
Add embargoed slot, assign to Biosample, and add tests
  • Loading branch information
turbomam committed Jan 24, 2023
2 parents e1f3c73 + eb62cb0 commit 333dd1f
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jsonschema/nmdc.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@
"$ref": "#/$defs/QuantityValue",
"description": "Elevation of the sampling site is its height above a fixed reference point, most commonly the mean sea level. Elevation is mainly used when referring to points on the earth's surface, while altitude is used for points above the surface, such as an aircraft in flight or a spacecraft in orbit."
},
"embargoed": {
"description": "If true, the data are embargoed and not available for public access.",
"type": "boolean"
},
"emsl_biosample_identifiers": {
"description": "A list of identifiers for the biosample from the EMSL database. This is used to link the biosample, as modeled by NMDC, to the biosample in the planned EMSL NEXUS database.",
"items": {
Expand Down Expand Up @@ -880,6 +884,10 @@
"$ref": "#/$defs/QuantityValue",
"description": "Temperature at which sample was stored, e.g. -80 degree Celsius"
},
"samp_taxon_id": {
"description": "NCBI taxon id of the sample. May be a single taxon or mixed taxa sample. Use 'synthetic metagenome' for mock community/positive controls, or 'blank sample' for negative controls.",
"type": "string"
},
"samp_vol_we_dna_ext": {
"$ref": "#/$defs/QuantityValue",
"description": "Volume (ml) or mass (g) of total collected sample processed for DNA extraction. Note: total sample collected should be entered under the term Sample Size (mixs:0000001)."
Expand Down
12 changes: 12 additions & 0 deletions src/schema/nmdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ classes:
Samples are associated with checklists, which define the fields used to annotate
the samples. Samples are always associated with a taxon.
slots:
- embargoed
- collected_from
- type
- img_identifiers
Expand Down Expand Up @@ -1007,6 +1008,17 @@ enums:

slots:

embargoed:
description: >-
If true, the data are embargoed and not available for public access.
range: boolean
recommended: true
todos:
- make this required?
- first apply to Biosample
- try to apply to all Biosamples in a particular nmdc-server SubmissionMetadata?
- applying to a Study may nto be granular enough

collected_from:
description: The Site from which a Biosample was collected
domain: Biosample
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"biosample_set": [
{
"id": "nmdc:bsm-99-dtTMNb",
"part_of": [
"gold:Gs0110115"
],
"env_broad_scale": {
"has_raw_value": "ENVO:00002030",
"term": {
"id": "ENVO:00002030"
}
},
"env_local_scale": {
"has_raw_value": "ENVO:00002169",
"term": {
"id": "ENVO:00002169"
}
},
"env_medium": {
"has_raw_value": "ENVO:00005792",
"term": {
"id": "ENVO:00005792"
}
},
"embargoed": 999
}
]
}
28 changes: 28 additions & 0 deletions test/data/minimal_valid_biosample_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"biosample_set": [
{
"id": "nmdc:bsm-99-dtTMNb",
"part_of": [
"gold:Gs0110115"
],
"env_broad_scale": {
"has_raw_value": "ENVO:00002030",
"term": {
"id": "ENVO:00002030"
}
},
"env_local_scale": {
"has_raw_value": "ENVO:00002169",
"term": {
"id": "ENVO:00002169"
}
},
"env_medium": {
"has_raw_value": "ENVO:00005792",
"term": {
"id": "ENVO:00005792"
}
}
}
]
}
29 changes: 29 additions & 0 deletions test/data/minimal_valid_embargoed_biosample_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"biosample_set": [
{
"id": "nmdc:bsm-99-dtTMNb",
"part_of": [
"gold:Gs0110115"
],
"env_broad_scale": {
"has_raw_value": "ENVO:00002030",
"term": {
"id": "ENVO:00002030"
}
},
"env_local_scale": {
"has_raw_value": "ENVO:00002169",
"term": {
"id": "ENVO:00002169"
}
},
"env_medium": {
"has_raw_value": "ENVO:00005792",
"term": {
"id": "ENVO:00005792"
}
},
"embargoed": true
}
]
}

0 comments on commit 333dd1f

Please sign in to comment.