Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 7bdc589
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
13 changes: 9 additions & 4 deletions docs/dsp-tools-create.md
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
}
Expand All @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -401,7 +406,7 @@ Example:
}
```

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

### Ontologies

Expand Down
8 changes: 7 additions & 1 deletion knora/dsplib/schemas/ontology.json
Expand Up @@ -500,7 +500,13 @@
"lists": {
"type": "array",
"items": {
"$ref": "#/definitions/node"
"$ref": "#/definitions/node",
"comments": {
"$ref": "#/definitions/comment"
},
"required": [
"comments"
]
}
},
"ontologies": {
Expand Down
5 changes: 1 addition & 4 deletions testdata/test-onto.json
Expand Up @@ -39,10 +39,7 @@
{
"name": "b",
"labels": {
"en": "b_label"
},
"comments": {
"en": "no comment"
"en": "b_label with no comment"
},
"nodes": [
{
Expand Down

0 comments on commit 7bdc589

Please sign in to comment.