From 73516e6b8c66b3e6aecbe400671b9d6b545eb9f4 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Mon, 18 Mar 2024 09:13:05 +0100 Subject: [PATCH 1/2] Move huge example to test cases Way to big to be included on the main documentation page verbatim. Makes the page unreadable. --- .../validation}/DatasetVersionObject-dataverse-rtmefmri.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/examples/dataset-version => tests/dataset-version-schema/validation}/DatasetVersionObject-dataverse-rtmefmri.yaml (100%) diff --git a/src/examples/dataset-version/DatasetVersionObject-dataverse-rtmefmri.yaml b/tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml similarity index 100% rename from src/examples/dataset-version/DatasetVersionObject-dataverse-rtmefmri.yaml rename to tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml From 05ffcd179a223c5d70f1bdf0e3b27b1fc147b5c4 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Mon, 18 Mar 2024 09:47:52 +0100 Subject: [PATCH 2/2] Actually run the examples as test cases, fix most of them --- ...DatasetVersionObject-customproperties.yaml | 9 ++-- ...ersionObject-datacite-nationalgallery.yaml | 9 ++-- .../DatasetVersionObject-dats.yaml | 42 ++++++++++++------- .../DatasetVersionObject-funding.yaml | 3 +- .../DatasetVersionObject-identifiers.json | 3 ++ .../DatasetVersionObject-identifiers.yaml | 4 +- .../DatasetVersionObject-penguins.json | 4 +- .../DatasetVersionObject-penguins.yaml | 15 +++---- .../DatasetVersionObject-rocrate-minimal.yaml | 3 +- .../DatasetVersionObject-samplesrc.yaml | 6 ++- .../DatasetVersionObject-topic.yaml | 6 ++- ...tasetVersionObject-dataverse-rtmefmri.yaml | 6 ++- .../DatasetVersionObject.valid.cfg.yaml | 13 ++++++ 13 files changed, 84 insertions(+), 39 deletions(-) diff --git a/src/examples/dataset-version/DatasetVersionObject-customproperties.yaml b/src/examples/dataset-version/DatasetVersionObject-customproperties.yaml index 3f6de53..3594a17 100644 --- a/src/examples/dataset-version/DatasetVersionObject-customproperties.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-customproperties.yaml @@ -4,7 +4,8 @@ properties: - type: obo:NCIT_C90437 label: Planned Number of Female Subjects range: xsd:nonNegativeInteger - value: 54 + value: + - "54" comment: >- A non-negative integer representing the number of planned female subjects/participants. @@ -13,7 +14,9 @@ properties: relation: - meta_type: dlco:EntityObject meta_code: rmd - identifier: obo:OBI_0500002 + identifier: + obo:OBI_0500002: qualified_relation: - entity: rmd - had_role: obo:OBI_0500000 + had_role: + - obo:OBI_0500000 diff --git a/src/examples/dataset-version/DatasetVersionObject-datacite-nationalgallery.yaml b/src/examples/dataset-version/DatasetVersionObject-datacite-nationalgallery.yaml index 847fde9..554c889 100644 --- a/src/examples/dataset-version/DatasetVersionObject-datacite-nationalgallery.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-datacite-nationalgallery.yaml @@ -30,8 +30,8 @@ description: >- temperature, relative humidity and air moisture content 24 hours a day, 7 days a week over the last two decades. landing_page: https://research.ng-london.org.uk/scientific/env -version: 1.0 -modified: 2024-01-02 +version: "1.0" +modified: "2024-01-02" keyword: - "FOS: Earth and related environmental sciences" - temperature @@ -39,7 +39,8 @@ keyword: - illuminance - moisture content - Environmental monitoring -identifier: https://doi.org/10.82433/9184-dy35 +identifier: + https://doi.org/10.82433/9184-dy35: was_attributed_to: - meta_type: dlco:OrganizationObject meta_code: NG @@ -69,7 +70,7 @@ relation: name: "Integrating Platforms for the European Research Infrastructure ON Heritage Science" identifier: https://cordis.europa.eu/project/id/871034: - notation: 871034 + notation: "871034" schema_agency: European Commission sponsor: name: H2020 Excellent Science diff --git a/src/examples/dataset-version/DatasetVersionObject-dats.yaml b/src/examples/dataset-version/DatasetVersionObject-dats.yaml index e431134..d299c5d 100644 --- a/src/examples/dataset-version/DatasetVersionObject-dats.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-dats.yaml @@ -95,44 +95,58 @@ qualified_relation: # "name":"Homo sapiens" - entity: obo:NCBITaxon_9606 # "identifierSource": "NCBI Taxonomy Database" - had_role: dlco:is_about + had_role: + - dlco:is_about # "name": "adult" - entity: obo:BTO_0001043 - had_role: dlco:is_about + had_role: + - dlco:is_about license: licenses:CC-BY-ND-4.0 keyword: - phantom - MRI properties: - label: Total number of sessions - value: 521 + value: + - "521" - label: logo - value: logo.png + value: + - logo.png - label: CONP_status - value: CONP + value: + - CONP - label: files - value: 3771 + value: + - "3771" - label: subjects type: obo:NCIT_C98703 - value: 1 + value: + - "1" - label: origin_consortium - value: IBIS + value: + - IBIS - label: origin_institution - value: McGill Centre for Integrative Neuroscience + value: + - McGill Centre for Integrative Neuroscience - label: origin_city - value: Montreal + value: + - Montreal - label: origin_province - value: Quebec + value: + - Quebec - label: origin_country type: obo:HSO_0000360 - value: Canada + value: + - Canada - label: privacy comment: >- A qualifier to describe the data protection applied to the dataset. This is relevant for clinical data. - value: open + value: + - open - label: aggregation comment: >- "A qualifier indicating if the entity represents an 'instance of dataset' or a 'collection of datasets'." - value: instance of dataset + value: + - instance of dataset diff --git a/src/examples/dataset-version/DatasetVersionObject-funding.yaml b/src/examples/dataset-version/DatasetVersionObject-funding.yaml index a9b8524..199ee47 100644 --- a/src/examples/dataset-version/DatasetVersionObject-funding.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-funding.yaml @@ -4,7 +4,8 @@ relation: - meta_type: dlco:GrantObject meta_code: sfb1451 name: SFB1451 - identifier: https://gepris.dfg.de/gepris/projekt/431549029 + identifier: + https://gepris.dfg.de/gepris/projekt/431549029: sponsor: name: Deutsche Forschungsgemeinschaft qualified_relation: diff --git a/src/examples/dataset-version/DatasetVersionObject-identifiers.json b/src/examples/dataset-version/DatasetVersionObject-identifiers.json index a15c023..54727da 100644 --- a/src/examples/dataset-version/DatasetVersionObject-identifiers.json +++ b/src/examples/dataset-version/DatasetVersionObject-identifiers.json @@ -13,6 +13,9 @@ "meta_type": "dlco:AgentObject", "meta_code": "carberry_ex2", "identifier": { + "https://en.wikipedia.org/wiki/Josiah_S._Carberry": { + "meta_id": "https://en.wikipedia.org/wiki/Josiah_S._Carberry" + }, "http://orcid.org/0000-0002-1825-0097": { "meta_id": "http://orcid.org/0000-0002-1825-0097" } diff --git a/src/examples/dataset-version/DatasetVersionObject-identifiers.yaml b/src/examples/dataset-version/DatasetVersionObject-identifiers.yaml index b910b60..edfbaaf 100644 --- a/src/examples/dataset-version/DatasetVersionObject-identifiers.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-identifiers.yaml @@ -5,11 +5,13 @@ was_attributed_to: # by URI for a single identifier - meta_type: dlco:AgentObject meta_code: carberry_ex1 - identifier: https://en.wikipedia.org/wiki/Josiah_S._Carberry + identifier: + https://en.wikipedia.org/wiki/Josiah_S._Carberry: # by URI-as-a-key for any number of identifiers - meta_type: dlco:AgentObject meta_code: carberry_ex2 identifier: + https://en.wikipedia.org/wiki/Josiah_S._Carberry: http://orcid.org/0000-0002-1825-0097: # by inline-declaration with a URI key - meta_type: dlco:AgentObject diff --git a/src/examples/dataset-version/DatasetVersionObject-penguins.json b/src/examples/dataset-version/DatasetVersionObject-penguins.json index f67d52c..d39cbef 100644 --- a/src/examples/dataset-version/DatasetVersionObject-penguins.json +++ b/src/examples/dataset-version/DatasetVersionObject-penguins.json @@ -188,7 +188,7 @@ "sponsor": { "name": "NSF Office of Polar Programs" }, - "cites_as_authority": "https://www.nsf.gov/awardsearch/showAward?AWD_ID=0217282&HistoricalAwards=false" + "cites_as_authority": "https://www.nsf.gov/awardsearch/showAward?AWD_ID=0217282" }, { "meta_type": "dlco:GrantObject", @@ -212,7 +212,7 @@ "identifier": { "dlns:nsfaward/0741351": { "meta_id": "dlns:nsfaward/0741351", - "notation": "246505", + "notation": "0741351", "schema_agency": "US National Science Foundation" } }, diff --git a/src/examples/dataset-version/DatasetVersionObject-penguins.yaml b/src/examples/dataset-version/DatasetVersionObject-penguins.yaml index 9200e40..76e2bda 100644 --- a/src/examples/dataset-version/DatasetVersionObject-penguins.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-penguins.yaml @@ -7,8 +7,8 @@ description: >- Station, Antarctica LTER, a member of the Long Term Ecological Research Network. landing_page: https://github.com/allisonhorst/palmerpenguins -version: 0.1.0 -modified: 2020-07-16 +version: "0.1.0" +modified: "2020-07-16" keyword: - penguins - sea ice @@ -18,7 +18,8 @@ keyword: - antarctica - animal sexual behavior - isotopes -identifier: https://doi.org/10.5281/zenodo.3960218 +identifier: + https://doi.org/10.5281/zenodo.3960218: was_attributed_to: - meta_type: dlco:ResearchContributorObject meta_code: ahorst @@ -75,17 +76,17 @@ relation: name: "LTER: PALMER, ANTARCTICA LTER: Climate Change, Ecosystem Migration and Teleconnections in an Ice-Dominated Environment" identifier: dlns:nsfaward/0217282: - notation: 0217282 + notation: "0217282" schema_agency: US National Science Foundation sponsor: name: NSF Office of Polar Programs - cites_as_authority: https://www.nsf.gov/awardsearch/showAward?AWD_ID=0217282&HistoricalAwards=false + cites_as_authority: https://www.nsf.gov/awardsearch/showAward?AWD_ID=0217282 - meta_type: dlco:GrantObject meta_code: nsf0823101 name: Palmer, Antarctica Long Term Ecological Research Project identifier: dlns:nsfaward/0823101: - notation: 0823101 + notation: "0823101" schema_agency: US National Science Foundation sponsor: name: NSF Office of Polar Programs @@ -95,7 +96,7 @@ relation: name: "Collaborative Research: Possible Climate-induced Change in the Distribution of Pleuragramma Antarcticum on the Western Antarctic Peninsula Shelf" identifier: dlns:nsfaward/0741351: - notation: 0741351 + notation: "0741351" schema_agency: US National Science Foundation sponsor: name: NSF Office of Polar Programs diff --git a/src/examples/dataset-version/DatasetVersionObject-rocrate-minimal.yaml b/src/examples/dataset-version/DatasetVersionObject-rocrate-minimal.yaml index 641c1e0..9a16d36 100644 --- a/src/examples/dataset-version/DatasetVersionObject-rocrate-minimal.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-rocrate-minimal.yaml @@ -6,7 +6,8 @@ title: >- "Data files associated with the manuscript:Effects of facilitated family case conferencing for ..." description: >- Palliative care planning for nursing home residents with advanced dementia ... -identifier: https://doi.org/10.4225/59/59672c09f4a4b +identifier: + https://doi.org/10.4225/59/59672c09f4a4b: # "datePublished": "2017", distribution: meta_type: dlco:FileContainerObject diff --git a/src/examples/dataset-version/DatasetVersionObject-samplesrc.yaml b/src/examples/dataset-version/DatasetVersionObject-samplesrc.yaml index f9a58c6..ea58ca8 100644 --- a/src/examples/dataset-version/DatasetVersionObject-samplesrc.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-samplesrc.yaml @@ -1,7 +1,9 @@ qualified_relation: # sampled from organism homo sapiens - entity: http://snomed.info/id/337915000 - had_role: obo:HSO_0000244 + had_role: + - obo:HSO_0000244 # sampled from anatomical entity liver - entity: obo:BTO_0000759 - had_role: obo:HSO_0000243 + had_role: + - obo:HSO_0000243 diff --git a/src/examples/dataset-version/DatasetVersionObject-topic.yaml b/src/examples/dataset-version/DatasetVersionObject-topic.yaml index d86605e..2971c3a 100644 --- a/src/examples/dataset-version/DatasetVersionObject-topic.yaml +++ b/src/examples/dataset-version/DatasetVersionObject-topic.yaml @@ -1,7 +1,9 @@ relation: - meta_type: dlco:EntityObject meta_code: disease_cancer - identifier: obo:DOID_162 + identifier: + obo:DOID_162: qualified_relation: - entity: disease_cancer - had_role: dlco:is_about + had_role: + - dlco:is_about diff --git a/tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml b/tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml index 2a59ae8..4f38307 100644 --- a/tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml +++ b/tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml @@ -15,10 +15,12 @@ keyword: - Engineering - Medicine, Health and Life Sciences - Physics -identifier: https://doi.org/10.34894/R1TNL8 +identifier: + https://doi.org/10.34894/R1TNL8: custom_licenses: customlicenses:humanhealthdata: - identifier: "https://dataverse.nl/api/datasets/:persistentId/versions/1.4/customlicense?persistentId=doi:10.34894/R1TNL8" + identifier: + https://dataverse.nl/api/datasets/:persistentId/versions/1.4/customlicense?persistentId=doi:10.34894/R1TNL8: license_text: "

