Skip to content

Commit

Permalink
Change Study class name to ResearchInitiative
Browse files Browse the repository at this point in the history
  • Loading branch information
brynnz22 committed Sep 7, 2023
1 parent c6002a3 commit 8a8c3fb
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 41 deletions.
4 changes: 2 additions & 2 deletions project.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ nmdc_schema/nmdc_schema_accepting_legacy_ids.yaml: src/schema/nmdc.yaml
yq -i '(.classes[] | select(.name == "ReadBasedTaxonomyAnalysisActivity") | .slot_usage.id.structured_pattern.syntax) = ".*"' $@
yq -i '(.classes[] | select(.name == "ReadQcAnalysisActivity") | .slot_usage.id.pattern) = ".*"' $@
yq -i '(.classes[] | select(.name == "ReadQcAnalysisActivity") | .slot_usage.id.structured_pattern.syntax) = ".*"' $@
yq -i '(.classes[] | select(.name == "Study") | .slot_usage.id.pattern) = ".*"' $@
yq -i '(.classes[] | select(.name == "Study") | .slot_usage.id.structured_pattern.syntax) = ".*"' $@
yq -i '(.classes[] | select(.name == "ResearchInitiative") | .slot_usage.id.pattern) = ".*"' $@
yq -i '(.classes[] | select(.name == "ResearchInitiative") | .slot_usage.id.structured_pattern.syntax) = ".*"' $@

$(RUN) gen-linkml \
--format yaml \
Expand Down
11 changes: 11 additions & 0 deletions src/data/valid/ResearchInitiative-credit-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id: 'nmdc:sty-99-WoeqAi'
initiative_type: study
has_credit_associations:
- applied_roles:
- Data curation
applies_to_person:
orcid: 'orcid:0000-0002-1825-00'
- applied_roles:
- Software
applies_to_person:
orcid: 'orcid:0000-0001-9076-6066'
99 changes: 99 additions & 0 deletions src/data/valid/ResearchInitiative-exhaustive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
id: nmdc:sty-11-ab
name: see also description, title, objective, various alternatives
description: see also name, title, objective, various alternatives
alternative_identifiers:
- generic:abc1
related_identifiers: any string R1
#emsl_proposal_identifier:
# - generic:abc1
#emsl_proposal_doi: any string
gold_study_identifiers:
- GOLD:Gs12345
- GOLD:Gs90909
mgnify_project_identifiers:
- mgnify.proj:ABC123
ecosystem: unconstrained text. should be validated against the controlled vocabulary,
by the sample's environmental package. would also be nice to align the CV with MIxS
environmental triads
ecosystem_category: unconstrained text
ecosystem_type: unconstrained text
ecosystem_subtype: unconstrained text
specific_ecosystem: unconstrained text
principal_investigator:
has_raw_value: Craig Venter
was_generated_by: nmdc:any_string_1
orcid: ORCID:0000-0002-7086-765X
profile_image_url: https://en.wikipedia.org/wiki/Craig_Venter#/media/File:Craigventer2.jpg
email: jcventer@jcvi.org
name: J. Craig Venter
websites:
- https://www.jcvi.org/
- https://www.jcvi.org/about/j-craig-venter
publication_dois:
- doi:10.1126/science.1058040
title: Sample Exhaustive Biosample instance. Although all of these values should pass
validation, that does not mean that any Biosample of any type would necessarily
have this particular combination of values.
alternative_titles:
- any string 1
- any string 2
alternative_descriptions:
- any string 1
- any string 2
alternative_names:
- any string 1
- any string 2
objective: This record, an instance of class Study from the nmdc-schema was had authored,
so that the NMDC team would have at least one instance, using all slots, with a
mixture of reasonable values and minimally compliant values.
websites:
- https://w3id.org/nmdc
- https://w3id.org/linkml
publications:
- any string 1
- any string 2
ess_dive_datasets:
- any string 1
- any string 2
type: any string
relevant_protocols:
- any string 1
- any string 2
funding_sources:
- any string 1
- any string 2
has_credit_associations:
- applies_to_person:
has_raw_value: Craig Venter
was_generated_by: nmdc:any_string_1
orcid: ORCID:0000-0002-7086-765X
profile_image_url: https://en.wikipedia.org/wiki/Craig_Venter#/media/File:Craigventer2.jpg
email: jcventer@jcvi.org
name: J. Craig Venter
websites:
- https://www.jcvi.org/
- https://www.jcvi.org/about/j-craig-venter
applied_roles:
- Supervision
- Conceptualization
applied_role: Funding acquisition
type: any string
- applies_to_person:
name: Tanja Davidsen
applied_roles:
- Investigation
- Supervision
study_image:
- has_raw_value: https://upload.wikimedia.org/wikipedia/commons/8/86/J._Craig_Vernter_Institute_Rockville_Maryland.jpg
was_generated_by: nmdc:any_string_1
url: https://upload.wikimedia.org/wikipedia/commons/8/86/J._Craig_Vernter_Institute_Rockville_Maryland.jpg
description: Photo of Craig Venter Institute, Rockville, Maryland
display_order: '1'
- has_raw_value: https://today.ucsd.edu/news_uploads/140213ventor2.jpg
was_generated_by: nmdc:any_string_1
url: https://today.ucsd.edu/news_uploads/140213ventor2.jpg
description: Photo of Craig Venter Institute, La Jolla, California
display_order: '2'
initiative_type: study
part_of:
- nmdc:sty-11-34xj1157
2 changes: 2 additions & 0 deletions src/data/valid/ResearchInitiative-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id: nmdc:sty-11-ab
initiative_type: study
68 changes: 34 additions & 34 deletions src/schema/nmdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ subsets:
sample subset:
description:
Subset consisting of entities linked to the processing of samples. Currently,
this subset consists of study, omics process, and biosample.
this subset consists of research initiative, omics process, and biosample.
data object subset:
description:
Subset consisting of the data objects that either inputs or outputs
Expand Down Expand Up @@ -229,7 +229,7 @@ classes:
title: Field Research Site
comments:
- Provides grouping of biosamples at level that's more specific than belonging
to the same study
to the same research initiative.
- be very clear that this could be part of a larger site
- In Bioscales, one might say that rhizosphere soil and bulk soil from around
the same plant were obtained at the same site. In this case, the site would
Expand Down Expand Up @@ -1083,7 +1083,7 @@ classes:
required: true
part_of:
required: true
range: Study
range: ResearchInitiative
fire:
comments:
- Provide the date the fire occurred. If extended burning occurred provide the date range.
Expand Down Expand Up @@ -1318,7 +1318,7 @@ classes:
- NCIT:C43412
- http://purl.obolibrary.org/obo/FBcv_0003024

