Changes for page Technical details
Last modified by lzehl on 2021/07/05 18:57
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -16,7 +16,7 @@ 16 16 In summary, openMINDS is the overall umbrella for a set of distributed GitHub repositories, each defining a particular metadata model for neuroscience research products. 17 17 18 18 (% style="text-align: justify;" %) 19 -The main (or central) [[openMINDS GitHub repository>>https://github.com/HumanBrainProject/openMINDS||rel="noopener noreferrer" target="_blank"]] ingests all these GitHub repositories as [[git-submodules>>https://git-scm.com/docs/git-submodule||rel="noopener noreferrer" target="_blank"]]. Furthermore it stores the openMINDS vocabulary (**##vocab##**),providing generaldefinitionsand references for **types** and **properties**usedinschemasacrossallopenMINDSrepositories(cf. below). And last but not least, it holds the schema representations for all supported metadata formats created by the openMINDS integration pipeline (cf. below).19 +The main (or central) [[openMINDS GitHub repository>>https://github.com/HumanBrainProject/openMINDS||rel="noopener noreferrer" target="_blank"]] ingests all these GitHub repositories as [[git-submodules>>https://git-scm.com/docs/git-submodule||rel="noopener noreferrer" target="_blank"]]. Furthermore it defines the openMINDS vocabulary (**##vocab##**) used for **##types##** and **##properties##** across all schemas independent of their original repository (cf. below). And last but not least, it holds the schema representations for all supported metadata formats created by the openMINDS integration pipeline (cf. below). 20 20 21 21 (% style="text-align: justify;" %) 22 22 For this to work smoothly for the existing, but also for all new openMINDS metadata models, the corresponding openMINDS submodules (GitHub repositories) have to meet the following requirements: ... ... @@ -33,37 +33,101 @@ 33 33 === The openMINDS vocabulary === 34 34 35 35 (% style="text-align: justify;" %) 36 - Throughthe integration pipelineof the openMINDS generator, the openMINDS vocabulary is automatically gathered and stored in the main openMINDS GitHub in order to centrally maintain general definitions and references for **types** and **properties** used in schemas across allopenMINDSrepositories. How this works is explained in the following.36 +((% style="color:#7f8c8d" %)//**coming soon**//(%%)) 37 37 38 +=== The openMINDS schema template syntax === 39 + 38 38 (% style="text-align: justify;" %) 39 - Schematypes andpropertiesare storedin dedicated JSON files (**##types.json##**and**##properties.json##**)underthe folder **##vocab##**locatedin themain openMINDS GitHub directory.Eachschema typeand propertyoccurringin theopenMINDSmetadatamodelsis automaticallyrepresentedthose filesasnesteddictionaries.41 +All openMINDS metadata models use a light-weighted schema template syntax for defining the expected metadata. The correspondingly formatted schema files use the extension: **##.schema.tpl.json##**. 40 40 41 41 (% style="text-align: justify;" %) 42 - The keywords ofthosenesteddictionariesare pre-definedto consistentlycaptureforallschema typesand propertiestheirnamespace, theiroccurrence,their generaldescription,andpossiblereferencesto related ormatchingschematypes andpropertiesof other metadata initiatives(e.g.schema.org). This setupalso allowsusto definesomevalues/entriesto beautomatically filledinbythe openMINDS integration pipeline witheachcommitto oneoftheopenMINDSrepositories(e.g.,the namespace andoccurrence)and otherstobemanuallyeditablelateron(e.g.,thegeneral description and references).44 +Although, as the file extension suggests, this openMINDS schema template syntax is inspired by JSON-Schema, it facilitates or even excludes technical aspects that are generally expected for the openMINDS schemas making them more human-readable, especially for untrained eyes. Behind the scenes, within the openMINDS integration pipeline (cf. below), this schema template syntax is then interpreted and flexibly translated to various formal metadata formats (e.g., JSON-Schema). 43 43 44 44 (% style="text-align: justify;" %) 45 - For security, outdatedentries in thoseopenMINDS vocabularyfiles (e.g. becausethenamespaceoftheschema type orproperty changedor theschema typeorproperty was deleted)arenotautomaticallydeleted,but keptandmarkedasbeingdeprecated.Afterevaluation,deprecatedschema typesorpropertiescanbedeletedmanuallyfromopenMINDSvocabulary.47 +Despite the simplification in comparison to JSON-Schema, the openMINDS schema templates are also, at the core, specially formatted JSON files using a particular syntax, meaning special key-value pairs that define the validation rules of a schema. 46 46 47 47 (% style="text-align: justify;" %) 48 - Withthat,the openMINDSvocabreflects alwaysan up-to-datestatusof the schema types andpropertiesinuse acrossall openMINDS metadatamodels,whileproviding theopportunity to centrally reviewandmaintain theirconsistency andreferences.50 +Please find in the following a full documentation of the openMINDS schema template syntax and how it's key-value pairs need to be defined and interpreted. 49 49 50 -=== The openMINDS schema template syntax === 52 +(% style="text-align: justify;" %) 53 +===== Target & concept templates ===== 51 51 52 52 (% style="text-align: justify;" %) 53 - All openMINDSmetadatamodelsusea light-weightedschema templatesyntaxfor definingthe expectedmetadata.Thecorrespondingly formattedschemafiles use the extension:**##.schema.tpl.json##**.56 +Same as in JSON-Schema, all openMINDS schema templates define the expected name (written in **##lowerCamelCase##**) and value of the metadata, typically called property, under the key **##properties##** as nested dictionaries. Furthermore, the names of obligatory metadata can be listed under the key **##required##**. Here a generalized example: 54 54 58 +{{code language="json"}} 59 +{ 60 + "properties": { 61 + "propertyNameA": {}, 62 + "propertyNameB": {}, 63 + "propertyNameC": {} 64 + }, 65 + "required": [ 66 + "propertyNameA", 67 + "propertyNameC" 68 + ] 69 +} 70 +{{/code}} 71 + 55 55 (% style="text-align: justify;" %) 56 - Although,as the file extensionsuggests,thisopenMINDS schematemplatesyntaxis inspired byJSON-Schema,itfacilitatesorvenxcludestechnical aspectsthat aregenerally expectedfortheopenMINDSschemas makingthemmore human-readable,especially for untrainedeyes.Behind thescenes,within the openMINDSintegrationpipeline(cf.below), thisschematemplatesyntaxisthenterpretedandflexibly translated to various formalmetadataformats (e.g., JSON-Schema).73 +In addition, an openMINDS schema //has to have// a key **##"_type"##** to be recognized as **target template**. In other words, the **##"_type"##** is used to define the openMINDS namespace of a corresponding schema using a particular naming convention. Here again a generalized example: 57 57 75 +{{code language="json"}} 76 +{ 77 + "_type": "https:~/~/openminds.ebrains.eu/<<schema-model>>/<<schema-name>>", 78 + "properties": {} 79 +} 80 +{{/code}} 81 + 58 58 (% style="text-align: justify;" %) 59 - Despite thesimplificationincomparisontoJSON-Schema,the openMINDSschema templatesarealso,at the core,specially formattedJSON files usinga particularsyntax,meaningspecial key-valuepairs thatdefine thevalidationrulesofaschema.83 +Note that **##<<schema-model>>##** has to be replaced with the label of the openMINDS metadata model to which the corresponding schema belongs to, and **##<<schema-name>>##** has to be replaced with the corresponding name of the schema (written in **##CamelCase##**). 60 60 61 61 (% style="text-align: justify;" %) 62 - Pleasefindin the followingafull documentationof the openMINDS schema template syntaxandhowit'skey-valuepairs need to bedefined andinterpreted.86 +If an openMINDS schema template //does not// define a key **##"_type"##** (as in the first example above), it is interpreted as a **concept template** which //has to be// extended to a target template. 63 63 64 64 (% style="text-align: justify;" %) 65 - (//**coming soon**//)89 +Concept templates are and should be used when multiple target templates have the same subset of properties, because they facilitate the long-term maintenance of those shared properties: Instead of defining the same properties repeatedly within multiple target templates, the common subset can be defined within a single concept template and passed on to all extending target templates. 66 66 91 +(% style="text-align: justify;" %) 92 +To define that a target template is the extension of a concept template, the target template can state under **##"_extends"##** the relative path to the concept template. For example, the openMINDS core target template **##Dataset##** extends the core concept template **##researchProduct##** as indicated here: 93 + 94 +{{code language="json"}} 95 +{ 96 + "_type": "https:~/~/openminds.ebrains.eu/core/Dataset", 97 + "_extends": "products/researchProduct.schema.tpl.json" 98 +} 99 +{{/code}} 100 + 101 +(% style="text-align: justify;" %) 102 +Note that this convention requires the concept and corresponding target templates to be located in the same openMINDS metadata model repository. Note also that for properties, the following rules apply for target and concept template: 103 + 104 +1. A concept template has to define some properties which will be inherited by all extending target templates. 105 +1. If a concept template additionally states that some of these properties are required, all extending target templates will require the same properties. 106 +1. A target template can require properties of the concept template, that are not explicitly required within the concept template. In such a case, the other target templates extending the same concept template will not require those properties. 107 +1. A target template can (but does not have to) define and require additional properties that were not defined and required in the concept template. These additionally defined and required properties will not be shared with the other target templates extending the same concept template. 108 + 109 +(% style="text-align: justify;" %) 110 +How to define the expected value of a property will be explained for the different property types in the following sections. 111 + 112 +(% style="text-align: justify;" %) 113 +===== Defining expected values ===== 114 + 115 +(% style="text-align: justify;" %) 116 +The expected value of a property can be defined in large parts in the same way as in JSON-Schema, with some openMINDS syntax specific simplifications and modifications. 117 + 118 +(% style="text-align: justify;" %) 119 +On the first level, the **##"type"##** of the expected property value needs to be defined. In principle, the openMINDS template syntax supports the same value types as JSON-Schema Draft 7.0, meaning: 120 ++ **##"string"##** 121 ++ **##"number"##** 122 ++ **##"integer"##** 123 ++ **##"array"##** 124 ++ **##"boolean"##** 125 ++ **##"null"##** 126 ++ **##"object"##** 127 + 128 +Also very similar to JSON-Schema, additional type-specific keys can be used to set further requirements for the expected value. H 129 + 130 + 67 67 === The openMINDS integration pipeline === 68 68 69 69 (//**coming soon**//)