From 99d64afbd61e738000121fa3a3186a46490773ed Mon Sep 17 00:00:00 2001 From: Oliver Schmid Date: Mon, 3 Jan 2022 10:10:44 +0100 Subject: [PATCH 1/2] first attempt to formalize graph dependencies --- schemas/data/file.schema.tpl.json | 13 ++ schemas/data/fileBundle.schema.tpl.json | 172 ++++++++++++++---- .../products/datasetVersion.schema.tpl.json | 38 ++++ .../metaDataModelVersion.schema.tpl.json | 9 + schemas/products/modelVersion.schema.tpl.json | 9 + .../researchProductVersion.schema.tpl.json | 47 ++++- .../products/softwareVersion.schema.tpl.json | 9 + schemas/research/tissueSample.schema.tpl.json | 13 ++ 8 files changed, 268 insertions(+), 42 deletions(-) diff --git a/schemas/data/file.schema.tpl.json b/schemas/data/file.schema.tpl.json index a2732a61..3fa7bd74 100644 --- a/schemas/data/file.schema.tpl.json +++ b/schemas/data/file.schema.tpl.json @@ -53,6 +53,19 @@ "_instruction": "Add one or several bundles in which this single file can be grouped.", "_linkedTypes": [ "https://openminds.ebrains.eu/core/FileBundle" + ], + "_restrictions": [ + { + "_isPartOf": [ + { + "@id": "fileRepository" + }, + { + "@reverse": true, + "@id": "isPartOf" + } + ] + } ] }, "name": { diff --git a/schemas/data/fileBundle.schema.tpl.json b/schemas/data/fileBundle.schema.tpl.json index 6073cd1d..06d74a23 100644 --- a/schemas/data/fileBundle.schema.tpl.json +++ b/schemas/data/fileBundle.schema.tpl.json @@ -16,42 +16,140 @@ "_instruction": "Add the entity that played a role in the production of this file bundle.", "_linkedCategories": [ "fileOrigin" - ] - }, - "format": { - "_instruction": "If file instances within this bundle are organized and formatted according to a formal data structure use the appropriate contentType. Leave blank otherwise.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/core/ContentType" - ] - }, - "groupingType": { - "_instruction": "Add the type of grouping that was used to define this file bundle.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/controlledTerms/FileBundleGrouping" - ] - }, - "hash": { - "_instruction": "Add the hash that was generated for this file bundle.", - "_embeddedTypes": [ - "https://openminds.ebrains.eu/core/Hash" - ] - }, - "isPartOf": { - "_instruction": "Add the file bundle or file repository this file bundle is a part of.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/core/FileBundle", - "https://openminds.ebrains.eu/core/FileRepository" - ] - }, - "name": { - "type": "string", - "_instruction": "Enter the name of this file bundle." - }, - "storageSize": { - "_instruction": "Enter the storage size this file bundle allocates.", - "_embeddedTypes": [ - "https://openminds.ebrains.eu/core/QuantitativeValue" - ] + ], + "_restrictions": [ + { + "_excludeSelf": true, + "_isPartOf": [ + { + "@id": "isPartOf" + }, + { + "@reverse": true, + "@id": "repository" + }, + { + "_or": [ + [ + { + "@id": "studyTarget" + } + ], + [ + { + "@id": "technique" + } + ], + [ + { + "@id": "repository" + }, + { + "@reverse": true, + "@id": "fileRepository" + } + ], + [ + { + "@id": "repository" + }, + { + "@reverse": true, + "@id": "fileRepository" + } + ], + [ + { + "@id": "repository" + }, + { + "@reverse": true, + "@id": "isPartOf" + } + ], + [ + { + "@id": "behavioralProtocol" + } + ], + [ + { + "@id": "behavioralProtocol" + } + ], + [ + { + "@id": "studiedSpecimen" + } + ], + [ + { + "@id": "studiedSpecimen" + }, + { + "@id": "studiedState" + } + ], + [ + { + "@id": "studiedSpecimen" + }, + { + "@reverse": true, + "@id": "isPartOf" + } + ], + [ + { + "@id": "studiedSpecimen" + }, + { + "@reverse": true, + "@id": "isPartOf" + }, + { + "@id": "studiedState" + } + ] + ] + } + ] + } + ], + "format": { + "_instruction": "If file instances within this bundle are organized and formatted according to a formal data structure use the appropriate contentType. Leave blank otherwise.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/core/ContentType" + ] + }, + "groupingType": { + "_instruction": "Add the type of grouping that was used to define this file bundle.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/controlledTerms/FileBundleGrouping" + ] + }, + "hash": { + "_instruction": "Add the hash that was generated for this file bundle.", + "_embeddedTypes": [ + "https://openminds.ebrains.eu/core/Hash" + ] + }, + "isPartOf": { + "_instruction": "Add the file bundle or file repository this file bundle is a part of.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/core/FileBundle", + "https://openminds.ebrains.eu/core/FileRepository" + ] + }, + "name": { + "type": "string", + "_instruction": "Enter the name of this file bundle." + }, + "storageSize": { + "_instruction": "Enter the storage size this file bundle allocates.", + "_embeddedTypes": [ + "https://openminds.ebrains.eu/core/QuantitativeValue" + ] + } } } -} diff --git a/schemas/products/datasetVersion.schema.tpl.json b/schemas/products/datasetVersion.schema.tpl.json index 07f733d6..18fb8b14 100644 --- a/schemas/products/datasetVersion.schema.tpl.json +++ b/schemas/products/datasetVersion.schema.tpl.json @@ -17,6 +17,15 @@ "_instruction": "If necessary, add one or several authors (person or organization) that contributed to the production and publication of this dataset version. Note that these authors will overwrite the once provided in the dataset product this version belongs to.", "_linkedCategories": [ "legalPerson" + ], + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "author" + } ] }, "behavioralProtocol": { @@ -68,12 +77,41 @@ "_instruction": "Add all dataset versions that can be used alternatively to this dataset version.", "_linkedTypes": [ "https://openminds.ebrains.eu/core/DatasetVersion" + ], + "_restrictions": [ + { + "_excludeSelf": true, + "_isPartOf": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "hasVersion" + } + ] + } ] }, "isNewVersionOf": { "_instruction": "Add the dataset version preceding this dataset version.", "_linkedTypes": [ "https://openminds.ebrains.eu/core/DatasetVersion" + ], + "_restrictions": [ + { + "_excludeSelf": true, + "_uniqueReference": true, + "_isPartOf": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "hasVersion" + } + ] + } ] }, "license": { diff --git a/schemas/products/metaDataModelVersion.schema.tpl.json b/schemas/products/metaDataModelVersion.schema.tpl.json index 11b5e7ab..dad7fd70 100644 --- a/schemas/products/metaDataModelVersion.schema.tpl.json +++ b/schemas/products/metaDataModelVersion.schema.tpl.json @@ -13,6 +13,15 @@ "_instruction": "If necessary, add one or several developers (person or organization) that contributed to the code implementation of this (meta)data model version. Note that these developers will overwrite the once provided in the (meta)data model product this version belongs to.", "_linkedCategories": [ "legalPerson" + ], + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "developer" + } ] }, "digitalIdentifier": { diff --git a/schemas/products/modelVersion.schema.tpl.json b/schemas/products/modelVersion.schema.tpl.json index 82f9941c..f1ced228 100644 --- a/schemas/products/modelVersion.schema.tpl.json +++ b/schemas/products/modelVersion.schema.tpl.json @@ -13,6 +13,15 @@ "_instruction": "If necessary, add one or several developers (person or organization) that contributed to the code implementation of this model version. Note that these developers will overwrite the once provided in the model product this version belongs to.", "_linkedCategories": [ "legalPerson" + ], + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "developer" + } ] }, "digitalIdentifier": { diff --git a/schemas/products/researchProductVersion.schema.tpl.json b/schemas/products/researchProductVersion.schema.tpl.json index 09807890..6e26ce77 100644 --- a/schemas/products/researchProductVersion.schema.tpl.json +++ b/schemas/products/researchProductVersion.schema.tpl.json @@ -1,4 +1,4 @@ -{ +{ "_categories": [ "researchProduct" ], @@ -24,7 +24,7 @@ ] }, "custodian": { - "type": "array", + "type": "array", "minItems": 1, "uniqueItems": true, "_instruction": "Add one or several person(s) or organization(s) that fulfills the role of a custodian. The role of the custodian is typically fulfilled by a research group leader or principal investigator, but could also be carried out by an organization. Custodians are typically the main contact in case of misconduct, obtain permission from the contributors to publish personal information, and maintain the content and quality of the data, metadata, and/or code of a research product.", @@ -35,7 +35,16 @@ "description": { "type": "string", "maxLength": 2000, - "_instruction": "If necessary, enter a version specific description (abstract) for this research product version (max. 2000 characters, incl. spaces; no references). If left blank, the research product version will inherit the 'description' of it's corresponding research product." + "_instruction": "If necessary, enter a version specific description (abstract) for this research product version (max. 2000 characters, incl. spaces; no references). If left blank, the research product version will inherit the 'description' of it's corresponding research product.", + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "description" + } + ] }, "fullDocumentation": { "_instruction": "Add the DOI, file or URL that points to a full documentation of this research product version.", @@ -43,11 +52,34 @@ "https://openminds.ebrains.eu/core/DOI", "https://openminds.ebrains.eu/core/File", "https://openminds.ebrains.eu/core/URL" + ], + "_restrictions": [ + { + "_forType": "https://openminds.ebrains.eu/core/File", + "_isPartOf": [ + { + "@id": "repository" + }, + { + "@reverse": true, + "@id": "fileRepository" + } + ] + } ] }, "fullName": { "type": "string", "_instruction": "If necessary, enter a version specific descriptive full name (title) for this research product version. If left blank, the research product version will inherit the 'fullName' of it's corresponding research product." + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "fullName" + } + ] }, "funding": { "type": "array", @@ -71,7 +103,7 @@ "keyword": { "type": "array", "maxItems": 5, - "minItems": 1, + "minItems": 1, "uniqueItems": true, "_instruction": "Add controlled or suggest new terms as keywords to this research product version.", "_linkedCategories": [ @@ -108,6 +140,11 @@ "_instruction": "Add the file repository of this research product version.", "_linkedTypes": [ "https://openminds.ebrains.eu/core/FileRepository" + ], + "_restrictions": [ + { + "_uniqueReference": true + } ] }, "shortName": { @@ -117,7 +154,7 @@ }, "supportChannel": { "type": "array", - "minItems": 1, + "minItems": 1, "uniqueItems": true, "_instruction": "Enter all channels through which a user can receive support for handling this research product.", "items": { diff --git a/schemas/products/softwareVersion.schema.tpl.json b/schemas/products/softwareVersion.schema.tpl.json index 2cc5f87f..25f95ead 100644 --- a/schemas/products/softwareVersion.schema.tpl.json +++ b/schemas/products/softwareVersion.schema.tpl.json @@ -27,6 +27,15 @@ "_instruction": "If necessary, add one or several developers (person or organization) that contributed to the code implementation of this software version. Note that these developers will overwrite the once provided in the software product this version belongs to.", "_linkedCategories": [ "legalPerson" + ], + "_fallback": [ + { + "@reverse": true, + "@id": "hasVersion" + }, + { + "@id": "developer" + } ] }, "device": { diff --git a/schemas/research/tissueSample.schema.tpl.json b/schemas/research/tissueSample.schema.tpl.json index f8562096..edfb89c8 100644 --- a/schemas/research/tissueSample.schema.tpl.json +++ b/schemas/research/tissueSample.schema.tpl.json @@ -14,6 +14,19 @@ "_instruction": "Add all tissue sample collections of which this tissue sample is part of.", "_linkedTypes": [ "https://openminds.ebrains.eu/core/TissueSampleCollection" + ], + "_restrictions": [ + { + "_isPartOf": [ + { + "@reverse": true, + "@id": "studiedSpecimen" + }, + { + "@id": "studiedSpecimen" + } + ] + } ] }, "laterality": { From 106a1b4727f86b791d033b32bf3832c0a0ddfd2e Mon Sep 17 00:00:00 2001 From: Oliver Schmid Date: Mon, 3 Jan 2022 10:18:02 +0100 Subject: [PATCH 2/2] fix syntax error --- schemas/data/fileBundle.schema.tpl.json | 73 +++++++++++++------------ 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/schemas/data/fileBundle.schema.tpl.json b/schemas/data/fileBundle.schema.tpl.json index 06d74a23..a2be2bbd 100644 --- a/schemas/data/fileBundle.schema.tpl.json +++ b/schemas/data/fileBundle.schema.tpl.json @@ -115,41 +115,42 @@ } ] } - ], - "format": { - "_instruction": "If file instances within this bundle are organized and formatted according to a formal data structure use the appropriate contentType. Leave blank otherwise.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/core/ContentType" - ] - }, - "groupingType": { - "_instruction": "Add the type of grouping that was used to define this file bundle.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/controlledTerms/FileBundleGrouping" - ] - }, - "hash": { - "_instruction": "Add the hash that was generated for this file bundle.", - "_embeddedTypes": [ - "https://openminds.ebrains.eu/core/Hash" - ] - }, - "isPartOf": { - "_instruction": "Add the file bundle or file repository this file bundle is a part of.", - "_linkedTypes": [ - "https://openminds.ebrains.eu/core/FileBundle", - "https://openminds.ebrains.eu/core/FileRepository" - ] - }, - "name": { - "type": "string", - "_instruction": "Enter the name of this file bundle." - }, - "storageSize": { - "_instruction": "Enter the storage size this file bundle allocates.", - "_embeddedTypes": [ - "https://openminds.ebrains.eu/core/QuantitativeValue" - ] - } + ] + }, + "format": { + "_instruction": "If file instances within this bundle are organized and formatted according to a formal data structure use the appropriate contentType. Leave blank otherwise.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/core/ContentType" + ] + }, + "groupingType": { + "_instruction": "Add the type of grouping that was used to define this file bundle.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/controlledTerms/FileBundleGrouping" + ] + }, + "hash": { + "_instruction": "Add the hash that was generated for this file bundle.", + "_embeddedTypes": [ + "https://openminds.ebrains.eu/core/Hash" + ] + }, + "isPartOf": { + "_instruction": "Add the file bundle or file repository this file bundle is a part of.", + "_linkedTypes": [ + "https://openminds.ebrains.eu/core/FileBundle", + "https://openminds.ebrains.eu/core/FileRepository" + ] + }, + "name": { + "type": "string", + "_instruction": "Enter the name of this file bundle." + }, + "storageSize": { + "_instruction": "Enter the storage size this file bundle allocates.", + "_embeddedTypes": [ + "https://openminds.ebrains.eu/core/QuantitativeValue" + ] } } +}