Skip to content
Permalink
Browse files
fix(schema): list root node needs a comments object (DEV-61) (#122)
* list root node needs a "comments" object

* add node without comment to test onto

* Update documentation regarding comments for lists

Co-authored-by: irinaschubert <irina.schubert@dasch.swiss>
  • Loading branch information
jnussbaum and irinaschubert committed Nov 25, 2021
1 parent f9a95ed commit 7bdc58961a7ae4312c1444802a32fd0dbd0176dc
Showing with 17 additions and 9 deletions.
  1. +9 −4 docs/dsp-tools-create.md
  2. +7 −1 knora/dsplib/schemas/ontology.json
  3. +1 −4 testdata/test-onto.json
@@ -181,7 +181,8 @@ A node of a list may have the following elements:
- _labels_: Label with language tags in the form `{ "<lang>": "<label>", "<lang>": "<label>", ... }`. The `labels`
element is mandatory. It needs to specify at least one language. Currently, "de", "en", "fr" and "it" are supported.
- _comments_: Comment with language tags in the form `{ "<lang>": "<comment>", "<lang>": "<comment>", ... }`.
The `comments` element is optional. Currently, "de", "en", "fr" and "it" are supported.
Currently, "de", "en", "fr" and "it" are supported. The `comments` element is mandatory for the root node of the list.
For all other nodes, it is optional. If not used, the element should be omitted.
- _nodes_: Array of sub-nodes. The `nodes` element is optional and can be omitted in case of a flat list.

Example of a list:
@@ -309,6 +310,10 @@ file(s) can be directly referenced inside the list definition by defining it as
"en": "List from an Excel file",
"de": "Liste von einer Excel-Datei"
},
"comments": {
"en": "This is just an example.",
"fr": "C'est un example."
},
"nodes": {
"folder": "excel-lists"
}
@@ -319,7 +324,7 @@ The nodes section must contain the field:

- _folder_: Path to the folder where the Excel files are stored

Further details to this functionality can be read
Further details to this functionality can be found
[here](dsp-tools-excel#create-a-list-from-one-or-several-excel-files).

The `lists` element is optional. If not used, it should be omitted.
@@ -355,7 +360,7 @@ Example:
}
```

The `groups` element is optional. It is currently not recommended using it.
The `groups` element is optional. If not used, it should be omitted. It is currently not recommended using it.

### Users

@@ -401,7 +406,7 @@ Example:
}
```

The `users` element is optional.
The `users` element is optional. If not used, it should be omitted.

### Ontologies

@@ -500,7 +500,13 @@
"lists": {
"type": "array",
"items": {
"$ref": "#/definitions/node"
"$ref": "#/definitions/node",
"comments": {
"$ref": "#/definitions/comment"
},
"required": [
"comments"
]
}
},
"ontologies": {
@@ -39,10 +39,7 @@
{
"name": "b",
"labels": {
"en": "b_label"
},
"comments": {
"en": "no comment"
"en": "b_label with no comment"
},
"nodes": [
{

0 comments on commit 7bdc589

Please sign in to comment.