Study:
ResearchInitiative:
is_a: NamedThing
in_subset:
- sample subset
Expand All @@ -1330,9 +1330,10 @@ classes:
- project
- umbrella project
- research inititative
- consortium
description: >-
A study summarizes the overall goal of a research initiative and outlines the key objective of its underlying projects.
comments: The Study class can include both consortia and studies.
A research initiative summarizes the overall goal of a research initiative and outlines the key objective of its underlying projects.
comments: The research initiative class can include both consortia and studies.
alt_descriptions:
embl.ena:
A study (project) groups together data submitted to the archive and
Expand Down Expand Up @@ -1399,42 +1400,42 @@ classes:

name:
annotations:
display_hint: Provide a name for the study your samples will belong with.
display_hint: Provide a name for the research initiative your samples will belong with.
websites:
annotations:
display_hint:
Link to the Principal Investigator's research lab webpage
or the study webpage associated with this collection of samples.
or the research initiative's webpage associated with this collection of samples.
Multiple links can be provided.
description:
description: A brief, link-free summary of a Study
description: A brief, link-free summary of a research initiative.
annotations:
display_hint: Provide a brief description of your study.
comments: Include links in other Study slots, such as websites or dois.
display_hint: Provide a brief description of your research initiative.
comments: Include links in other ResearchInitiative slots, such as websites or dois.
notes:
annotations:
display_hint: Add any additional notes or comments about this study.
display_hint: Add any additional notes or comments about this research initiative.
alternative_identifiers:
description: Unique identifier for a study submitted to additional resources. Matches that which has been submitted to NMDC
description: Unique identifier for a research initiative submitted to additional resources. Matches that which has been submitted to NMDC
alternative_names:
annotations:
display_hint:
Project, study, or sample set names the are also associated with this submission
or other names / identifiers for this study.
or other names / identifiers for this research initiative.
related_identifiers:
description: Unique identifier for a study submitted to additional resources. Similar, but not necessarily identical to that which has been submitted to NMDC
description: Unique identifier for a research initiative submitted to additional resources. Similar, but not necessarily identical to that which has been submitted to NMDC
insdc_bioproject_identifiers:
description: Unique identifier for a bioproject submitted to INSDC that relates to the NMDC submitted study.
description: Unique identifier for a bioproject submitted to INSDC that relates to the NMDC submitted research initiative.
annotations:
display_hint: Provide the NCBI BioProject Accession Number associated with the listed NCBI BioProject Title.
# emsl_project_identifier:
# description: The EMSL project ID that relates to the NMDC submitted study
# emsl_proposal_doi:
# description: The DOI for the EMSL awarded study that relates to the NMDC submitted study
part_of:
description: Links a study or consortium to a parent study or consortium.
comments: Value is the id of the parent study or consortium.
range: Study
description: Links a research initiative, such as a study or consortium, to a parent research initiative.
comments: Value is the id of the parent research initiative.
range: ResearchInitiative
exact_mappings:
- OBI:0000066
- SIO:000747
Expand All @@ -1446,13 +1447,12 @@ classes:
- determine how to get data values for submitted_to_insdc, investigation_type,
experimental_factor
- project_name is redundant with name, so excluding it
- potentially change the class name from Study to ResearchInitiative to make more semantically accurate and clear; encompassing instances of studies and consortia.

