Skip to content
Permalink
Browse files
chore: improve ontology schema and extend tests (DEV-313) (#140)
* Remove invalid anything onto from test data

* extend test for get command

* add tests for gui element to ontology schema

* add conditionals for gui_attributes to schema

* Remove code smell

* fix errors in schema

* Refactor test_tools.py

* Add documentation for subject attribute
  • Loading branch information
irinaschubert committed Jan 10, 2022
1 parent cbe1876 commit 656ccff0ff553b13b19242c9997220600e53a76f
Showing with 570 additions and 1,044 deletions.
  1. +23 −4 docs/dsp-tools-create-ontologies.md
  2. +424 −3 knora/dsplib/schemas/ontology.json
  3. +102 −46 test/e2e/test_tools.py
  4. +0 −1 testdata/BUILD.bazel
  5. +0 −990 testdata/anything-onto.json
  6. +21 −0 testdata/test-onto.json
@@ -83,6 +83,10 @@ The following fields are mandatory:
- `object`
- `gui_element`

The following fields are optional:

- `subject`

A detailed description of `properties` can be found [below](#properties-object-in-detail).


@@ -140,6 +144,15 @@ By convention, property names start with a lower case letter.
Collection of `labels` for the property as strings with language tag (currently "en", "de", "fr"
and "it" are supported).

### Subject

(optional)

`"subject": "<resource-class>"`

The `subject` defines the resource class the property can be used on. It has to be provided as prefixed name of the
resource class (see [below](#referencing-ontologies) on how prefixed names are used).

### Object / gui_element / gui_attributes

- `object`: required
@@ -636,13 +649,16 @@ Example of a `properties` object:
{
"properties": [
{
"name": "schulcode",
"name": "id",
"subject": ":School",
"object": "TextValue",
"super": [
"hasValue"
],
"labels": {
"de": "Schulcode"
"en": "School ID",
"de": "ID der Schule"
"fr": "ID de l'école"
},
"gui_element": "SimpleText",
"gui_attributes": {
@@ -651,13 +667,16 @@ Example of a `properties` object:
}
},
{
"name": "schulname",
"name": "name",
"subject": ":School",
"object": "TextValue",
"super": [
"hasValue"
],
"labels": {
"de": "Name der Schule"
"en": "Name of the school",
"de": "Name der Schule",
"fr": "Nom de l'école"
},
"gui_element": "SimpleText",
"gui_attributes": {

0 comments on commit 656ccff

Please sign in to comment.