From cba7be072b4f96cc80f38f871e6253b3864e60d7 Mon Sep 17 00:00:00 2001 From: irinaschubert Date: Mon, 21 Feb 2022 18:06:45 +0100 Subject: [PATCH] feat(ontology): add Representation (DEV-551) (#160) * add Representation to ontology schema * Add Representation to documentation * Update docs/dsp-tools-create-ontologies.md Co-authored-by: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com> Co-authored-by: Johannes Nussbaum <39048939+jnussbaum@users.noreply.github.com> --- docs/dsp-tools-create-ontologies.md | 273 ++++++++++++++++------------ knora/dsplib/schemas/ontology.json | 1 + 2 files changed, 153 insertions(+), 121 deletions(-) diff --git a/docs/dsp-tools-create-ontologies.md b/docs/dsp-tools-create-ontologies.md index 4a1c48585..61611afcf 100644 --- a/docs/dsp-tools-create-ontologies.md +++ b/docs/dsp-tools-create-ontologies.md @@ -258,6 +258,7 @@ on the data type. The following data types are allowed: - `UriValue` - `IntervalValue` - `ListValue` +- `Representation` - any previously defined resource class in case of a link property #### TextValue @@ -301,31 +302,80 @@ Represents a text that may contain standoff markup. } ``` -#### ColorValue +#### IntValue -`"object": "ColorValue"` +`"object": "IntValue"` -A string representation of the color in the hexadecimal form e.g. "#ff8000". +Represents an integer value. *gui-elements / gui_attributes*: -- `Colorpicker`: The only GUI element for _ColorValue_. It's used to choose a color. +- `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes + "maxlength=integer" and "size=integer" are optional. - _gui_attributes_: - - `ncolors=integer` (optional): Number of colors the color picker should present. + - `maxlength=integer` (optional): The maximum number of characters accepted + - `size=integer` (optional): The size of the input field +- `Spinbox`: A GUI element for _IntegerValue_. A text field with and "up"- and "down"-button for increment/decrement. + The attributes "max=decimal" and "min=decimal" are optional. + - _gui_attributes_: + - `max=decimal` (optional): Maximal value + - `min=decimal` (optional): Minimal value *Example:* ```json { - "name": "hasColor", + "name": "hasInteger", "super": [ - "hasColor" + "hasValue" ], - "object": "ColorValue", + "object": "IntValue", "labels": { - "en": "Color" + "en": "Integer" }, - "gui_element": "Colorpicker" + "gui_element": "Spinbox", + "gui_attributes": { + "max": 10.0, + "min": 0.0 + } +} +``` + +#### DecimalValue + +`"object": "DecimalValue"` + +A number with decimal point. + +*gui-elements / gui_attributes*: + +- `Slider`: A GUI element for _DecimalValue_. Provides a slider to select a decimal value. + - _gui_attributes_: + - `max=decimal` (mandatory): maximal value + - `min=decimal` (mandatory): minimal value +- `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes + "maxlength=integer" and "size=integer" are optional. + - _gui_attributes_: + - `maxlength=integer` (optional): maximum number of characters accepted + - `size=integer` (optional): size of the input field + +*Example:* + +```json +{ + "name": "hasDecimal", + "super": [ + "hasValue" + ], + "object": "DecimalValue", + "labels": { + "en": "Decimal number" + }, + "gui_element": "SimpleText", + "gui_attributes": { + "maxlength": 255, + "size": 80 + } } ``` @@ -396,107 +446,70 @@ A time value represents a precise moment in time in the Gregorian calendar. Sinc } ``` -#### DecimalValue +#### IntervalValue -`"object": "DecimalValue"` +`"object": "IntervalValue"` -A number with decimal point. +Represents a time-interval *gui-elements / gui_attributes*: -- `Slider`: A GUI element for _DecimalValue_. Provides a slider to select a decimal value. - - _gui_attributes_: - - `max=decimal` (mandatory): maximal value - - `min=decimal` (mandatory): minimal value - `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes "maxlength=integer" and "size=integer" are optional. - _gui_attributes_: - - `maxlength=integer` (optional): maximum number of characters accepted - - `size=integer` (optional): size of the input field + - `maxlength=integer` (optional): The maximum number of characters accepted + - `size=integer` (optional): The size of the input field +- `Interval`: Two spin boxes, one for each decimal + - _gui_attributes_: No attributes *Example:* ```json { - "name": "hasDecimal", + "name": "hasInterval", "super": [ "hasValue" ], - "object": "DecimalValue", + "object": "IntervalValue", "labels": { - "en": "Decimal number" + "en": "Time interval" }, - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": 255, - "size": 80 - } -} -``` - -#### GeomValue - -`"object": "GeomValue"` - -Represents a geometrical shape as JSON. Geometrical shapes are used to define regions of interest (ROI) on still images -or moving images. - -*gui-elements / gui_attributes*: - -- `Geometry`: not yet implemented. - - _gui_attributes_: No attributes -- `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes - "maxlength=integer" and "size=integer" are optional. - - _gui_attributes_: - - `maxlength=integer` (optional): The maximum number of characters accepted - - `size=integer` (optional): The size of the input field - -*Example*: - -```json -{ - "name": "hasGeometry", - "super": [ - "hasGeometry" - ], - "object": "GeomValue", - "labels": "Geometry", - "gui_element": "SimpleText" + "gui_element": "Interval" } ``` -#### GeonameValue +#### BooleanValue -Represents a location ID in geonames.org. The DSP platform uses identifiers provided by -[geonames.org](https://geonames.orgs) to identify geographical locations. +`"object": "BooleanValue"` + +Represents a Boolean ("true" or "false). *gui-elements / gui_attributes*: -- `Geonames`: The only valid GUI element for _GeonameValue_. It interfaces are with geonames.org and it allows to select - a location. +- `Checkbox`: A GUI element for _BooleanValue_. - _gui_attributes_: No attributes *Example:* ```json { - "name": "hasGeoname", + "name": "hasBoolean", "super": [ "hasValue" ], - "object": "GeonameValue", + "object": "BooleanValue", "labels": { - "en": "Geoname" + "en": "Boolean value" }, - "gui_element": "Geonames" + "gui_element": "Checkbox" } ``` -#### IntValue +#### UriValue -`"object": "IntValue"` +`"object": "UriValue"` -Represents an integer value. +Represents an URI *gui-elements / gui_attributes*: @@ -505,122 +518,110 @@ Represents an integer value. - _gui_attributes_: - `maxlength=integer` (optional): The maximum number of characters accepted - `size=integer` (optional): The size of the input field -- `Spinbox`: A GUI element for _IntegerValue_. A text field with and "up"- and "down"-button for increment/decrement. - The attributes "max=decimal" and "min=decimal" are optional. - - _gui_attributes_: - - `max=decimal` (optional): Maximal value - - `min=decimal` (optional): Minimal value *Example:* ```json { - "name": "hasInteger", + "name": "hasUri", "super": [ "hasValue" ], - "object": "IntValue", + "object": "UriValue", "labels": { - "en": "Integer" + "en": "URI" }, - "gui_element": "Spinbox", + "gui_element": "SimpleText", "gui_attributes": { - "max": 10.0, - "min": 0.0 + "maxlength": 255, + "size": 80 } } ``` -#### BooleanValue - -`"object": "BooleanValue"` +#### GeonameValue -Represents a Boolean ("true" or "false). +Represents a location ID in geonames.org. The DSP platform uses identifiers provided by +[geonames.org](https://geonames.orgs) to identify geographical locations. *gui-elements / gui_attributes*: -- `Checkbox`: A GUI element for _BooleanValue_. +- `Geonames`: The only valid GUI element for _GeonameValue_. It interfaces are with geonames.org and it allows to select + a location. - _gui_attributes_: No attributes *Example:* ```json { - "name": "hasBoolean", + "name": "hasGeoname", "super": [ "hasValue" ], - "object": "BooleanValue", + "object": "GeonameValue", "labels": { - "en": "Boolean value" + "en": "Geoname" }, - "gui_element": "Checkbox" + "gui_element": "Geonames" } ``` -#### UriValue +#### ColorValue -`"object": "UriValue"` +`"object": "ColorValue"` -Represents an URI +A string representation of the color in the hexadecimal form e.g. "#ff8000". *gui-elements / gui_attributes*: -- `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes - "maxlength=integer" and "size=integer" are optional. +- `Colorpicker`: The only GUI element for _ColorValue_. It's used to choose a color. - _gui_attributes_: - - `maxlength=integer` (optional): The maximum number of characters accepted - - `size=integer` (optional): The size of the input field + - `ncolors=integer` (optional): Number of colors the color picker should present. *Example:* ```json { - "name": "hasUri", + "name": "hasColor", "super": [ - "hasValue" + "hasColor" ], - "object": "UriValue", + "object": "ColorValue", "labels": { - "en": "URI" + "en": "Color" }, - "gui_element": "SimpleText", - "gui_attributes": { - "maxlength": 255, - "size": 80 - } + "gui_element": "Colorpicker" } ``` -#### IntervalValue +#### GeomValue -`"object": "IntervalValue"` +`"object": "GeomValue"` -Represents a time-interval +Represents a geometrical shape as JSON. Geometrical shapes are used to define regions of interest (ROI) on still images +or moving images. *gui-elements / gui_attributes*: +- `Geometry`: not yet implemented. + - _gui_attributes_: No attributes - `SimpleText`: A GUI element for _TextValue_. A simple text entry box (one line only). The attributes "maxlength=integer" and "size=integer" are optional. - _gui_attributes_: - `maxlength=integer` (optional): The maximum number of characters accepted - `size=integer` (optional): The size of the input field -- `Interval`: Two spin boxes, one for each decimal - - _gui_attributes_: No attributes -*Example:* +*Example*: ```json { - "name": "hasInterval", + "name": "hasGeometry", "super": [ - "hasValue" + "hasGeometry" ], - "object": "IntervalValue", - "labels": { - "en": "Time interval" - }, - "gui_element": "Interval" + "object": "GeomValue", + "labels": "Geometry", + "gui_element": "SimpleText" } ``` @@ -659,6 +660,36 @@ Represents a node of a (possibly hierarchical) list } ``` +#### Representation + +`"object": "Representation"` + +A property pointing to a `knora-base:Representation`. Has to be used in combination with `"super": ["hasRepresentation"]`. A resource having this generic property `hasRepresentation` can point to any type of Representation, be it a `StillImageRepresentation`, an `AudioRepresentation`, etc. + +*gui-elements / gui_attributes*: + +- `Searchbox`: Allows searching resources that have super class `Representation` by entering at least 3 characters into + a searchbox. + - _gui_attributes_: + - `numprops=integer` (optional): While dynamically displaying the search result, the number of properties that + should be displayed. + +*Example:* + +```json +{ + "name": "hasRep", + "super": [ + "hasRepresentation" + ], + "object": "Representation", + "labels": { + "en": "Represented by" + }, + "gui_element": "Searchbox" + } +``` + #### hasLinkTo Property `"object": ":"` @@ -673,9 +704,9 @@ derived from "hasLinkTo" or "isPartOf". "isPartOf" is a special type of linked r *gui-elements/gui_attributes*: -- `Searchbox`: Has to be used with _hasLinkTo_ property. Allows searching resources by entering a resource that the +- `Searchbox`: Has to be used with _hasLinkTo_ property. Allows searching resources by entering the resource name that the given resource should link to. It has one gui_attribute that indicates how many properties of the found resources - should be indicated. This is mandatory. + should be indicated. - _gui_attributes_: - `numprops=integer` (optional): While dynamically displaying the search result, the number of properties that should be displayed. diff --git a/knora/dsplib/schemas/ontology.json b/knora/dsplib/schemas/ontology.json index aacea8f4b..fbfce65cf 100644 --- a/knora/dsplib/schemas/ontology.json +++ b/knora/dsplib/schemas/ontology.json @@ -295,6 +295,7 @@ "ListValue", "Region", "Resource", + "Representation", "Annotation" ] },