Changes for page Technical details

Last modified by lzehl on 2021/07/05 18:57

From version 85.2
edited by lzehl
on 2021/07/05 13:50
Change comment: There is no comment for this version
To version 87.1
edited by lzehl
on 2021/07/05 15:42
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -160,14 +160,13 @@
160 160  ==== Data type depending constraints ====
161 161  
162 162  (% style="text-align: justify;" %)
163 -Depending on the expected data **##"type"##** additional constraints can be made for the metadata entry of a respective property. Currently, the openMINDS schema template syntax supports the following data types: **##"string"##**, ##**"integer"**##, **##"float"##**, **##"boolean"##**, **##"array"##** and **##"object"##**.
163 +Depending on the expected data **##"type"##** additional constraints can be made for the metadata entry of a respective property. Currently, the openMINDS schema template syntax supports the following data types: **##"string"##**, **##"number"##** (integer or float), ##**"integer"**##, **##"float"##**, **##"boolean"##**, **##"object"##** or **##"array"##**. Except for **##"boolean"##**, all these data types can have additional constraints. The essential constraints will be summarized in the following (cf. [[JSON-Schema specifications 7.0>>https://json-schema.org/understanding-json-schema/index.html||rel="noopener noreferrer" target="_blank"]] for more).
164 164  
165 165  (% style="text-align: justify;" %)
166 -If the expected data **##"type"##** is a **##"string"##** the expected number of characters, the format or a regular expression pattern of the string can be further defined. Here a conceptual example for all possible constraints:
166 +If the expected data **##"type"##** is a **##"string"##** the expected number of characters, the format or a regular expression pattern of the string can be further defined. Here abstract examples for all possible string constraints:
167 167  
168 168  {{code language="json"}}
169 169  {
170 - "_type": "https://openminds.ebrains.eu/LABEL_OF_METADATA_MODEL/SCHEMA_NAME",
171 171   "properties": {
172 172   "stringProperty_noConstraints": {
173 173   "type": "string",
... ... @@ -174,15 +174,67 @@
174 174   "_instruction": "Enter a free text."
175 175   },
176 176   "stringProperty_lengthConstraints": {
177 - "maxLength": 6
176 + "maxLength": 6,
178 178   "minLength": 2,
179 179   "type": "string",
180 180   "_instruction": "Enter a free text (allowed numbers of characters: 2 - 6)."
180 + },
181 + "stringProperty_formatConstraints": {
182 + "type": "string",
183 + "_formats": [
184 + "email",
185 + "date",
186 + "time",
187 + "date-time",
188 + "iri"
189 + ]
190 + "_instruction": "Enter a string matching one of the given formats."
191 + },
192 + "stringProperty_patternConstraints": {
193 + "pattern": "«regular_expression_ECMA_262_dialect»"
194 + "type": "string",
195 + "_instruction": "Enter a string matching the given regex pattern."
181 181   }
182 182   }
183 183  }
184 184  {{/code}}
185 185  
201 +(% class="wikigeneratedid" %)
202 +If the expected data **##"type"##** is an **##"integer"##** or a **##"number"##** (float or integer) the expected range or multiples can be further defined. Here abstract examples for all possible  **##"integer"##** and **##"number"##** constraints (not that both constraints can be defined for both data types):
203 +
204 +{{code language="json"}}
205 +{
206 + "properties": {
207 + "integerProperty_noConstraints": {
208 + "type": "integer",
209 + "_instruction": "Enter an integer."
210 + },
211 + "integerProperty_rangeConstraints": {
212 + "maximum": 50,
213 + "minimum": 10,
214 + "type": "integer",
215 + "_instruction": "Enter an integer equal or between 10 and 50."
216 + },
217 + "numberProperty_noConstraints": {
218 + "type": "number",
219 + "_instruction": "Enter a number (float or integer)."
220 + },
221 + "numberProperty_multipleOfConstraints": {
222 + "multipleOf": 10.5,
223 + "type": "number",
224 + "_instruction": "Enter any number which is a multiple of 10.5."
225 + }
226 + }
227 +}
228 +{{/code}}
229 +
230 +(% class="wikigeneratedid" %)
231 +If the expected data **##"type"##** is an **##"object"##** the expected schema type needs to be defined, as well as if the object is linked or embedded. Here abstract examples for all possible  **##"object"##** constraints:
232 +
233 +
234 +(% class="wikigeneratedid" %)
235 +If the expected data **##"type"##** is an **##"array"##** the expected data type of the items in the array, as well as the expected length of the array can be further defined. Valid data types for items are **##"string"##**, **##"number"##**, ##**"integer"**##, **##"float"##**, **##"boolean"##**, and/or **##"object"##**. In addition, items can also be defined as n-tuples with expected data types. Here abstract examples for all possible  **##"array"##** constraints:
236 +
186 186  === The openMINDS integration pipeline ===
187 187  
188 188  (//**coming soon**//) If you'd like to learn more about the openMINDS integration pipeline, especially if you'd like to contribute to it, please get in touch with us (the openMINDS development team) via the issues on the openMINDS or openMINDS_generator GitHub or the support email: openminds@ebrains.eu
Public

openMINDS