Changes for page Technical details

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

From version 86.2
edited by lzehl
on 2021/07/05 15:01
Change comment: There is no comment for this version
To version 89.1
edited by lzehl
on 2021/07/05 18:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -160,7 +160,7 @@
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"##**, **##"number"##** (integer or float), ##**"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 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:
... ... @@ -190,9 +190,9 @@
190 190   "_instruction": "Enter a string matching one of the given formats."
191 191   },
192 192   "stringProperty_patternConstraints": {
193 - "pattern": "«regular_expression»"
193 + "pattern": "«regular_expression_ECMA_262_dialect»"
194 194   "type": "string",
195 - "_instruction": "Enter a string matching the given regex pattern (ECMA 262 dialect)."
195 + "_instruction": "Enter a string matching the given regex pattern."
196 196   }
197 197   }
198 198  }
... ... @@ -199,14 +199,29 @@
199 199  {{/code}}
200 200  
201 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:
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 203  
204 204  {{code language="json"}}
205 205  {
206 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 + },
207 207   "numberProperty_noConstraints": {
208 208   "type": "number",
209 209   "_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."
210 210   }
211 211   }
212 212  }
... ... @@ -213,8 +213,80 @@
213 213  {{/code}}
214 214  
215 215  (% class="wikigeneratedid" %)
216 -If ...
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. Note that linked objects can exist by themselves. In contrast embedded objects depend on the existence of their parent schema (if the parent schema is deleted, the embedded objects will be deleted as well). Here abstract examples for all possible  **##"object"##** constraints:
217 217  
233 +{{code language="json"}}
234 +{
235 + "properties": {
236 + "objectProperty_linked": {
237 + "_linkedTypes": [
238 + "«SCHEMA_TYPE»"
239 + ],
240 + "_instruction": "Add the link to an instance conform with the given schema types."
241 + },
242 + "objectProperty_embedded": {
243 + "_embeddedTypes": [
244 + "«SCHEMA_TYPE»"
245 + ],
246 + "_instruction": "Enter an instance conform with the given schema types."
247 + }
248 + }
249 +}
250 +{{/code}}
251 +
252 +(% class="wikigeneratedid" %)
253 +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. Note that any of the above data type depending constraints can be also applied to respective items. All array constraints can be applied to all item types. Here abstract examples for all possible  **##"array"##** constraints:
254 +
255 +{{code language="json"}}
256 +{
257 + "properties": {
258 + "arrayProperty_noConstraints": {
259 + "type": "array",
260 + "_instruction": "Add at least one item of any data type."
261 + },
262 + "arrayProperty_itemsOfTypeInteger": {
263 + "type": "array",
264 + "items": {
265 + "type": "integer"
266 + },
267 + "_instruction": "Add at least one item of data type integer."
268 + },
269 + "arrayProperty_uniqueItemsOfTypeString": {
270 + "type": "array",
271 + "items": {
272 + "type": "string"
273 + },
274 + "uniqueItems": true,
275 + "_instruction": "Add unique items of data type string."
276 + },
277 + "arrayProperty_itemsOfTypeNumber_constrainedArrayLength": {
278 + "type": "array",
279 + "items": {
280 + "type": "number"
281 + },
282 + "maxItems": 3,
283 + "minItems": 2,
284 + "_instruction": "Add 2 or 3 items of data type number."
285 + },
286 + "arrayProperty_objectArray": {
287 + "type": "array",
288 + "_linkedTypes": [
289 + "«SCHEMA_TYPE»"
290 + ],
291 + "_instruction": "Add at least one link to an instance conform with the given schema types."
292 + },
293 + "arrayProperty_tuplesWithDefinedDataTypes": {
294 + "type": "array",
295 + "items": [
296 + {"type": "string"},
297 + {"type": "integer"}
298 + ],
299 + "_instruction": "Add at least one 2-tuple with data type string and integer."
300 + }
301 + }
302 +}
303 +{{/code}}
304 +
218 218  === The openMINDS integration pipeline ===
219 219  
220 220  (//**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