Data user agreement for accessing limited human health data

\n
\nBy clicking \"Accept\", I agree to the terms presented below.\n

\n

I request access to the rt-me-fMRI dataset collected diff --git a/tests/dataset-version-schema/validation/DatasetVersionObject.valid.cfg.yaml b/tests/dataset-version-schema/validation/DatasetVersionObject.valid.cfg.yaml index 6657755..e7753e1 100644 --- a/tests/dataset-version-schema/validation/DatasetVersionObject.valid.cfg.yaml +++ b/tests/dataset-version-schema/validation/DatasetVersionObject.valid.cfg.yaml @@ -1,7 +1,20 @@ schema: src/linkml/schemas/dataset-version.yaml target_class: DatasetVersionObject data_sources: + - tests/dataset-version-schema/validation/DatasetVersionObject-dataverse-rtmefmri.yaml + - src/examples/dataset-version/DatasetVersionObject-affiliation.yaml + - src/examples/dataset-version/DatasetVersionObject-customlicense.yaml + - src/examples/dataset-version/DatasetVersionObject-customproperties.yaml + - src/examples/dataset-version/DatasetVersionObject-datacite-nationalgallery.yaml + - src/examples/dataset-version/DatasetVersionObject-dats.yaml + - src/examples/dataset-version/DatasetVersionObject-funding.yaml + - src/examples/dataset-version/DatasetVersionObject-identifiers.yaml + - src/examples/dataset-version/DatasetVersionObject-penguins.yaml + - src/examples/dataset-version/DatasetVersionObject-rocrate-attributions.yaml + - src/examples/dataset-version/DatasetVersionObject-rocrate-minimal.yaml - src/examples/dataset-version/DatasetVersionObject-roleattribution.yaml + - src/examples/dataset-version/DatasetVersionObject-samplesrc.yaml + - src/examples/dataset-version/DatasetVersionObject-topic.yaml plugins: JsonschemaValidationPlugin: closed: true