notes:
- "sample GOLD link https://identifiers.org/gold:Gs0110115"
- "sample insdc.srs link https://www.ebi.ac.uk/ena/browser/view/PRJEB45055 ?"
- "sample mgnify link https://www.ebi.ac.uk/metagenomics/studies/MGYS00005757"
- "GOLD, insdc.srs and mgnify are reasonable prefixes for alternative study identifiers, but no longer for the Study.id"
- "GOLD, insdc.srs and mgnify are reasonable prefixes for alternative research initiative identifiers, but no longer for the ResearchInitiative.id"

BiosampleProcessing:
aliases:
Expand Down Expand Up @@ -1943,7 +1943,7 @@ enums:
description: principal investigator role
meaning: OBI:0000103
Submitter:
description: the person(s) who enter study and biosample metadata into the NMDC submission portal
description: the person(s) who enter research initiative and biosample metadata into the NMDC submission portal
meaning: EFO:0001741
comments:
- credit enums come from https://casrai.org/credit/
Expand Down Expand Up @@ -2222,7 +2222,7 @@ slots:
- 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
- applying to a ResearchInitiative may not be granular enough

collected_from:
description: The Site from which a Biosample was collected
Expand Down Expand Up @@ -2253,33 +2253,33 @@ slots:
#- insdc_sra_ena_study_identifiers

notes:
description: from study class
description: from ResearchInitiative class

canary:
description: a slot that can be added and removed as evidence that schema changes have propagated to other systems
ess_dive_datasets:
multivalued: true
description: List of ESS-DIVE dataset DOIs
has_credit_associations:
domain: Study
domain: ResearchInitiative
range: CreditAssociation
multivalued: true
notes:
- 'had just been "inlined: true"'
inlined_as_list: true
description:
"This slot links a study to a credit association. The credit association
"This slot links a research initiative 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"
slot_uri: prov:qualifiedAssociation
annotations:
display_hint: Other researchers associated with this study.
display_hint: Other researchers associated with this research initiative.
study_image:
domain: Study
domain: ResearchInitiative
range: ImageValue
multivalued: true
inlined: true
description: Links a study to one or more images.
description: Links a research initiative to one or more images.
relevant_protocols:
multivalued: true
range: string
Expand Down Expand Up @@ -2349,10 +2349,10 @@ slots:
study_set:
mixins: object_set
domain: Database
range: Study
range: ResearchInitiative
multivalued: true
description:
This property links a database object to the set of studies within
This property links a database object to the set of research initiatives within
it.
field_research_site_set:
inlined_as_list: true
Expand Down Expand Up @@ -2626,7 +2626,7 @@ slots:
award_dois:
is_a: dois
description: >-
One or more DOIs that links a study, or similar entiry, to information about the funding authority.
One or more DOIs that links a research initiative, or similar entity, to information about the funding authority.
examples:
- value: doi:10.46936/10.25585/60000880
description:
Expand All @@ -2636,7 +2636,7 @@ slots:
dataset_dois:
is_a: dois
description: >-
One or more DOIs that links a study, or similar entity, to the generated data.
One or more DOIs that links research initiative, or similar entity, to the generated data.
# annotations:
# display_hint: DOI associated with the data in this study. This is required when data is already generated.
examples:
Expand All @@ -2647,7 +2647,7 @@ slots:

publication_dois:
is_a: dois
description: One or more DOIs that links a study, or similar entity, to a publication.
description: One or more DOIs that links a research initiative, or similar entity, to a publication.
examples:
- value: doi:10.1126/science.1058040
description:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_credit_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from linkml.validators.jsonschemavalidator import JsonSchemaDataValidator

from nmdc_schema.nmdc import PersonValue, CreditAssociation, Study
from nmdc_schema.nmdc import PersonValue, CreditAssociation, ResearchInitiative

ROOT = os.path.join(os.path.dirname(__file__), '..')
SCHEMA_DIR = os.path.join(ROOT, "src", "schema")
Expand All @@ -21,17 +21,17 @@ def test_sum(self):
ca1 = CreditAssociation(applies_to_person=pv1, applied_roles=["Supervision", "Validation"])
ca2 = CreditAssociation(applies_to_person=pv2, applied_roles=["Investigation"])

s = Study(id="nmdc:sty-e3e05c16-8c9a-421e-ade5-cde4e5a435fa", initiative_type="study")
s = ResearchInitiative(id="nmdc:sty-e3e05c16-8c9a-421e-ade5-cde4e5a435fa", initiative_type="study")

# # why is schema loaded each time?
validator.validate_object(ca1, target_class=CreditAssociation)
validator.validate_object(ca2, target_class=CreditAssociation)

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

self.assertEqual(type(s), Study)
self.assertEqual(type(s), ResearchInitiative)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion tests/test_getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_schema_slots_getter(self):
self.assertIsNotNone(schema_slots)

def test_get_slots_from_class(self):
class_name = "Study"
class_name = "ResearchInitiative"
class_slot_getter = ClassSlotsGetter()
class_slots = class_slot_getter.get_class_slots(class_name)
self.assertIsNotNone(class_slots)
Expand Down

0 comments on commit 8a8c3fb

Please sign in to comment.