From a2cbc0021254e22b8c0a8e97bca89a3431ae30ea Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 20 Jan 2023 14:31:32 +0100 Subject: [PATCH 01/38] new td examples --- td-examples/1-simple-default/basic-td.json | 29 +++++++ .../1-simple-default/content-type.json | 31 ++++++++ td-examples/1-simple-default/defaults.json | 54 +++++++++++++ .../1-simple-default/form-serialization.json | 8 ++ .../13-semantic-annotations/semantic-1.json | 38 +++++++++ .../14-non-standard/title-description.json | 31 ++++++++ .../15-link-relation-type/collection-rel.json | 16 ++++ .../controlledBy-rel.json | 35 +++++++++ .../15-link-relation-type/item-rel.json | 20 +++++ .../service-doc-rel.json | 36 +++++++++ td-examples/2-properties/basic-td.json | 29 +++++++ td-examples/2-properties/defaults.json | 54 +++++++++++++ .../properties-serializations.json | 51 ++++++++++++ .../3-actions/action-serialization.json | 49 ++++++++++++ td-examples/3-actions/basic-td.json | 29 +++++++ td-examples/3-actions/defaults.json | 54 +++++++++++++ td-examples/3-actions/response.json | 18 +++++ td-examples/4-events/basic-td.json | 29 +++++++ td-examples/4-events/defaults.json | 54 +++++++++++++ td-examples/4-events/event-serialization.json | 26 +++++++ .../6-security-scheme/OAuth-2-0-scopes.json | 38 +++++++++ .../apikey-in-body-simplified.json | 45 +++++++++++ .../6-security-scheme/apikey-in-body.json | 77 +++++++++++++++++++ .../6-security-scheme/apikey-security.json | 31 ++++++++ .../combo-apikey-security.json | 40 ++++++++++ .../combo-security-def-allOf.json | 43 +++++++++++ .../combo-security-def-oneOf.json | 34 ++++++++ .../multiple-security-def.json | 30 ++++++++ .../multiple-security-forms.json | 38 +++++++++ .../6-security-scheme/no-security.json | 32 ++++++++ .../security-def-defaults.json | 31 ++++++++ .../multilanguage-title-description.json | 74 ++++++++++++++++++ .../7-multilanguage/multilanguage.json | 66 ++++++++++++++++ .../combined-uriVariables-href.json | 23 ++++++ .../8-uri-variables/uri-href-structure.json | 18 +++++ .../uri-variables-serialization.json | 24 ++++++ td-examples/9-versioning/versioning.json | 29 +++++++ 37 files changed, 1364 insertions(+) create mode 100644 td-examples/1-simple-default/basic-td.json create mode 100644 td-examples/1-simple-default/content-type.json create mode 100644 td-examples/1-simple-default/defaults.json create mode 100644 td-examples/1-simple-default/form-serialization.json create mode 100644 td-examples/13-semantic-annotations/semantic-1.json create mode 100644 td-examples/14-non-standard/title-description.json create mode 100644 td-examples/15-link-relation-type/collection-rel.json create mode 100644 td-examples/15-link-relation-type/controlledBy-rel.json create mode 100644 td-examples/15-link-relation-type/item-rel.json create mode 100644 td-examples/15-link-relation-type/service-doc-rel.json create mode 100644 td-examples/2-properties/basic-td.json create mode 100644 td-examples/2-properties/defaults.json create mode 100644 td-examples/2-properties/properties-serializations.json create mode 100644 td-examples/3-actions/action-serialization.json create mode 100644 td-examples/3-actions/basic-td.json create mode 100644 td-examples/3-actions/defaults.json create mode 100644 td-examples/3-actions/response.json create mode 100644 td-examples/4-events/basic-td.json create mode 100644 td-examples/4-events/defaults.json create mode 100644 td-examples/4-events/event-serialization.json create mode 100644 td-examples/6-security-scheme/OAuth-2-0-scopes.json create mode 100644 td-examples/6-security-scheme/apikey-in-body-simplified.json create mode 100644 td-examples/6-security-scheme/apikey-in-body.json create mode 100644 td-examples/6-security-scheme/apikey-security.json create mode 100644 td-examples/6-security-scheme/combo-apikey-security.json create mode 100644 td-examples/6-security-scheme/combo-security-def-allOf.json create mode 100644 td-examples/6-security-scheme/combo-security-def-oneOf.json create mode 100644 td-examples/6-security-scheme/multiple-security-def.json create mode 100644 td-examples/6-security-scheme/multiple-security-forms.json create mode 100644 td-examples/6-security-scheme/no-security.json create mode 100644 td-examples/6-security-scheme/security-def-defaults.json create mode 100644 td-examples/7-multilanguage/multilanguage-title-description.json create mode 100644 td-examples/7-multilanguage/multilanguage.json create mode 100644 td-examples/8-uri-variables/combined-uriVariables-href.json create mode 100644 td-examples/8-uri-variables/uri-href-structure.json create mode 100644 td-examples/8-uri-variables/uri-variables-serialization.json create mode 100644 td-examples/9-versioning/versioning.json diff --git a/td-examples/1-simple-default/basic-td.json b/td-examples/1-simple-default/basic-td.json new file mode 100644 index 00000000..3a388e92 --- /dev/null +++ b/td-examples/1-simple-default/basic-td.json @@ -0,0 +1,29 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/1-simple-default/content-type.json b/td-examples/1-simple-default/content-type.json new file mode 100644 index 00000000..82492df3 --- /dev/null +++ b/td-examples/1-simple-default/content-type.json @@ -0,0 +1,31 @@ + +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyLampThing", + "description": "The contentType member is used to assign a media type [RFC2046] including media type parameters as attribute-value pairs separated by a ; character", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/1-simple-default/defaults.json b/td-examples/1-simple-default/defaults.json new file mode 100644 index 00000000..ba274857 --- /dev/null +++ b/td-examples/1-simple-default/defaults.json @@ -0,0 +1,54 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": false, + "writeOnly": false, + "observable": false, + "forms": [{ + "op": [ + "readproperty", + "writeproperty" + ], + "href": "https://mylamp.example.com/status", + "contentType": "application/json" + }] + } + }, + "actions": { + "toggle": { + "safe": false, + "idempotent": false, + "forms": [{ + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "contentType": "application/json" + }] + } + }, + "events": { + "overheating": { + "data": { + "type": "string", + "readOnly": false, + "writeOnly": false + }, + "forms": [{ + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "contentType": "application/json", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/1-simple-default/form-serialization.json b/td-examples/1-simple-default/form-serialization.json new file mode 100644 index 00000000..48306327 --- /dev/null +++ b/td-examples/1-simple-default/form-serialization.json @@ -0,0 +1,8 @@ +{ + "forms": [{ + "op": "writeproperty", + "href": "http://mytemp.example.com:5683/temp", + "contentType": "application/json", + "htv:methodName": "POST" + }] +} \ No newline at end of file diff --git a/td-examples/13-semantic-annotations/semantic-1.json b/td-examples/13-semantic-annotations/semantic-1.json new file mode 100644 index 00000000..d463485a --- /dev/null +++ b/td-examples/13-semantic-annotations/semantic-1.json @@ -0,0 +1,38 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "saref": "https://w3id.org/saref#" } + ], + "id": "urn:uuid:300f4c4b-ca6b-484a-88cf-fd5224a9a61d", + "title": "MyLampThing", + "@type": "saref:LightSwitch", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "@type": "saref:OnOffState", + "type": "string", + "forms": [{ + "href": "https://mylamp.example.com/status" + }] + } + }, + "actions": { + "toggle": { + "@type": "saref:ToggleCommand", + "forms": [{ + "href": "https://mylamp.example.com/toggle" + }] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/14-non-standard/title-description.json b/td-examples/14-non-standard/title-description.json new file mode 100644 index 00000000..b8253bce --- /dev/null +++ b/td-examples/14-non-standard/title-description.json @@ -0,0 +1,31 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "@language": "en" } + ], + "title": "My Lamp Thing", + "description": "This is a TD description for a smart lamp", + "properties": { + "status": { + "description": "Current Status of the lamp", + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} diff --git a/td-examples/15-link-relation-type/collection-rel.json b/td-examples/15-link-relation-type/collection-rel.json new file mode 100644 index 00000000..2b252aaa --- /dev/null +++ b/td-examples/15-link-relation-type/collection-rel.json @@ -0,0 +1,16 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Electric Motor 1", + "description": "A Thing refers to a group in which it is collected with the collection value", + "base": "coaps://motor1.example.com", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "links": [{ + "rel": "collection", + "href": "coaps://drive.example.com", + "type": " application/td+json" + }] +} \ No newline at end of file diff --git a/td-examples/15-link-relation-type/controlledBy-rel.json b/td-examples/15-link-relation-type/controlledBy-rel.json new file mode 100644 index 00000000..c080d989 --- /dev/null +++ b/td-examples/15-link-relation-type/controlledBy-rel.json @@ -0,0 +1,35 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A reference can be provided that points to a Thing (e.g., a controller) that controls the underlying unit (e.g., a lamp) utilizing controlledBy", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "links": [{ + "rel": "controlledBy", + "href": "https://servient.example.com/things/lampController", + "type": "application/td+json" + }], + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/15-link-relation-type/item-rel.json b/td-examples/15-link-relation-type/item-rel.json new file mode 100644 index 00000000..f07464ca --- /dev/null +++ b/td-examples/15-link-relation-type/item-rel.json @@ -0,0 +1,20 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Electric Drive", + "description": "A superordinate Thing can collect a group of Things and refer to them by using the item value", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "links": [{ + "rel": "item", + "href": "coaps://motor1.example.com", + "type": " application/td+json" + }, + { + "rel": "item", + "href": "coaps://motor2.example.com", + "type": " application/td+json" + }] +} \ No newline at end of file diff --git a/td-examples/15-link-relation-type/service-doc-rel.json b/td-examples/15-link-relation-type/service-doc-rel.json new file mode 100644 index 00000000..3fdf431e --- /dev/null +++ b/td-examples/15-link-relation-type/service-doc-rel.json @@ -0,0 +1,36 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "To point to a developer documentation of a Thing the value service-doc can be used", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "links": [{ + "rel": "service-doc", + "href": "https://mylamp.example.com/howTo", + "type": "application/pdf", + "hreflang": "en" + }], + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/2-properties/basic-td.json b/td-examples/2-properties/basic-td.json new file mode 100644 index 00000000..3a388e92 --- /dev/null +++ b/td-examples/2-properties/basic-td.json @@ -0,0 +1,29 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/2-properties/defaults.json b/td-examples/2-properties/defaults.json new file mode 100644 index 00000000..ba274857 --- /dev/null +++ b/td-examples/2-properties/defaults.json @@ -0,0 +1,54 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": false, + "writeOnly": false, + "observable": false, + "forms": [{ + "op": [ + "readproperty", + "writeproperty" + ], + "href": "https://mylamp.example.com/status", + "contentType": "application/json" + }] + } + }, + "actions": { + "toggle": { + "safe": false, + "idempotent": false, + "forms": [{ + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "contentType": "application/json" + }] + } + }, + "events": { + "overheating": { + "data": { + "type": "string", + "readOnly": false, + "writeOnly": false + }, + "forms": [{ + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "contentType": "application/json", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/2-properties/properties-serializations.json b/td-examples/2-properties/properties-serializations.json new file mode 100644 index 00000000..200b15dc --- /dev/null +++ b/td-examples/2-properties/properties-serializations.json @@ -0,0 +1,51 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "on": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "status": { + "type": "object", + "properties": { + "brightness": { + "type": "number", + "minimum": 0.0, + "maximum": 100.0 + }, + "rgb": { + "type": "array", + "items": { + "type": "number", + "minimum": 0, + "maximum": 255 + }, + "minItems": 3, + "maxItems": 3 + } + }, + "required": ["brightness", "rgb"], + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/3-actions/action-serialization.json b/td-examples/3-actions/action-serialization.json new file mode 100644 index 00000000..53e5e67a --- /dev/null +++ b/td-examples/3-actions/action-serialization.json @@ -0,0 +1,49 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "fade": { + "title": "Fade in/out", + "description": "Smooth fade in and out animation.", + "input": { + "type": "object", + "properties": { + "from": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "to": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "duration": {"type": "number"} + }, + "required": ["to","duration"] + }, + "output": {"type": "string"}, + "forms": [{"href": "https://mylamp.example.com/fade"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/3-actions/basic-td.json b/td-examples/3-actions/basic-td.json new file mode 100644 index 00000000..3a388e92 --- /dev/null +++ b/td-examples/3-actions/basic-td.json @@ -0,0 +1,29 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/3-actions/defaults.json b/td-examples/3-actions/defaults.json new file mode 100644 index 00000000..ba274857 --- /dev/null +++ b/td-examples/3-actions/defaults.json @@ -0,0 +1,54 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": false, + "writeOnly": false, + "observable": false, + "forms": [{ + "op": [ + "readproperty", + "writeproperty" + ], + "href": "https://mylamp.example.com/status", + "contentType": "application/json" + }] + } + }, + "actions": { + "toggle": { + "safe": false, + "idempotent": false, + "forms": [{ + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "contentType": "application/json" + }] + } + }, + "events": { + "overheating": { + "data": { + "type": "string", + "readOnly": false, + "writeOnly": false + }, + "forms": [{ + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "contentType": "application/json", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/3-actions/response.json b/td-examples/3-actions/response.json new file mode 100644 index 00000000..19e7fdd8 --- /dev/null +++ b/td-examples/3-actions/response.json @@ -0,0 +1,18 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyCameraThing", + "description": "In some use cases, the form metadata of the Interaction Affordance not only describes the request, but also provides metadata for the expected response. The response must be a JSON object and contain a contentType", + "actions": { + "takePhoto": { + "forms": [{ + "op": "invokeaction", + "href": "http://camera.example.com/api/snapshot", + "contentType": "application/json", + "response": { + "contentType": "image/jpeg" + } + }] + } + } +} \ No newline at end of file diff --git a/td-examples/4-events/basic-td.json b/td-examples/4-events/basic-td.json new file mode 100644 index 00000000..3a388e92 --- /dev/null +++ b/td-examples/4-events/basic-td.json @@ -0,0 +1,29 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/4-events/defaults.json b/td-examples/4-events/defaults.json new file mode 100644 index 00000000..ba274857 --- /dev/null +++ b/td-examples/4-events/defaults.json @@ -0,0 +1,54 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": false, + "writeOnly": false, + "observable": false, + "forms": [{ + "op": [ + "readproperty", + "writeproperty" + ], + "href": "https://mylamp.example.com/status", + "contentType": "application/json" + }] + } + }, + "actions": { + "toggle": { + "safe": false, + "idempotent": false, + "forms": [{ + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "contentType": "application/json" + }] + } + }, + "events": { + "overheating": { + "data": { + "type": "string", + "readOnly": false, + "writeOnly": false + }, + "forms": [{ + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "contentType": "application/json", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/4-events/event-serialization.json b/td-examples/4-events/event-serialization.json new file mode 100644 index 00000000..187211a4 --- /dev/null +++ b/td-examples/4-events/event-serialization.json @@ -0,0 +1,26 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheated": { + "data": {"type": "string"}, + "forms": [{"href": "https://mylamp.example.com/oh"}] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/OAuth-2-0-scopes.json b/td-examples/6-security-scheme/OAuth-2-0-scopes.json new file mode 100644 index 00000000..31a2e23a --- /dev/null +++ b/td-examples/6-security-scheme/OAuth-2-0-scopes.json @@ -0,0 +1,38 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "oauth2_sc": { + "scheme": "oauth2", + "flow": "client", + "token": "https://example.com/token", + "scopes": ["limited", "special"] + } + }, + "security": "oauth2_sc", + "properties": { + "status": { + "forms": [{ + "href": "https://mylamp.example.com/status", + "scopes": ["limited"] + }] + } + }, + "actions": { + "configure": { + "forms": [{ + "href": "https://mylamp.example.com/configure", + "scopes": ["special"] + }] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} diff --git a/td-examples/6-security-scheme/apikey-in-body-simplified.json b/td-examples/6-security-scheme/apikey-in-body-simplified.json new file mode 100644 index 00000000..55b35867 --- /dev/null +++ b/td-examples/6-security-scheme/apikey-in-body-simplified.json @@ -0,0 +1,45 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "apikey_body": { + "scheme": "apikey", + "in": "body", + "name": "/auth/key" + } + }, + "security": "apikey_body", + "properties": { + "color": { + "type": "object", + "properties": { + "brightness": { + "type": "number" + }, + "rgb": { + "type": "array" + } + }, + "required": ["brightness", "rgb"], + "forms": [{"href": "https://mylamp.example.com/color"}] + } + }, + "action": { + "on": { + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "off": { + "forms": [{"href": "https://mylamp.example.com/off"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/apikey-in-body.json b/td-examples/6-security-scheme/apikey-in-body.json new file mode 100644 index 00000000..0e3fcc88 --- /dev/null +++ b/td-examples/6-security-scheme/apikey-in-body.json @@ -0,0 +1,77 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "apikey_body": { + "scheme": "apikey", + "in": "body", + "name": "/auth/key" + } + }, + "security": "apikey_body", + "properties": { + "color": { + "type": "object", + "properties": { + "brightness": { + "type": "number" + }, + "rgb": { + "type": "array" + }, + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["brightness", "rgb", "auth"], + "forms": [{"href": "https://mylamp.example.com/color"}] + } + }, + "action": { + "on": { + "input": { + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "off": { + "input": { + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/off"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/apikey-security.json b/td-examples/6-security-scheme/apikey-security.json new file mode 100644 index 00000000..75bc97ce --- /dev/null +++ b/td-examples/6-security-scheme/apikey-security.json @@ -0,0 +1,31 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "apikey_key": { + "scheme": "apikey", + "in": "uri", + "name": "adminKey" + } + }, + "security": "apikey_key", + "properties": { + "status": { + "forms": [{"href": "https://mylamp.example.com/{adminKey}/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/combo-apikey-security.json b/td-examples/6-security-scheme/combo-apikey-security.json new file mode 100644 index 00000000..f2e37edb --- /dev/null +++ b/td-examples/6-security-scheme/combo-apikey-security.json @@ -0,0 +1,40 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "apikey_key": { + "scheme": "apikey", + "in": "uri", + "name": "secKey" + }, + "apikey_id": { + "scheme": "apikey", + "in": "uri", + "name": "secClientID" + }, + "apikey_combo": { + "scheme": "combo", + "allOf": ["apikey_key","apikey_id"] + } + }, + "security": "apikey_combo", + "properties": { + "status": { + "forms": [{"href": "https://example.com/{secClientID}/status/{secKey}"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/combo-security-def-allOf.json b/td-examples/6-security-scheme/combo-security-def-allOf.json new file mode 100644 index 00000000..82986d83 --- /dev/null +++ b/td-examples/6-security-scheme/combo-security-def-allOf.json @@ -0,0 +1,43 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "proxy_sc": { + "scheme": "digest", + "proxy": "https://portal.example.com/" + }, + "bearer_sc": { + "scheme": "bearer", + "in": "header", + "format": "jwt", + "alg": "ES256", + "authorization": "https://servient.example.com:8443/" + }, + "combo_sc": { + "scheme": "combo", + "allOf": ["proxy_sc", "bearer_sc"] + } + }, + "security": "combo_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/combo-security-def-oneOf.json b/td-examples/6-security-scheme/combo-security-def-oneOf.json new file mode 100644 index 00000000..7513bfc5 --- /dev/null +++ b/td-examples/6-security-scheme/combo-security-def-oneOf.json @@ -0,0 +1,34 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { "scheme": "basic" }, + "digest_sc": { "scheme": "digest" }, + "bearer_sc": { "scheme": "bearer" }, + "combo_sc": { + "scheme": "combo", + "oneOf": [ "basic_sc", "digest_sc", "bearer_sc" ] + } + }, + "security": "combo_sc", + "properties": { + "status": { + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/multiple-security-def.json b/td-examples/6-security-scheme/multiple-security-def.json new file mode 100644 index 00000000..4a5e71e6 --- /dev/null +++ b/td-examples/6-security-scheme/multiple-security-def.json @@ -0,0 +1,30 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": {"scheme": "basic"}, + "nosec_sc": {"scheme": "nosec"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/multiple-security-forms.json b/td-examples/6-security-scheme/multiple-security-forms.json new file mode 100644 index 00000000..0501e310 --- /dev/null +++ b/td-examples/6-security-scheme/multiple-security-forms.json @@ -0,0 +1,38 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { "scheme": "basic" }, + "digest_sc": { "scheme": "digest" }, + "bearer_sc": { "scheme": "bearer" } + }, + "security": "basic_sc", + "properties": { + "status": { + "forms": [{ + "href": "https://mylamp.example.com/status" + }, { + "href": "https://mylamp.example.com/status", + "security": "digest_sc" + }, { + "href": "https://mylamp.example.com/status", + "security": "bearer_sc" + }] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/6-security-scheme/no-security.json b/td-examples/6-security-scheme/no-security.json new file mode 100644 index 00000000..941e2ee9 --- /dev/null +++ b/td-examples/6-security-scheme/no-security.json @@ -0,0 +1,32 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec" + } + }, + "security": "nosec_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} + + diff --git a/td-examples/6-security-scheme/security-def-defaults.json b/td-examples/6-security-scheme/security-def-defaults.json new file mode 100644 index 00000000..2da545cb --- /dev/null +++ b/td-examples/6-security-scheme/security-def-defaults.json @@ -0,0 +1,31 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/7-multilanguage/multilanguage-title-description.json b/td-examples/7-multilanguage/multilanguage-title-description.json new file mode 100644 index 00000000..b0777bed --- /dev/null +++ b/td-examples/7-multilanguage/multilanguage-title-description.json @@ -0,0 +1,74 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { "@language": "de" } + ], + "title": "MeinDing", + "titles": { + "en": "MyThing", + "de": "MeinDing", + "ja": "私の物", + "zh-Hans": "我的东西", + "zh-Hant": "我的東西" + }, + "description": "Menschenlesbare Informationen.", + "descriptions": { + "en": "Human readable information.", + "de": "Menschenlesbare Informationen.", + "ja": "人間が読むことができる情報", + "zh-Hans": "人们可阅读的信息", + "zh-Hant": "人們可閱讀的資訊" + }, + "properties": { + "on": { + "title": "An/Aus", + "titles": { + "en": "On/Off", + "de": "An/Aus", + "ja": "オンオフ", + "zh-Hans": "开关", + "zh-Hant": "開關" }, + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "status": { + "title": "Zustand", + "titles": { + "en": "Status", + "de": "Zustand", + "ja": "状態", + "zh-Hans": "状态", + "zh-Hant": "狀態" }, + "type": "object", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "title": "Umschalten", + "titles": { + "en": "Toggle", + "de": "Umschalten", + "ja": "トグル", + "zh-Hans": "切换", + "zh-Hant": "切換" }, + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "title": "Überhitzung", + "titles": { + "en": "Overheating", + "de": "Überhitzung", + "ja": "オーバーヒート", + "zh-Hans": "过热", + "zh-Hant": "過熱" }, + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/7-multilanguage/multilanguage.json b/td-examples/7-multilanguage/multilanguage.json new file mode 100644 index 00000000..24a257d8 --- /dev/null +++ b/td-examples/7-multilanguage/multilanguage.json @@ -0,0 +1,66 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "MyThing", + "titles": { + "en": "MyThing", + "de": "MeinDing", + "ja": "私の物", + "zh-Hans": "我的东西", + "zh-Hant": "我的東西" + }, + "descriptions": { + "en": "Human readable information.", + "de": "Menschenlesbare Informationen.", + "ja": "人間が読むことができる情報", + "zh-Hans": "人们可阅读的信息", + "zh-Hant": "人們可閱讀的資訊" + }, + "properties": { + "on": { + "titles": { + "en": "On/Off", + "de": "An/Aus", + "ja": "オンオフ", + "zh-Hans": "开关", + "zh-Hant": "開關" }, + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "status": { + "titles": { + "en": "Status", + "de": "Zustand", + "ja": "状態", + "zh-Hans": "状态", + "zh-Hant": "狀態" }, + "type": "object", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "titles": { + "en": "Toggle", + "de": "Umschalten", + "ja": "トグル", + "zh-Hans": "切换", + "zh-Hant": "切換" }, + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "titles": { + "en": "Overheating", + "de": "Überhitzung", + "ja": "オーバーヒート", + "zh-Hans": "过热", + "zh-Hant": "過熱" }, + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/8-uri-variables/combined-uriVariables-href.json b/td-examples/8-uri-variables/combined-uriVariables-href.json new file mode 100644 index 00000000..cb5324fa --- /dev/null +++ b/td-examples/8-uri-variables/combined-uriVariables-href.json @@ -0,0 +1,23 @@ +{ + "@context": "http://www.w3.org/ns/td", + "title": "Combined uriVariables in href structure", + "properties": { + "weather": { + "uriVariables": { + "city": { + "type": "string", + "description": "City name to find the weather information for" + }, + "unit": { + "type": "string", + "enum": ["fahrenheit_value","celsius_value"], + "description": "Desired unit for the temperature value" + } + }, + "forms": [{ + "href": "http://example.org/weather/{city}/{?unit}", + "htv:methodName": "GET" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/8-uri-variables/uri-href-structure.json b/td-examples/8-uri-variables/uri-href-structure.json new file mode 100644 index 00000000..0590e8a9 --- /dev/null +++ b/td-examples/8-uri-variables/uri-href-structure.json @@ -0,0 +1,18 @@ +{ + "@context": "http://www.w3.org/ns/td", + "title": "uriVariables in href structure", + "properties": { + "weather": { + "uriVariables": { + "city": { + "type": "string", + "description": "City name to find the weather information for" + } + }, + "forms": [{ + "href": "http://example.org/weather/{city}", + "htv:methodName": "GET" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/8-uri-variables/uri-variables-serialization.json b/td-examples/8-uri-variables/uri-variables-serialization.json new file mode 100644 index 00000000..e5666d1f --- /dev/null +++ b/td-examples/8-uri-variables/uri-variables-serialization.json @@ -0,0 +1,24 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "uriVariables", + "properties": { + "weather": { + "uriVariables": { + "lat": { + "type": "number", + "minimum": 0, + "maximum": 90, + "description": "Latitude for the desired location in the world" }, + "long": { + "type": "number", + "minimum": -180, + "maximum": 180, + "description": "Longitude for the desired location in the world" } + }, + "forms": [{ + "href": "http://example.org/weather/{?lat,long}", + "htv:methodName": "GET" + }] + } + } +} \ No newline at end of file diff --git a/td-examples/9-versioning/versioning.json b/td-examples/9-versioning/versioning.json new file mode 100644 index 00000000..62ea91bc --- /dev/null +++ b/td-examples/9-versioning/versioning.json @@ -0,0 +1,29 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "version": { "instance": "1.2.1" }, + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file From b5648bf587c13d4b036b16bcf5dbf2da6c3d2eb9 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 20 Jan 2023 18:43:52 +0100 Subject: [PATCH 02/38] fixed file structure and file naming --- .../TD-Examples/1-simple-default/basic-td.td.jsonld | 0 .../TD-Examples/1-simple-default/content-type.td.jsonld | 0 .../TD-Examples/1-simple-default/defaults.td.jsonld | 0 .../TD-Examples/1-simple-default/form-serialization.td.jsonld | 0 .../TD-Examples/13-semantic-annotations/semantic-1.td.jsonld | 0 .../TD-Examples/14-non-standard/title-description.td.jsonld | 0 .../TD-Examples/15-link-relation-type/collection-rel.td.jsonld | 0 .../TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld | 0 .../TD-Examples/15-link-relation-type/item-rel.td.jsonld | 0 .../TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld | 0 .../TD-Examples/2-properties/basic-td.td.jsonld | 0 .../TD-Examples/2-properties/defaults.td.jsonld | 0 .../TD-Examples/2-properties/properties-serializations.td.jsonld | 0 .../TD-Examples/3-actions/action-serialization.td.jsonld | 0 .../TD-Examples/3-actions/basic-td.td.jsonld | 0 .../TD-Examples/3-actions/defaults.td.jsonld | 0 .../TD-Examples/3-actions/response.td.jsonld | 0 .../TD-Examples/4-events/basic-td.td.jsonld | 0 .../TD-Examples/4-events/defaults.td.jsonld | 0 .../TD-Examples/4-events/event-serialization.td.jsonld | 0 .../TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld | 0 .../6-security-scheme/apikey-in-body-simplified.td.jsonld | 0 .../TD-Examples/6-security-scheme/apikey-in-body.td.jsonld | 0 .../TD-Examples/6-security-scheme/apikey-security.td.jsonld | 0 .../TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld | 0 .../6-security-scheme/combo-security-def-allOf.td.jsonld | 0 .../6-security-scheme/combo-security-def-oneOf.td.jsonld | 0 .../6-security-scheme/multiple-security-def..td.jsonld | 0 .../6-security-scheme/multiple-security-forms.td.jsonld | 0 .../TD-Examples/6-security-scheme/no-security.td.jsonld | 0 .../TD-Examples/6-security-scheme/security-def-defaults.td.jsonld | 0 .../7-multilanguage/multilanguage-title-description.td.jsonld | 0 .../TD-Examples/7-multilanguage/multilanguage.td.jsonld | 0 .../8-uri-variables/combined-uriVariables-href.td.jsonld | 0 .../TD-Examples/8-uri-variables/uri-href-structure.td.jsonld | 0 .../8-uri-variables/uri-variables-serialization.td.jsonld | 0 .../TD-Examples/9-versioning/versioning.td.jsonld | 0 37 files changed, 0 insertions(+), 0 deletions(-) rename td-examples/1-simple-default/basic-td.json => Examples/TD-Examples/1-simple-default/basic-td.td.jsonld (100%) rename td-examples/1-simple-default/content-type.json => Examples/TD-Examples/1-simple-default/content-type.td.jsonld (100%) rename td-examples/1-simple-default/defaults.json => Examples/TD-Examples/1-simple-default/defaults.td.jsonld (100%) rename td-examples/1-simple-default/form-serialization.json => Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld (100%) rename td-examples/13-semantic-annotations/semantic-1.json => Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld (100%) rename td-examples/14-non-standard/title-description.json => Examples/TD-Examples/14-non-standard/title-description.td.jsonld (100%) rename td-examples/15-link-relation-type/collection-rel.json => Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld (100%) rename td-examples/15-link-relation-type/controlledBy-rel.json => Examples/TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld (100%) rename td-examples/15-link-relation-type/item-rel.json => Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld (100%) rename td-examples/15-link-relation-type/service-doc-rel.json => Examples/TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld (100%) rename td-examples/2-properties/basic-td.json => Examples/TD-Examples/2-properties/basic-td.td.jsonld (100%) rename td-examples/2-properties/defaults.json => Examples/TD-Examples/2-properties/defaults.td.jsonld (100%) rename td-examples/2-properties/properties-serializations.json => Examples/TD-Examples/2-properties/properties-serializations.td.jsonld (100%) rename td-examples/3-actions/action-serialization.json => Examples/TD-Examples/3-actions/action-serialization.td.jsonld (100%) rename td-examples/3-actions/basic-td.json => Examples/TD-Examples/3-actions/basic-td.td.jsonld (100%) rename td-examples/3-actions/defaults.json => Examples/TD-Examples/3-actions/defaults.td.jsonld (100%) rename td-examples/3-actions/response.json => Examples/TD-Examples/3-actions/response.td.jsonld (100%) rename td-examples/4-events/basic-td.json => Examples/TD-Examples/4-events/basic-td.td.jsonld (100%) rename td-examples/4-events/defaults.json => Examples/TD-Examples/4-events/defaults.td.jsonld (100%) rename td-examples/4-events/event-serialization.json => Examples/TD-Examples/4-events/event-serialization.td.jsonld (100%) rename td-examples/6-security-scheme/OAuth-2-0-scopes.json => Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld (100%) rename td-examples/6-security-scheme/apikey-in-body-simplified.json => Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld (100%) rename td-examples/6-security-scheme/apikey-in-body.json => Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld (100%) rename td-examples/6-security-scheme/apikey-security.json => Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld (100%) rename td-examples/6-security-scheme/combo-apikey-security.json => Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld (100%) rename td-examples/6-security-scheme/combo-security-def-allOf.json => Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld (100%) rename td-examples/6-security-scheme/combo-security-def-oneOf.json => Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld (100%) rename td-examples/6-security-scheme/multiple-security-def.json => Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld (100%) rename td-examples/6-security-scheme/multiple-security-forms.json => Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld (100%) rename td-examples/6-security-scheme/no-security.json => Examples/TD-Examples/6-security-scheme/no-security.td.jsonld (100%) rename td-examples/6-security-scheme/security-def-defaults.json => Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld (100%) rename td-examples/7-multilanguage/multilanguage-title-description.json => Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld (100%) rename td-examples/7-multilanguage/multilanguage.json => Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld (100%) rename td-examples/8-uri-variables/combined-uriVariables-href.json => Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld (100%) rename td-examples/8-uri-variables/uri-href-structure.json => Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld (100%) rename td-examples/8-uri-variables/uri-variables-serialization.json => Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld (100%) rename td-examples/9-versioning/versioning.json => Examples/TD-Examples/9-versioning/versioning.td.jsonld (100%) diff --git a/td-examples/1-simple-default/basic-td.json b/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld similarity index 100% rename from td-examples/1-simple-default/basic-td.json rename to Examples/TD-Examples/1-simple-default/basic-td.td.jsonld diff --git a/td-examples/1-simple-default/content-type.json b/Examples/TD-Examples/1-simple-default/content-type.td.jsonld similarity index 100% rename from td-examples/1-simple-default/content-type.json rename to Examples/TD-Examples/1-simple-default/content-type.td.jsonld diff --git a/td-examples/1-simple-default/defaults.json b/Examples/TD-Examples/1-simple-default/defaults.td.jsonld similarity index 100% rename from td-examples/1-simple-default/defaults.json rename to Examples/TD-Examples/1-simple-default/defaults.td.jsonld diff --git a/td-examples/1-simple-default/form-serialization.json b/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld similarity index 100% rename from td-examples/1-simple-default/form-serialization.json rename to Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld diff --git a/td-examples/13-semantic-annotations/semantic-1.json b/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld similarity index 100% rename from td-examples/13-semantic-annotations/semantic-1.json rename to Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld diff --git a/td-examples/14-non-standard/title-description.json b/Examples/TD-Examples/14-non-standard/title-description.td.jsonld similarity index 100% rename from td-examples/14-non-standard/title-description.json rename to Examples/TD-Examples/14-non-standard/title-description.td.jsonld diff --git a/td-examples/15-link-relation-type/collection-rel.json b/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld similarity index 100% rename from td-examples/15-link-relation-type/collection-rel.json rename to Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld diff --git a/td-examples/15-link-relation-type/controlledBy-rel.json b/Examples/TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld similarity index 100% rename from td-examples/15-link-relation-type/controlledBy-rel.json rename to Examples/TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld diff --git a/td-examples/15-link-relation-type/item-rel.json b/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld similarity index 100% rename from td-examples/15-link-relation-type/item-rel.json rename to Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld diff --git a/td-examples/15-link-relation-type/service-doc-rel.json b/Examples/TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld similarity index 100% rename from td-examples/15-link-relation-type/service-doc-rel.json rename to Examples/TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld diff --git a/td-examples/2-properties/basic-td.json b/Examples/TD-Examples/2-properties/basic-td.td.jsonld similarity index 100% rename from td-examples/2-properties/basic-td.json rename to Examples/TD-Examples/2-properties/basic-td.td.jsonld diff --git a/td-examples/2-properties/defaults.json b/Examples/TD-Examples/2-properties/defaults.td.jsonld similarity index 100% rename from td-examples/2-properties/defaults.json rename to Examples/TD-Examples/2-properties/defaults.td.jsonld diff --git a/td-examples/2-properties/properties-serializations.json b/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld similarity index 100% rename from td-examples/2-properties/properties-serializations.json rename to Examples/TD-Examples/2-properties/properties-serializations.td.jsonld diff --git a/td-examples/3-actions/action-serialization.json b/Examples/TD-Examples/3-actions/action-serialization.td.jsonld similarity index 100% rename from td-examples/3-actions/action-serialization.json rename to Examples/TD-Examples/3-actions/action-serialization.td.jsonld diff --git a/td-examples/3-actions/basic-td.json b/Examples/TD-Examples/3-actions/basic-td.td.jsonld similarity index 100% rename from td-examples/3-actions/basic-td.json rename to Examples/TD-Examples/3-actions/basic-td.td.jsonld diff --git a/td-examples/3-actions/defaults.json b/Examples/TD-Examples/3-actions/defaults.td.jsonld similarity index 100% rename from td-examples/3-actions/defaults.json rename to Examples/TD-Examples/3-actions/defaults.td.jsonld diff --git a/td-examples/3-actions/response.json b/Examples/TD-Examples/3-actions/response.td.jsonld similarity index 100% rename from td-examples/3-actions/response.json rename to Examples/TD-Examples/3-actions/response.td.jsonld diff --git a/td-examples/4-events/basic-td.json b/Examples/TD-Examples/4-events/basic-td.td.jsonld similarity index 100% rename from td-examples/4-events/basic-td.json rename to Examples/TD-Examples/4-events/basic-td.td.jsonld diff --git a/td-examples/4-events/defaults.json b/Examples/TD-Examples/4-events/defaults.td.jsonld similarity index 100% rename from td-examples/4-events/defaults.json rename to Examples/TD-Examples/4-events/defaults.td.jsonld diff --git a/td-examples/4-events/event-serialization.json b/Examples/TD-Examples/4-events/event-serialization.td.jsonld similarity index 100% rename from td-examples/4-events/event-serialization.json rename to Examples/TD-Examples/4-events/event-serialization.td.jsonld diff --git a/td-examples/6-security-scheme/OAuth-2-0-scopes.json b/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/OAuth-2-0-scopes.json rename to Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld diff --git a/td-examples/6-security-scheme/apikey-in-body-simplified.json b/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/apikey-in-body-simplified.json rename to Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld diff --git a/td-examples/6-security-scheme/apikey-in-body.json b/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/apikey-in-body.json rename to Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld diff --git a/td-examples/6-security-scheme/apikey-security.json b/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/apikey-security.json rename to Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld diff --git a/td-examples/6-security-scheme/combo-apikey-security.json b/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/combo-apikey-security.json rename to Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld diff --git a/td-examples/6-security-scheme/combo-security-def-allOf.json b/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/combo-security-def-allOf.json rename to Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld diff --git a/td-examples/6-security-scheme/combo-security-def-oneOf.json b/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/combo-security-def-oneOf.json rename to Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld diff --git a/td-examples/6-security-scheme/multiple-security-def.json b/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld similarity index 100% rename from td-examples/6-security-scheme/multiple-security-def.json rename to Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld diff --git a/td-examples/6-security-scheme/multiple-security-forms.json b/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/multiple-security-forms.json rename to Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld diff --git a/td-examples/6-security-scheme/no-security.json b/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/no-security.json rename to Examples/TD-Examples/6-security-scheme/no-security.td.jsonld diff --git a/td-examples/6-security-scheme/security-def-defaults.json b/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld similarity index 100% rename from td-examples/6-security-scheme/security-def-defaults.json rename to Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld diff --git a/td-examples/7-multilanguage/multilanguage-title-description.json b/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld similarity index 100% rename from td-examples/7-multilanguage/multilanguage-title-description.json rename to Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld diff --git a/td-examples/7-multilanguage/multilanguage.json b/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld similarity index 100% rename from td-examples/7-multilanguage/multilanguage.json rename to Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld diff --git a/td-examples/8-uri-variables/combined-uriVariables-href.json b/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld similarity index 100% rename from td-examples/8-uri-variables/combined-uriVariables-href.json rename to Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld diff --git a/td-examples/8-uri-variables/uri-href-structure.json b/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld similarity index 100% rename from td-examples/8-uri-variables/uri-href-structure.json rename to Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld diff --git a/td-examples/8-uri-variables/uri-variables-serialization.json b/Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld similarity index 100% rename from td-examples/8-uri-variables/uri-variables-serialization.json rename to Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld diff --git a/td-examples/9-versioning/versioning.json b/Examples/TD-Examples/9-versioning/versioning.td.jsonld similarity index 100% rename from td-examples/9-versioning/versioning.json rename to Examples/TD-Examples/9-versioning/versioning.td.jsonld From 0352ba250608ecce6389bf1fef105092fa9464e2 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:42:45 +0100 Subject: [PATCH 03/38] new td examples --- .../1-simple-default/basic-td.td.jsonld | 1 + .../content-media-&-encoding.td.jsonld | 44 +++++++++++++ .../1-simple-default/content-type.td.jsonld | 25 +++++--- .../1-simple-default/defaults.td.jsonld | 1 + .../form-serialization.td.jsonld | 52 ++++++++++++++-- .../simple-context.td.jsonld} | 1 + .../additional-responses.td.jsonld | 57 +++++++++++++++++ .../simple-response.td.jsonld | 37 +++++++++++ .../data-schema-serialization.td.jsonld | 51 ++++++++++++++++ .../readallproperties.td.jsonld | 44 +++++++++++++ .../top-level-uriVariables.td.jsonld | 61 +++++++++++++++++++ .../writeallproperties.td.jsonld | 44 +++++++++++++ .../semantic-1.td.jsonld | 1 + .../collection-rel.td.jsonld | 24 +++++++- .../15-link-relation-type/item-rel.td.jsonld | 22 ++++++- .../2-properties/defaults.td.jsonld | 54 ---------------- .../properties-serializations.td.jsonld | 1 + .../3-actions/action-serialization.td.jsonld | 1 + .../TD-Examples/3-actions/basic-td.td.jsonld | 29 --------- .../TD-Examples/3-actions/defaults.td.jsonld | 54 ---------------- .../TD-Examples/3-actions/response.td.jsonld | 19 ++++++ .../TD-Examples/4-events/basic-td.td.jsonld | 29 --------- .../TD-Examples/4-events/defaults.td.jsonld | 54 ---------------- .../4-events/event-serialization.td.jsonld | 1 + .../OAuth-2-0-scopes.td.jsonld | 1 + .../apikey-in-body-simplified.td.jsonld | 1 + .../apikey-in-body.td.jsonld | 1 + .../apikey-security.td.jsonld | 1 + .../combo-apikey-security.td.jsonld | 1 + .../combo-security-def-allOf.td.jsonld | 1 + .../combo-security-def-oneOf.td.jsonld | 1 + .../multiple-security-def..td.jsonld | 1 + .../multiple-security-forms.td.jsonld | 1 + .../6-security-scheme/no-security.td.jsonld | 1 + .../security-def-defaults.td.jsonld | 1 + .../multilanguage-title-description.td.jsonld | 2 +- .../7-multilanguage/multilanguage.td.jsonld | 8 +-- .../string-direction.td.jsonld | 41 +++++++++++++ .../combined-uriVariables-href.td.jsonld | 17 +++++- ....jsonld => dynaic-uri-variables.td.jsonld} | 21 ++++++- .../uri-href-structure.td.jsonld | 19 +++++- .../9-versioning/versioning.td.jsonld | 1 + Examples/TM-Examples/1-basic/simple-tm.json | 24 ++++++++ 43 files changed, 600 insertions(+), 251 deletions(-) create mode 100644 Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld rename Examples/TD-Examples/{2-properties/basic-td.td.jsonld => 1-simple-default/simple-context.td.jsonld} (81%) create mode 100644 Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld create mode 100644 Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld create mode 100644 Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld create mode 100644 Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld create mode 100644 Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld create mode 100644 Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld delete mode 100644 Examples/TD-Examples/2-properties/defaults.td.jsonld delete mode 100644 Examples/TD-Examples/3-actions/basic-td.td.jsonld delete mode 100644 Examples/TD-Examples/3-actions/defaults.td.jsonld delete mode 100644 Examples/TD-Examples/4-events/basic-td.td.jsonld delete mode 100644 Examples/TD-Examples/4-events/defaults.td.jsonld create mode 100644 Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld rename Examples/TD-Examples/8-uri-variables/{uri-variables-serialization.td.jsonld => dynaic-uri-variables.td.jsonld} (56%) create mode 100644 Examples/TM-Examples/1-basic/simple-tm.json diff --git a/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld b/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld index 3a388e92..aa66cb9f 100644 --- a/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld +++ b/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "This is an example of the most basic form of a td", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld b/Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld new file mode 100644 index 00000000..9ef68cb1 --- /dev/null +++ b/Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld @@ -0,0 +1,44 @@ + +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyCameraThing", + "description": "In some cases binary data is embedded in text-based values, e.g., a JSON string-based value embeds a base64 encoded image. The terms contentMediaType and contentEncoding can be used to clarify the context and encoding format of such name-value pairs.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "image": { + "description": "Provides latest image", + "type": "string", + "contentMediaType": "image/png", + "contentEncoding": "base64", + "forms": [{ + "op": "readproperty", + "href": "http://camera.example.com/lastPicture", + "cov:methodName": "GET", + "contentType": "application/json" + }] + } + }, + "actions": { + "takePhoto": { + "forms": [{ + "op": "invokeaction", + "href": "http://camera.example.com/snapshot", + "contentType": "application/json" + }] + } + }, + "events": { + "lowMemory": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mycamera.example.com/oh", + "contentType": "text/plain", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/1-simple-default/content-type.td.jsonld b/Examples/TD-Examples/1-simple-default/content-type.td.jsonld index 82492df3..3bc51eb8 100644 --- a/Examples/TD-Examples/1-simple-default/content-type.td.jsonld +++ b/Examples/TD-Examples/1-simple-default/content-type.td.jsonld @@ -1,8 +1,7 @@ - { "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", - "title": "MyLampThing", + "title": "MyCameraThing", "description": "The contentType member is used to assign a media type [RFC2046] including media type parameters as attribute-value pairs separated by a ; character", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} @@ -11,21 +10,31 @@ "properties": { "status": { "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] + "forms": [{ + "href": "https://mycamera.example.com/status", + "contentType": "application/json" + }] } }, "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] + "takePhoto": { + "forms": [{ + "op": "invokeaction", + "href": "http://camera.example.com/snapshot", + "contentType": "application/json" + }] } }, "events": { - "overheating": { + "lowMemory": { "data": {"type": "string"}, "forms": [{ - "href": "https://mylamp.example.com/oh", + "href": "https://mycamera.example.com/oh", + "contentType": "text/plain", "subprotocol": "longpoll" }] } } -} \ No newline at end of file +} + + diff --git a/Examples/TD-Examples/1-simple-default/defaults.td.jsonld b/Examples/TD-Examples/1-simple-default/defaults.td.jsonld index ba274857..56a3e842 100644 --- a/Examples/TD-Examples/1-simple-default/defaults.td.jsonld +++ b/Examples/TD-Examples/1-simple-default/defaults.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", "title": "MyLampThing", + "description": "A basic TD with all default values", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld b/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld index 48306327..803fec41 100644 --- a/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld +++ b/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld @@ -1,8 +1,48 @@ { - "forms": [{ - "op": "writeproperty", - "href": "http://mytemp.example.com:5683/temp", - "contentType": "application/json", - "htv:methodName": "POST" - }] + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "This is an example of the most basic form of a td", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "brightness": { + "readOnly": true, + "writeOnly": false, + "observable": false, + "forms": [ + { + "href": "https://mylamp.example.com/brightness", + "contentType": "application/json", + "op": "readproperty" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "https://mylamp.example.com/toggle", + "op": "invokeaction", + "contentType": "application/json" + } + ] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll", + "op": "subscribeevent", + "contentType": "application/json" + } + ] + } + } } \ No newline at end of file diff --git a/Examples/TD-Examples/2-properties/basic-td.td.jsonld b/Examples/TD-Examples/1-simple-default/simple-context.td.jsonld similarity index 81% rename from Examples/TD-Examples/2-properties/basic-td.td.jsonld rename to Examples/TD-Examples/1-simple-default/simple-context.td.jsonld index 3a388e92..571bf1a9 100644 --- a/Examples/TD-Examples/2-properties/basic-td.td.jsonld +++ b/Examples/TD-Examples/1-simple-default/simple-context.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "A member with the name @context and a value of type string is generally used to identify the TD representation format version defined by this specification.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld b/Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld new file mode 100644 index 00000000..3178e714 --- /dev/null +++ b/Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld @@ -0,0 +1,57 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyCarThing", + "description": "The message received from the Thing as part of an Interaction Affordance can differ due to different reasons. Such reasons could be error cases or alternative responses for a valid response. In these cases, additionalResponses terms can be used to describe this behavior", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "schemaDefinitions": { + "actionErrorPayload": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "enum": ["cold","hot","maintenance"] + }, + "timeStamp": { + "description": "UNIX time in numbers indicating when the error happened", + "type": "number" + } + } + } + }, + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mycar.example.com/api/status"}] + } + }, + "actions": { + "startEngine": { + "output": { + "type": "string" + }, + "forms": [{ + "op": "invokeaction", + "href": "http://mycar.example.com/api/engine", + "contentType": "application/json", + "additionalResponses": [{ + "success": false, + "contentType": "application/json", + "schema": "actionErrorPayload" + }] + }] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mycar.example.com/api/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld b/Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld new file mode 100644 index 00000000..65f45793 --- /dev/null +++ b/Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld @@ -0,0 +1,37 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", + "title": "MyCameraThing", + "description": "the Interaction Affordance not only describes the request, but also provides metadata for the expected response. In such cases, the response member is used to indicate the representation format of the response payload. therefore no output schema is required, as the content type fully specifies the representation format.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mycamera.example.com/status"}] + } + }, + "actions": { + "takePhoto": { + "forms": [{ + "op": "invokeaction", + "href": "http://camera.example.com/api/snapshot", + "contentType": "application/json", + "response": { + "contentType": "image/jpeg" + } + }] + } + }, + "events": { + "lowMemory": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mycamera.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld b/Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld new file mode 100644 index 00000000..61c45d26 --- /dev/null +++ b/Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld @@ -0,0 +1,51 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "title": "Status", + "type": "string", + "enum": ["on_value", "off_value", "error_value"], + "forms": [{"href": "https://mylamp.example.com/status"}] + }, + "brightness": { + "title": "Brightness value", + "type": "number", + "minimum": 0.0, + "maximum": 100.0, + "forms": [{"href": "https://mylamp.example.com/brightness"}] + }, + "rgb": { + "title": "RGB color value", + "type": "array", + "items": { + "type": "number", + "minimum": 0, + "maximum": 255 + }, + "minItems": 3, + "maxItems": 3, + "forms": [{"href": "https://mylamp.example.com/rgb"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld b/Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld new file mode 100644 index 00000000..c5e4a614 --- /dev/null +++ b/Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld @@ -0,0 +1,44 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. readallproperties is a type of meta interaction which allows the consumer to read all properties at once", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "on": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "brightness": { + "type": "number", + "forms": [{"href": "https://mylamp.example.com/brightness"}] + }, + "timer": { + "type": "integer", + "forms": [{"href": "https://mylamp.example.com/timer"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + }, + "forms": [{ + "op": "readallproperties", + "href": "https://mylamp.example.com/properties", + "contentType": "application/json", + "htv:methodName": "GET" + }] +} \ No newline at end of file diff --git a/Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld b/Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld new file mode 100644 index 00000000..443a63b7 --- /dev/null +++ b/Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld @@ -0,0 +1,61 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyThing", + "description": "Thing-level uriVariables can be used here to supply further variables to the operation or to specify a list of Property Affordance names for a readmultipleproperties operation", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "on": { + "type": "boolean", + "forms": [{"href": "https://mything.example.com/on"}] + }, + "brightness": { + "type": "number", + "forms": [{"href": "https://mything.example.com/brightness"}] + }, + "timer": { + "type": "integer", + "forms": [{"href": "https://mything.example.com/timer"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mything.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mything.example.com/oh", + "subprotocol": "longpoll" + }] + } + }, + "uriVariables": { + "propertyNames": { + "type": "string", + "description": "Comma separated list of property names to select." + }, + "unitSystem": { + "type": "string", + "enum": ["metric_value","imperial_value","uscustomary_value"], + "description": "System of Measurement that will be used for the values" + } + }, + "forms": [{ + "op": "readallproperties", + "href": "https://mything.example.com/properties{?unitSystem}", + "contentType": "application/json", + "htv:methodName": "GET" + }, + { + "op": "readmultipleproperties", + "href": "https://mything.example.com/properties{?propertyNames,unitSystem}", + "contentType": "application/json", + "htv:methodName": "GET" + }] +} \ No newline at end of file diff --git a/Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld b/Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld new file mode 100644 index 00000000..7d8f48ce --- /dev/null +++ b/Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld @@ -0,0 +1,44 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. writeallproperties is a type of meta interaction which allows the consumer to write all properties at once", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "on": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "brightness": { + "type": "number", + "forms": [{"href": "https://mylamp.example.com/brightness"}] + }, + "timer": { + "type": "integer", + "forms": [{"href": "https://mylamp.example.com/timer"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + }, + "forms": [{ + "op": "writeallproperties", + "href": "https://mylamp.example.com/properties", + "contentType": "application/json", + "htv:methodName": "PUT" + }] +} \ No newline at end of file diff --git a/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld b/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld index d463485a..225d9bf9 100644 --- a/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld +++ b/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld @@ -5,6 +5,7 @@ ], "id": "urn:uuid:300f4c4b-ca6b-484a-88cf-fd5224a9a61d", "title": "MyLampThing", + "description": "Thing Description with TD Context Extension for semantic annotations", "@type": "saref:LightSwitch", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} diff --git a/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld b/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld index 2b252aaa..6e2af6d1 100644 --- a/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld +++ b/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld @@ -2,7 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "Electric Motor 1", - "description": "A Thing refers to a group in which it is collected with the collection value", + "description": "A Thing can also refer to a group in which it is collected with the collection value", "base": "coaps://motor1.example.com", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} @@ -12,5 +12,25 @@ "rel": "collection", "href": "coaps://drive.example.com", "type": " application/td+json" - }] + }], + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://motor1.example.com/status"}] + } + }, + "actions": { + "On": { + "forms": [{"href": "https://motor1.example.com/on"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://motor1.example.com/oh", + "subprotocol": "longpoll" + }] + } + } } \ No newline at end of file diff --git a/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld b/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld index f07464ca..7ace70fc 100644 --- a/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld +++ b/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld @@ -16,5 +16,25 @@ "rel": "item", "href": "coaps://motor2.example.com", "type": " application/td+json" - }] + }], + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://myelectricdrice.example.com/status"}] + } + }, + "actions": { + "On": { + "forms": [{"href": "https://myelectricdrice.example.com/on"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://myelectricdrice.example.com/oh", + "subprotocol": "longpoll" + }] + } + } } \ No newline at end of file diff --git a/Examples/TD-Examples/2-properties/defaults.td.jsonld b/Examples/TD-Examples/2-properties/defaults.td.jsonld deleted file mode 100644 index ba274857..00000000 --- a/Examples/TD-Examples/2-properties/defaults.td.jsonld +++ /dev/null @@ -1,54 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", - "title": "MyLampThing", - "securityDefinitions": { - "basic_sc": { - "scheme": "basic", - "in": "header" - } - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "readOnly": false, - "writeOnly": false, - "observable": false, - "forms": [{ - "op": [ - "readproperty", - "writeproperty" - ], - "href": "https://mylamp.example.com/status", - "contentType": "application/json" - }] - } - }, - "actions": { - "toggle": { - "safe": false, - "idempotent": false, - "forms": [{ - "op": "invokeaction", - "href": "https://mylamp.example.com/toggle", - "contentType": "application/json" - }] - } - }, - "events": { - "overheating": { - "data": { - "type": "string", - "readOnly": false, - "writeOnly": false - }, - "forms": [{ - "op": "subscribeevent", - "href": "https://mylamp.example.com/oh", - "contentType": "application/json", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld b/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld index 200b15dc..fb2cc808 100644 --- a/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld +++ b/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "All name-value pairs of a map of PropertyAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/Examples/TD-Examples/3-actions/action-serialization.td.jsonld b/Examples/TD-Examples/3-actions/action-serialization.td.jsonld index 53e5e67a..d7dbf95e 100644 --- a/Examples/TD-Examples/3-actions/action-serialization.td.jsonld +++ b/Examples/TD-Examples/3-actions/action-serialization.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "All name-value pairs of a Map of ActionAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/Examples/TD-Examples/3-actions/basic-td.td.jsonld b/Examples/TD-Examples/3-actions/basic-td.td.jsonld deleted file mode 100644 index 3a388e92..00000000 --- a/Examples/TD-Examples/3-actions/basic-td.td.jsonld +++ /dev/null @@ -1,29 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "securityDefinitions": { - "basic_sc": {"scheme": "basic", "in": "header"} - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/3-actions/defaults.td.jsonld b/Examples/TD-Examples/3-actions/defaults.td.jsonld deleted file mode 100644 index ba274857..00000000 --- a/Examples/TD-Examples/3-actions/defaults.td.jsonld +++ /dev/null @@ -1,54 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", - "title": "MyLampThing", - "securityDefinitions": { - "basic_sc": { - "scheme": "basic", - "in": "header" - } - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "readOnly": false, - "writeOnly": false, - "observable": false, - "forms": [{ - "op": [ - "readproperty", - "writeproperty" - ], - "href": "https://mylamp.example.com/status", - "contentType": "application/json" - }] - } - }, - "actions": { - "toggle": { - "safe": false, - "idempotent": false, - "forms": [{ - "op": "invokeaction", - "href": "https://mylamp.example.com/toggle", - "contentType": "application/json" - }] - } - }, - "events": { - "overheating": { - "data": { - "type": "string", - "readOnly": false, - "writeOnly": false - }, - "forms": [{ - "op": "subscribeevent", - "href": "https://mylamp.example.com/oh", - "contentType": "application/json", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/3-actions/response.td.jsonld b/Examples/TD-Examples/3-actions/response.td.jsonld index 19e7fdd8..035597d5 100644 --- a/Examples/TD-Examples/3-actions/response.td.jsonld +++ b/Examples/TD-Examples/3-actions/response.td.jsonld @@ -3,6 +3,16 @@ "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyCameraThing", "description": "In some use cases, the form metadata of the Interaction Affordance not only describes the request, but also provides metadata for the expected response. The response must be a JSON object and contain a contentType", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "storageStatus": { + "type": "string", + "forms": [{"href": "https://camera.example.com/api/status"}] + } + }, "actions": { "takePhoto": { "forms": [{ @@ -14,5 +24,14 @@ } }] } + }, + "events": { + "noMemory": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://camera.example.com/api/noMemory", + "subprotocol": "longpoll" + }] + } } } \ No newline at end of file diff --git a/Examples/TD-Examples/4-events/basic-td.td.jsonld b/Examples/TD-Examples/4-events/basic-td.td.jsonld deleted file mode 100644 index 3a388e92..00000000 --- a/Examples/TD-Examples/4-events/basic-td.td.jsonld +++ /dev/null @@ -1,29 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "securityDefinitions": { - "basic_sc": {"scheme": "basic", "in": "header"} - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/4-events/defaults.td.jsonld b/Examples/TD-Examples/4-events/defaults.td.jsonld deleted file mode 100644 index ba274857..00000000 --- a/Examples/TD-Examples/4-events/defaults.td.jsonld +++ /dev/null @@ -1,54 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", - "title": "MyLampThing", - "securityDefinitions": { - "basic_sc": { - "scheme": "basic", - "in": "header" - } - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "readOnly": false, - "writeOnly": false, - "observable": false, - "forms": [{ - "op": [ - "readproperty", - "writeproperty" - ], - "href": "https://mylamp.example.com/status", - "contentType": "application/json" - }] - } - }, - "actions": { - "toggle": { - "safe": false, - "idempotent": false, - "forms": [{ - "op": "invokeaction", - "href": "https://mylamp.example.com/toggle", - "contentType": "application/json" - }] - } - }, - "events": { - "overheating": { - "data": { - "type": "string", - "readOnly": false, - "writeOnly": false - }, - "forms": [{ - "op": "subscribeevent", - "href": "https://mylamp.example.com/oh", - "contentType": "application/json", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/4-events/event-serialization.td.jsonld b/Examples/TD-Examples/4-events/event-serialization.td.jsonld index 187211a4..fe4afd9c 100644 --- a/Examples/TD-Examples/4-events/event-serialization.td.jsonld +++ b/Examples/TD-Examples/4-events/event-serialization.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "All name-value pairs of a Map of EventAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld b/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld index 31a2e23a..39226292 100644 --- a/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "OAuth 2.0 makes use of scopes. These are identifiers that may appear in tokens and must match with corresponding identifiers in a resource to allow access to that resource", "securityDefinitions": { "oauth2_sc": { "scheme": "oauth2", diff --git a/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld b/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld index 55b35867..ab137e8d 100644 --- a/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "It is possbile to simplify how security parameters are included in the payload by using the feature that the location referenced by a JSON pointer in a body location will be automatically inserted if it does not exist.", "securityDefinitions": { "apikey_body": { "scheme": "apikey", diff --git a/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld b/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld index 0e3fcc88..ad3f4eb6 100644 --- a/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "This in an example on how to include security parameters along with the payload", "securityDefinitions": { "apikey_body": { "scheme": "apikey", diff --git a/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld b/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld index 75bc97ce..801c64f0 100644 --- a/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "API key can be included in the request to the Thing in different ways. One way it can be used, is as a URI template where the API key should be replaced in the URI when sending an HTTPS request", "securityDefinitions": { "apikey_key": { "scheme": "apikey", diff --git a/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld b/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld index f2e37edb..a3a95afe 100644 --- a/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "Multiple intances of API security schemes are also possible. These must then be used in the href in in a Form where the security scheme is active", "securityDefinitions": { "apikey_key": { "scheme": "apikey", diff --git a/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld b/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld index 82986d83..ace14cf6 100644 --- a/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "TDs can specify a combination of security schemes. A ComboSecurityScheme with allOf can be used to specify that all need to be satisfied to allow activation of the Interaction Affordance. ", "securityDefinitions": { "proxy_sc": { "scheme": "digest", diff --git a/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld b/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld index 7513bfc5..18c14bad 100644 --- a/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "TDs can specify a combination of security schemes. To avoid redundancy in this case, e.g. repeating the details of the form elements, a ComboSecurityScheme with oneOf can be used instead. ", "securityDefinitions": { "basic_sc": { "scheme": "basic" }, "digest_sc": { "scheme": "digest" }, diff --git a/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld b/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld index 4a5e71e6..13ebed79 100644 --- a/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "A TD can also have multiple security definitions", "securityDefinitions": { "basic_sc": {"scheme": "basic"}, "nosec_sc": {"scheme": "nosec"} diff --git a/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld b/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld index 0501e310..6ff62963 100644 --- a/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "Security configurations can also be specified for different forms within the same Interaction Affordance", "securityDefinitions": { "basic_sc": { "scheme": "basic" }, "digest_sc": { "scheme": "digest" }, diff --git a/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld b/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld index 941e2ee9..7433a5e4 100644 --- a/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "Security configuration in the TD is mandatory, therefore the nosec security scheme is provided for the case that no security is needed", "securityDefinitions": { "nosec_sc": { "scheme": "nosec" diff --git a/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld b/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld index 2da545cb..626eaa8c 100644 --- a/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld +++ b/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "A simple security configuration specifying basic username/password authentication in the header", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld b/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld index b0777bed..becc54f3 100644 --- a/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld +++ b/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld @@ -11,7 +11,7 @@ "zh-Hans": "我的东西", "zh-Hant": "我的東西" }, - "description": "Menschenlesbare Informationen.", + "description": "TD instances may also combine the use of title and description with titles and descriptions. title and description are seeing as the default text", "descriptions": { "en": "Human readable information.", "de": "Menschenlesbare Informationen.", diff --git a/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld b/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld index 24a257d8..cb9693ba 100644 --- a/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld +++ b/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld @@ -8,13 +8,7 @@ "zh-Hans": "我的东西", "zh-Hant": "我的東西" }, - "descriptions": { - "en": "Human readable information.", - "de": "Menschenlesbare Informationen.", - "ja": "人間が読むことができる情報", - "zh-Hans": "人们可阅读的信息", - "zh-Hant": "人們可閱讀的資訊" - }, + "description": "A TD can contain multiple languages, where the name is a valid language tag as defined by [BCP47] and the value is a human-readable string in the language indicated by the tag", "properties": { "on": { "titles": { diff --git a/Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld b/Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld new file mode 100644 index 00000000..7f36695d --- /dev/null +++ b/Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld @@ -0,0 +1,41 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { + "@language": "ar-EG", + "@direction": "rtl" + } + ], + "title": "شيء يخصني يقيس درجة الحرارة", + "description": "Metadata can be used to determine the base direction of string values, utilizing @direction and the values rtl, ltr and null for default direcction", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "temp": { + "title": "درجة الحرارة", + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/temp"}] + }, + "status": { + "title": "حالة", + "type": "object", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld b/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld index cb5324fa..20b0b231 100644 --- a/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld +++ b/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld @@ -1,6 +1,7 @@ { "@context": "http://www.w3.org/ns/td", - "title": "Combined uriVariables in href structure", + "title": "MyWeatherThing", + "description": "Combined dynamic uriVariables and uriVariables in href structure", "properties": { "weather": { "uriVariables": { @@ -19,5 +20,19 @@ "htv:methodName": "GET" }] } + }, + "actions": { + "toggle": { + "forms": [{"href": "http://example.org/toggle"}] + } + }, + "events": { + "lowbatterie": { + "data": {"type": "string"}, + "forms": [{ + "href": "http://example.org/lb", + "subprotocol": "longpoll" + }] + } } } \ No newline at end of file diff --git a/Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld b/Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld similarity index 56% rename from Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld rename to Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld index e5666d1f..008a7c09 100644 --- a/Examples/TD-Examples/8-uri-variables/uri-variables-serialization.td.jsonld +++ b/Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld @@ -1,6 +1,7 @@ { "@context": "https://www.w3.org/2022/wot/td/v1.1", - "title": "uriVariables", + "title": "MyMapThing", + "description": "href may also carry a URI that contains dynamic variables", "properties": { "weather": { "uriVariables": { @@ -16,9 +17,23 @@ "description": "Longitude for the desired location in the world" } }, "forms": [{ - "href": "http://example.org/weather/{?lat,long}", + "href": "http://mymap.example.org/weather/{?lat,long}", "htv:methodName": "GET" }] } + }, + "actions": { + "toggle": { + "forms": [{"href": "http://mymap.example.org/toggle"}] + } + }, + "events": { + "lowbatterie": { + "data": {"type": "string"}, + "forms": [{ + "href": "http://mymap.example.org/toggle", + "subprotocol": "longpoll" + }] + } } -} \ No newline at end of file +} diff --git a/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld b/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld index 0590e8a9..55653caf 100644 --- a/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld +++ b/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld @@ -1,6 +1,7 @@ { - "@context": "http://www.w3.org/ns/td", - "title": "uriVariables in href structure", + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "MyWeatherThing", + "description": "As defined in [RFC6570], uriVariables can be used for replacing the href structure", "properties": { "weather": { "uriVariables": { @@ -14,5 +15,19 @@ "htv:methodName": "GET" }] } + }, + "actions": { + "toggle": { + "forms": [{"href": "http://example.org/toggle"}] + } + }, + "events": { + "lowbatterie": { + "data": {"type": "string"}, + "forms": [{ + "href": "http://example.org/lb", + "subprotocol": "longpoll" + }] + } } } \ No newline at end of file diff --git a/Examples/TD-Examples/9-versioning/versioning.td.jsonld b/Examples/TD-Examples/9-versioning/versioning.td.jsonld index 62ea91bc..2b25700c 100644 --- a/Examples/TD-Examples/9-versioning/versioning.td.jsonld +++ b/Examples/TD-Examples/9-versioning/versioning.td.jsonld @@ -2,6 +2,7 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", + "description": "The version member is intended as container for additional application- and/or device-specific version information based on TD Context Extensions", "version": { "instance": "1.2.1" }, "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} diff --git a/Examples/TM-Examples/1-basic/simple-tm.json b/Examples/TM-Examples/1-basic/simple-tm.json new file mode 100644 index 00000000..8f9ca418 --- /dev/null +++ b/Examples/TM-Examples/1-basic/simple-tm.json @@ -0,0 +1,24 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Lamp Thing Model", + "description": "Basic example of TM", + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file From 686cf2c5ea476efe53634d043a1f5f2b88904ac9 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:59:20 +0100 Subject: [PATCH 04/38] data schema and properties examples --- .../read-&-writeOnly.td.jsonld | 52 +++++++++++++++++++ .../2-properties/readOnly.td.jsonld | 32 ++++++++++++ .../2-properties/writeOnly.td.jsonld | 35 +++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld create mode 100644 Examples/TD-Examples/2-properties/readOnly.td.jsonld create mode 100644 Examples/TD-Examples/2-properties/writeOnly.td.jsonld diff --git a/Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld b/Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld new file mode 100644 index 00000000..d45c3bc6 --- /dev/null +++ b/Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld @@ -0,0 +1,52 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "description": "Read or write On/Off status.", + "type": "object", + "properties": { + "latestStatus": { + "type": "string", + "enum": ["on_value", "off_value"], + "readOnly": true + }, + "newStatusValue": { + "type": "string", + "enum": ["on_value", "off_value"], + "writeOnly": true + } + }, + "forms": [{ + "href": "https://mylamp.example.com/status/latestStatus", + "contentType": "application/json", + "htv:methodName": "GET" + }, + { + "href": "https://mylamp.example.com/status/newStatusValue", + "contentType": "application/json", + "htv:methodName": "GET" + }] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/2-properties/readOnly.td.jsonld b/Examples/TD-Examples/2-properties/readOnly.td.jsonld new file mode 100644 index 00000000..21d0e9b7 --- /dev/null +++ b/Examples/TD-Examples/2-properties/readOnly.td.jsonld @@ -0,0 +1,32 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "readOnly can be used to signal which data items are exchanged in read interactions (i.e., when reading a Property)", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "description": "Read current status of the lamp thing", + "type": "string", + "readOnly": true, + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/2-properties/writeOnly.td.jsonld b/Examples/TD-Examples/2-properties/writeOnly.td.jsonld new file mode 100644 index 00000000..8d831209 --- /dev/null +++ b/Examples/TD-Examples/2-properties/writeOnly.td.jsonld @@ -0,0 +1,35 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "writeOnly can be used to signal which data items are exchanged in write interactions (i.e., when writing a Property)", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "brightness": { + "title": "Brightness value", + "description": "Update brightness values of the lamp thing", + "writeOnly": true, + "type": "number", + "minimum": 0.0, + "maximum": 100.0, + "forms": [{"href": "https://mylamp.example.com/brightness"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file From df77b5041425a3392a0026504ae8885e3a4abf55 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 24 Feb 2023 15:53:09 +0100 Subject: [PATCH 05/38] changes to the td examples --- .../OAuth2-scopes.td.jsonld | 39 ++++++++++ .../apikey-in-body-simplified.td.jsonld | 46 +++++++++++ .../apikey-in-body.td.jsonld | 78 +++++++++++++++++++ .../apikey-security.td.jsonld | 32 ++++++++ .../basic-security.td.jsonld | 32 ++++++++ .../combo-apikey-security.td.jsonld | 41 ++++++++++ .../combo-security-def-allOf.td.jsonld | 44 +++++++++++ .../combo-security-def-oneOf.td.jsonld | 35 +++++++++ .../multiple-security-def.td.jsonld | 31 ++++++++ .../multiple-security-forms.td.jsonld | 39 ++++++++++ .../noSec-security.td.jsonld | 33 ++++++++ .../tds/warning/unavailableRecursiveTm.json | 25 ------ 12 files changed, 450 insertions(+), 25 deletions(-) create mode 100644 Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld create mode 100644 Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld delete mode 100644 packages/core/examples/tds/warning/unavailableRecursiveTm.json diff --git a/Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld b/Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld new file mode 100644 index 00000000..39226292 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld @@ -0,0 +1,39 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "OAuth 2.0 makes use of scopes. These are identifiers that may appear in tokens and must match with corresponding identifiers in a resource to allow access to that resource", + "securityDefinitions": { + "oauth2_sc": { + "scheme": "oauth2", + "flow": "client", + "token": "https://example.com/token", + "scopes": ["limited", "special"] + } + }, + "security": "oauth2_sc", + "properties": { + "status": { + "forms": [{ + "href": "https://mylamp.example.com/status", + "scopes": ["limited"] + }] + } + }, + "actions": { + "configure": { + "forms": [{ + "href": "https://mylamp.example.com/configure", + "scopes": ["special"] + }] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} diff --git a/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld new file mode 100644 index 00000000..ab137e8d --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld @@ -0,0 +1,46 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "It is possbile to simplify how security parameters are included in the payload by using the feature that the location referenced by a JSON pointer in a body location will be automatically inserted if it does not exist.", + "securityDefinitions": { + "apikey_body": { + "scheme": "apikey", + "in": "body", + "name": "/auth/key" + } + }, + "security": "apikey_body", + "properties": { + "color": { + "type": "object", + "properties": { + "brightness": { + "type": "number" + }, + "rgb": { + "type": "array" + } + }, + "required": ["brightness", "rgb"], + "forms": [{"href": "https://mylamp.example.com/color"}] + } + }, + "action": { + "on": { + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "off": { + "forms": [{"href": "https://mylamp.example.com/off"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld new file mode 100644 index 00000000..ad3f4eb6 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld @@ -0,0 +1,78 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "This in an example on how to include security parameters along with the payload", + "securityDefinitions": { + "apikey_body": { + "scheme": "apikey", + "in": "body", + "name": "/auth/key" + } + }, + "security": "apikey_body", + "properties": { + "color": { + "type": "object", + "properties": { + "brightness": { + "type": "number" + }, + "rgb": { + "type": "array" + }, + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["brightness", "rgb", "auth"], + "forms": [{"href": "https://mylamp.example.com/color"}] + } + }, + "action": { + "on": { + "input": { + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/on"}] + }, + "off": { + "input": { + "auth": { + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "required": ["key"] + } + }, + "required": ["auth"], + "forms": [{"href": "https://mylamp.example.com/off"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld new file mode 100644 index 00000000..801c64f0 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld @@ -0,0 +1,32 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "API key can be included in the request to the Thing in different ways. One way it can be used, is as a URI template where the API key should be replaced in the URI when sending an HTTPS request", + "securityDefinitions": { + "apikey_key": { + "scheme": "apikey", + "in": "uri", + "name": "adminKey" + } + }, + "security": "apikey_key", + "properties": { + "status": { + "forms": [{"href": "https://mylamp.example.com/{adminKey}/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld new file mode 100644 index 00000000..626eaa8c --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld @@ -0,0 +1,32 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A simple security configuration specifying basic username/password authentication in the header", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld new file mode 100644 index 00000000..a3a95afe --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld @@ -0,0 +1,41 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Multiple intances of API security schemes are also possible. These must then be used in the href in in a Form where the security scheme is active", + "securityDefinitions": { + "apikey_key": { + "scheme": "apikey", + "in": "uri", + "name": "secKey" + }, + "apikey_id": { + "scheme": "apikey", + "in": "uri", + "name": "secClientID" + }, + "apikey_combo": { + "scheme": "combo", + "allOf": ["apikey_key","apikey_id"] + } + }, + "security": "apikey_combo", + "properties": { + "status": { + "forms": [{"href": "https://example.com/{secClientID}/status/{secKey}"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld b/Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld new file mode 100644 index 00000000..ace14cf6 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld @@ -0,0 +1,44 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "TDs can specify a combination of security schemes. A ComboSecurityScheme with allOf can be used to specify that all need to be satisfied to allow activation of the Interaction Affordance. ", + "securityDefinitions": { + "proxy_sc": { + "scheme": "digest", + "proxy": "https://portal.example.com/" + }, + "bearer_sc": { + "scheme": "bearer", + "in": "header", + "format": "jwt", + "alg": "ES256", + "authorization": "https://servient.example.com:8443/" + }, + "combo_sc": { + "scheme": "combo", + "allOf": ["proxy_sc", "bearer_sc"] + } + }, + "security": "combo_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld b/Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld new file mode 100644 index 00000000..18c14bad --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld @@ -0,0 +1,35 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "TDs can specify a combination of security schemes. To avoid redundancy in this case, e.g. repeating the details of the form elements, a ComboSecurityScheme with oneOf can be used instead. ", + "securityDefinitions": { + "basic_sc": { "scheme": "basic" }, + "digest_sc": { "scheme": "digest" }, + "bearer_sc": { "scheme": "bearer" }, + "combo_sc": { + "scheme": "combo", + "oneOf": [ "basic_sc", "digest_sc", "bearer_sc" ] + } + }, + "security": "combo_sc", + "properties": { + "status": { + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld b/Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld new file mode 100644 index 00000000..13ebed79 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld @@ -0,0 +1,31 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A TD can also have multiple security definitions", + "securityDefinitions": { + "basic_sc": {"scheme": "basic"}, + "nosec_sc": {"scheme": "nosec"} + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld b/Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld new file mode 100644 index 00000000..6ff62963 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld @@ -0,0 +1,39 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Security configurations can also be specified for different forms within the same Interaction Affordance", + "securityDefinitions": { + "basic_sc": { "scheme": "basic" }, + "digest_sc": { "scheme": "digest" }, + "bearer_sc": { "scheme": "bearer" } + }, + "security": "basic_sc", + "properties": { + "status": { + "forms": [{ + "href": "https://mylamp.example.com/status" + }, { + "href": "https://mylamp.example.com/status", + "security": "digest_sc" + }, { + "href": "https://mylamp.example.com/status", + "security": "bearer_sc" + }] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "security": "nosec_sc" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld new file mode 100644 index 00000000..7433a5e4 --- /dev/null +++ b/Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld @@ -0,0 +1,33 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Security configuration in the TD is mandatory, therefore the nosec security scheme is provided for the case that no security is needed", + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec" + } + }, + "security": "nosec_sc", + "properties": { + "status": { + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh" + }] + } + } +} + + diff --git a/packages/core/examples/tds/warning/unavailableRecursiveTm.json b/packages/core/examples/tds/warning/unavailableRecursiveTm.json deleted file mode 100644 index 4cc1ad64..00000000 --- a/packages/core/examples/tds/warning/unavailableRecursiveTm.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "@type": "Thing", - "id": "urn:example:123-321-123-321", - "title": "MyLampThing", - "description": "My very lamp thingy.", - "version": { - "instance": "1.0.0", - "model": "1.0.0" - }, - "links": [ - { - "rel": "type", - "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/master/packages/core/examples/tms/invalid/unavailableParent.json", - "type": "application/tm+json" - } - ], - "securityDefinitions": { - "basic_sc": { - "scheme": "basic", - "in": "header" - } - }, - "security": "basic_sc" -} \ No newline at end of file From 0d376b378255d4fc9a6044bb25ed25fb2a4f1585 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 11 Mar 2023 01:15:15 +0100 Subject: [PATCH 06/38] new examples --- .../title-description.td.jsonld | 31 ------ .../OAuth-2-0-scopes.td.jsonld | 39 ------- .../combo-security-def-allOf.td.jsonld | 44 -------- .../combo-security-def-oneOf.td.jsonld | 35 ------ .../multiple-security-def..td.jsonld | 31 ------ .../multiple-security-forms.td.jsonld | 39 ------- .../6-security-scheme/no-security.td.jsonld | 33 ------ .../security-def-defaults.td.jsonld | 32 ------ .../apikey-in-body-simplified.td.jsonld | 46 -------- .../apikey-in-body.td.jsonld | 78 -------------- .../apikey-security.td.jsonld | 32 ------ .../combo-apikey-security.td.jsonld | 41 ------- .../multilanguage-title-description.td.jsonld | 74 ------------- .../combined-uriVariables-href.td.jsonld | 38 ------- .../uri-href-structure.td.jsonld | 33 ------ .../td}/1-simple-default/basic-td.td.jsonld | 0 .../contentMedia-&-contentEncoding.td.jsonld | 0 .../td/1-simple-default/contentType.td.jsonld | 0 .../td}/1-simple-default/defaults.td.jsonld | 0 .../form-serialization.td.jsonld | 0 .../1-simple-default/simple-context.td.jsonld | 0 .../additional-responses.td.jsonld | 0 .../simple-response.td.jsonld | 0 .../multilanguage-title-description.td.jsonld | 102 ++++++++++++++++++ .../11-multilanguage}/multilanguage.td.jsonld | 8 +- .../string-direction.td.jsonld | 3 +- .../combined-uriVariables-href.td.jsonld | 58 ++++++++++ .../dynaic-uriVariables.td.jsonld | 7 ++ .../uri-href-structure.td.jsonld | 50 +++++++++ .../semantic-1.td.jsonld | 0 ...te-information-context-extension.td.jsonld | 52 +++++++++ .../additional-metadata.td.jsonld | 48 +++++++++ .../location-based-metadata.td.jsonld | 41 +++++++ .../collection-rel.td.jsonld | 0 .../controlledBy-rel.td.jsonld | 0 .../15-link-relation-type/item-rel.td.jsonld | 0 .../service-doc-rel.td.jsonld | 0 .../properties-serializations.td.jsonld | 0 .../td}/2-properties/readOnly.td.jsonld | 0 .../td}/2-properties/writeOnly.td.jsonld | 0 .../3-actions/action-serialization.td.jsonld | 0 .../td}/3-actions/response.td.jsonld | 0 .../4-events/event-serialization.td.jsonld | 0 .../CoAP-block-wise-parameters.td.jsonld | 47 ++++++++ .../CoAP-block-wise-transfer.td.jsonld | 45 ++++++++ .../CoAP-content-negotiation.td.jsonld | 63 +++++++++++ .../td/5-protocols/CoAP-hop-limit.td.jsonld | 45 ++++++++ .../CoAP-simple-td-defaults.td.jsonld | 64 +++++++++++ .../CoAP-simple-td-no-defaults.td.jsonld | 46 ++++++++ .../CoAp-observing-resources.td.jsonld | 47 ++++++++ .../5-protocols/HTTP-readproperty.td.jsonld | 50 +++++++++ .../HTTP-simple-td-defaults.td.jsonld | 53 +++++++++ ...bus-multiple-operations-expanded.td.jsonld | 40 +++++++ .../Modbus-multiple-operations.td.jsonld | 34 ++++++ .../5-protocols/Modbus-single-coil.td.jsonld | 34 ++++++ .../extended-forms-multiple-op.td.jsonld | 55 ++++++++++ .../subprotocol-longpoll.td.jsonld | 50 +++++++++ .../OAuth2-scopes.td.jsonld | 0 .../apikey-in-body-simplified.td.jsonld | 0 .../apikey-in-body.td.jsonld | 0 .../apikey-security.td.jsonld | 0 .../basic-security.td.jsonld | 0 .../combo-apikey-security.td.jsonld | 0 .../combo-security-def-allOf.td.jsonld | 3 +- .../combo-security-def-oneOf.td.jsonld | 3 +- .../multiple-security-def.td.jsonld | 0 .../multiple-security-forms.td.jsonld | 3 +- .../noSec-security.td.jsonld | 0 .../data-schema-serialization.td.jsonld | 0 .../readOnly-&-writeOnly.td.jsonld | 0 .../readallproperties.td.jsonld | 0 .../top-level-uriVariables.td.jsonld | 0 .../writeallproperties.td.jsonld | 0 .../td}/9-versioning/versioning.td.jsonld | 0 .../tm}/1-basic/simple-tm.json | 0 packages/core/examples/scripts/readFile.js | 8 +- 76 files changed, 1049 insertions(+), 636 deletions(-) delete mode 100644 Examples/TD-Examples/14-non-standard/title-description.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/no-security.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld delete mode 100644 Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld delete mode 100644 Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld delete mode 100644 Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld delete mode 100644 Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld rename {Examples/TD-Examples => examples/td}/1-simple-default/basic-td.td.jsonld (100%) rename Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld => examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld (100%) rename Examples/TD-Examples/1-simple-default/content-type.td.jsonld => examples/td/1-simple-default/contentType.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/1-simple-default/defaults.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/1-simple-default/form-serialization.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/1-simple-default/simple-context.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/10-response-and-additional-response/additional-responses.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/10-response-and-additional-response/simple-response.td.jsonld (100%) create mode 100644 examples/td/11-multilanguage/multilanguage-title-description.td.jsonld rename {Examples/TD-Examples/7-multilanguage => examples/td/11-multilanguage}/multilanguage.td.jsonld (92%) rename {Examples/TD-Examples/7-multilanguage => examples/td/11-multilanguage}/string-direction.td.jsonld (92%) create mode 100644 examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld rename Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld => examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld (88%) create mode 100644 examples/td/12-uri-variables/uri-href-structure.td.jsonld rename {Examples/TD-Examples => examples/td}/13-semantic-annotations/semantic-1.td.jsonld (100%) create mode 100644 examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld create mode 100644 examples/td/14-non-standard/additional-metadata.td.jsonld create mode 100644 examples/td/14-non-standard/location-based-metadata.td.jsonld rename {Examples/TD-Examples => examples/td}/15-link-relation-type/collection-rel.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/15-link-relation-type/controlledBy-rel.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/15-link-relation-type/item-rel.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/15-link-relation-type/service-doc-rel.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/2-properties/properties-serializations.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/2-properties/readOnly.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/2-properties/writeOnly.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/3-actions/action-serialization.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/3-actions/response.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/4-events/event-serialization.td.jsonld (100%) create mode 100644 examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld create mode 100644 examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld create mode 100644 examples/td/5-protocols/CoAP-content-negotiation.td.jsonld create mode 100644 examples/td/5-protocols/CoAP-hop-limit.td.jsonld create mode 100644 examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld create mode 100644 examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld create mode 100644 examples/td/5-protocols/CoAp-observing-resources.td.jsonld create mode 100644 examples/td/5-protocols/HTTP-readproperty.td.jsonld create mode 100644 examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld create mode 100644 examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld create mode 100644 examples/td/5-protocols/Modbus-multiple-operations.td.jsonld create mode 100644 examples/td/5-protocols/Modbus-single-coil.td.jsonld create mode 100644 examples/td/5-protocols/extended-forms-multiple-op.td.jsonld create mode 100644 examples/td/5-protocols/subprotocol-longpoll.td.jsonld rename {Examples/TD-Examples => examples/td}/6-security-schemes/OAuth2-scopes.td.jsonld (100%) rename {Examples/TD-Examples/6-security-scheme => examples/td/6-security-schemes}/apikey-in-body-simplified.td.jsonld (100%) rename {Examples/TD-Examples/6-security-scheme => examples/td/6-security-schemes}/apikey-in-body.td.jsonld (100%) rename {Examples/TD-Examples/6-security-scheme => examples/td/6-security-schemes}/apikey-security.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/basic-security.td.jsonld (100%) rename {Examples/TD-Examples/6-security-scheme => examples/td/6-security-schemes}/combo-apikey-security.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/combo-security-def-allOf.td.jsonld (92%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/combo-security-def-oneOf.td.jsonld (91%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/multiple-security-def.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/multiple-security-forms.td.jsonld (92%) rename {Examples/TD-Examples => examples/td}/6-security-schemes/noSec-security.td.jsonld (100%) rename {Examples/TD-Examples/11-complex-data-schemas => examples/td/7-complex-data-schemas}/data-schema-serialization.td.jsonld (100%) rename Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld => examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld (100%) rename {Examples/TD-Examples/12-meta-interactions => examples/td/8-meta-interactions}/readallproperties.td.jsonld (100%) rename {Examples/TD-Examples/12-meta-interactions => examples/td/8-meta-interactions}/top-level-uriVariables.td.jsonld (100%) rename {Examples/TD-Examples/12-meta-interactions => examples/td/8-meta-interactions}/writeallproperties.td.jsonld (100%) rename {Examples/TD-Examples => examples/td}/9-versioning/versioning.td.jsonld (100%) rename {Examples/TM-Examples => examples/tm}/1-basic/simple-tm.json (100%) diff --git a/Examples/TD-Examples/14-non-standard/title-description.td.jsonld b/Examples/TD-Examples/14-non-standard/title-description.td.jsonld deleted file mode 100644 index b8253bce..00000000 --- a/Examples/TD-Examples/14-non-standard/title-description.td.jsonld +++ /dev/null @@ -1,31 +0,0 @@ -{ - "@context": [ - "https://www.w3.org/2022/wot/td/v1.1", - { "@language": "en" } - ], - "title": "My Lamp Thing", - "description": "This is a TD description for a smart lamp", - "properties": { - "status": { - "description": "Current Status of the lamp", - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "description": "Turn the lamp on or off", - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "description": "Lamp reaches a critical temperature (overheating)", - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "subprotocol": "longpoll" - }] - } - } -} diff --git a/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld b/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld deleted file mode 100644 index 39226292..00000000 --- a/Examples/TD-Examples/6-security-scheme/OAuth-2-0-scopes.td.jsonld +++ /dev/null @@ -1,39 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "OAuth 2.0 makes use of scopes. These are identifiers that may appear in tokens and must match with corresponding identifiers in a resource to allow access to that resource", - "securityDefinitions": { - "oauth2_sc": { - "scheme": "oauth2", - "flow": "client", - "token": "https://example.com/token", - "scopes": ["limited", "special"] - } - }, - "security": "oauth2_sc", - "properties": { - "status": { - "forms": [{ - "href": "https://mylamp.example.com/status", - "scopes": ["limited"] - }] - } - }, - "actions": { - "configure": { - "forms": [{ - "href": "https://mylamp.example.com/configure", - "scopes": ["special"] - }] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} diff --git a/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld b/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld deleted file mode 100644 index ace14cf6..00000000 --- a/Examples/TD-Examples/6-security-scheme/combo-security-def-allOf.td.jsonld +++ /dev/null @@ -1,44 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "TDs can specify a combination of security schemes. A ComboSecurityScheme with allOf can be used to specify that all need to be satisfied to allow activation of the Interaction Affordance. ", - "securityDefinitions": { - "proxy_sc": { - "scheme": "digest", - "proxy": "https://portal.example.com/" - }, - "bearer_sc": { - "scheme": "bearer", - "in": "header", - "format": "jwt", - "alg": "ES256", - "authorization": "https://servient.example.com:8443/" - }, - "combo_sc": { - "scheme": "combo", - "allOf": ["proxy_sc", "bearer_sc"] - } - }, - "security": "combo_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld b/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld deleted file mode 100644 index 18c14bad..00000000 --- a/Examples/TD-Examples/6-security-scheme/combo-security-def-oneOf.td.jsonld +++ /dev/null @@ -1,35 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "TDs can specify a combination of security schemes. To avoid redundancy in this case, e.g. repeating the details of the form elements, a ComboSecurityScheme with oneOf can be used instead. ", - "securityDefinitions": { - "basic_sc": { "scheme": "basic" }, - "digest_sc": { "scheme": "digest" }, - "bearer_sc": { "scheme": "bearer" }, - "combo_sc": { - "scheme": "combo", - "oneOf": [ "basic_sc", "digest_sc", "bearer_sc" ] - } - }, - "security": "combo_sc", - "properties": { - "status": { - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld b/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld deleted file mode 100644 index 13ebed79..00000000 --- a/Examples/TD-Examples/6-security-scheme/multiple-security-def..td.jsonld +++ /dev/null @@ -1,31 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "A TD can also have multiple security definitions", - "securityDefinitions": { - "basic_sc": {"scheme": "basic"}, - "nosec_sc": {"scheme": "nosec"} - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld b/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld deleted file mode 100644 index 6ff62963..00000000 --- a/Examples/TD-Examples/6-security-scheme/multiple-security-forms.td.jsonld +++ /dev/null @@ -1,39 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "Security configurations can also be specified for different forms within the same Interaction Affordance", - "securityDefinitions": { - "basic_sc": { "scheme": "basic" }, - "digest_sc": { "scheme": "digest" }, - "bearer_sc": { "scheme": "bearer" } - }, - "security": "basic_sc", - "properties": { - "status": { - "forms": [{ - "href": "https://mylamp.example.com/status" - }, { - "href": "https://mylamp.example.com/status", - "security": "digest_sc" - }, { - "href": "https://mylamp.example.com/status", - "security": "bearer_sc" - }] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld b/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld deleted file mode 100644 index 7433a5e4..00000000 --- a/Examples/TD-Examples/6-security-scheme/no-security.td.jsonld +++ /dev/null @@ -1,33 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "Security configuration in the TD is mandatory, therefore the nosec security scheme is provided for the case that no security is needed", - "securityDefinitions": { - "nosec_sc": { - "scheme": "nosec" - } - }, - "security": "nosec_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} - - diff --git a/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld b/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld deleted file mode 100644 index 626eaa8c..00000000 --- a/Examples/TD-Examples/6-security-scheme/security-def-defaults.td.jsonld +++ /dev/null @@ -1,32 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "A simple security configuration specifying basic username/password authentication in the header", - "securityDefinitions": { - "basic_sc": { - "scheme": "basic", - "in": "header" - } - }, - "security": "basic_sc", - "properties": { - "status": { - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld deleted file mode 100644 index ab137e8d..00000000 --- a/Examples/TD-Examples/6-security-schemes/apikey-in-body-simplified.td.jsonld +++ /dev/null @@ -1,46 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "It is possbile to simplify how security parameters are included in the payload by using the feature that the location referenced by a JSON pointer in a body location will be automatically inserted if it does not exist.", - "securityDefinitions": { - "apikey_body": { - "scheme": "apikey", - "in": "body", - "name": "/auth/key" - } - }, - "security": "apikey_body", - "properties": { - "color": { - "type": "object", - "properties": { - "brightness": { - "type": "number" - }, - "rgb": { - "type": "array" - } - }, - "required": ["brightness", "rgb"], - "forms": [{"href": "https://mylamp.example.com/color"}] - } - }, - "action": { - "on": { - "required": ["auth"], - "forms": [{"href": "https://mylamp.example.com/on"}] - }, - "off": { - "forms": [{"href": "https://mylamp.example.com/off"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld deleted file mode 100644 index ad3f4eb6..00000000 --- a/Examples/TD-Examples/6-security-schemes/apikey-in-body.td.jsonld +++ /dev/null @@ -1,78 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "This in an example on how to include security parameters along with the payload", - "securityDefinitions": { - "apikey_body": { - "scheme": "apikey", - "in": "body", - "name": "/auth/key" - } - }, - "security": "apikey_body", - "properties": { - "color": { - "type": "object", - "properties": { - "brightness": { - "type": "number" - }, - "rgb": { - "type": "array" - }, - "auth": { - "type": "object", - "properties": { - "key": { - "type": "string" - } - }, - "required": ["key"] - } - }, - "required": ["brightness", "rgb", "auth"], - "forms": [{"href": "https://mylamp.example.com/color"}] - } - }, - "action": { - "on": { - "input": { - "auth": { - "type": "object", - "properties": { - "key": { - "type": "string" - } - }, - "required": ["key"] - } - }, - "required": ["auth"], - "forms": [{"href": "https://mylamp.example.com/on"}] - }, - "off": { - "input": { - "auth": { - "type": "object", - "properties": { - "key": { - "type": "string" - } - }, - "required": ["key"] - } - }, - "required": ["auth"], - "forms": [{"href": "https://mylamp.example.com/off"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld deleted file mode 100644 index 801c64f0..00000000 --- a/Examples/TD-Examples/6-security-schemes/apikey-security.td.jsonld +++ /dev/null @@ -1,32 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "API key can be included in the request to the Thing in different ways. One way it can be used, is as a URI template where the API key should be replaced in the URI when sending an HTTPS request", - "securityDefinitions": { - "apikey_key": { - "scheme": "apikey", - "in": "uri", - "name": "adminKey" - } - }, - "security": "apikey_key", - "properties": { - "status": { - "forms": [{"href": "https://mylamp.example.com/{adminKey}/status"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld b/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld deleted file mode 100644 index a3a95afe..00000000 --- a/Examples/TD-Examples/6-security-schemes/combo-apikey-security.td.jsonld +++ /dev/null @@ -1,41 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", - "title": "MyLampThing", - "description": "Multiple intances of API security schemes are also possible. These must then be used in the href in in a Form where the security scheme is active", - "securityDefinitions": { - "apikey_key": { - "scheme": "apikey", - "in": "uri", - "name": "secKey" - }, - "apikey_id": { - "scheme": "apikey", - "in": "uri", - "name": "secClientID" - }, - "apikey_combo": { - "scheme": "combo", - "allOf": ["apikey_key","apikey_id"] - } - }, - "security": "apikey_combo", - "properties": { - "status": { - "forms": [{"href": "https://example.com/{secClientID}/status/{secKey}"}] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld b/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld deleted file mode 100644 index becc54f3..00000000 --- a/Examples/TD-Examples/7-multilanguage/multilanguage-title-description.td.jsonld +++ /dev/null @@ -1,74 +0,0 @@ -{ - "@context": [ - "https://www.w3.org/2022/wot/td/v1.1", - { "@language": "de" } - ], - "title": "MeinDing", - "titles": { - "en": "MyThing", - "de": "MeinDing", - "ja": "私の物", - "zh-Hans": "我的东西", - "zh-Hant": "我的東西" - }, - "description": "TD instances may also combine the use of title and description with titles and descriptions. title and description are seeing as the default text", - "descriptions": { - "en": "Human readable information.", - "de": "Menschenlesbare Informationen.", - "ja": "人間が読むことができる情報", - "zh-Hans": "人们可阅读的信息", - "zh-Hant": "人們可閱讀的資訊" - }, - "properties": { - "on": { - "title": "An/Aus", - "titles": { - "en": "On/Off", - "de": "An/Aus", - "ja": "オンオフ", - "zh-Hans": "开关", - "zh-Hant": "開關" }, - "type": "boolean", - "forms": [{"href": "https://mylamp.example.com/on"}] - }, - "status": { - "title": "Zustand", - "titles": { - "en": "Status", - "de": "Zustand", - "ja": "状態", - "zh-Hans": "状态", - "zh-Hant": "狀態" }, - "type": "object", - "forms": [{"href": "https://mylamp.example.com/status"}] - } - }, - "actions": { - "toggle": { - "title": "Umschalten", - "titles": { - "en": "Toggle", - "de": "Umschalten", - "ja": "トグル", - "zh-Hans": "切换", - "zh-Hant": "切換" }, - "forms": [{"href": "https://mylamp.example.com/toggle"}] - } - }, - "events": { - "overheating": { - "title": "Überhitzung", - "titles": { - "en": "Overheating", - "de": "Überhitzung", - "ja": "オーバーヒート", - "zh-Hans": "过热", - "zh-Hant": "過熱" }, - "data": {"type": "string"}, - "forms": [{ - "href": "https://mylamp.example.com/oh", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld b/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld deleted file mode 100644 index 20b0b231..00000000 --- a/Examples/TD-Examples/8-uri-variables/combined-uriVariables-href.td.jsonld +++ /dev/null @@ -1,38 +0,0 @@ -{ - "@context": "http://www.w3.org/ns/td", - "title": "MyWeatherThing", - "description": "Combined dynamic uriVariables and uriVariables in href structure", - "properties": { - "weather": { - "uriVariables": { - "city": { - "type": "string", - "description": "City name to find the weather information for" - }, - "unit": { - "type": "string", - "enum": ["fahrenheit_value","celsius_value"], - "description": "Desired unit for the temperature value" - } - }, - "forms": [{ - "href": "http://example.org/weather/{city}/{?unit}", - "htv:methodName": "GET" - }] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "http://example.org/toggle"}] - } - }, - "events": { - "lowbatterie": { - "data": {"type": "string"}, - "forms": [{ - "href": "http://example.org/lb", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld b/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld deleted file mode 100644 index 55653caf..00000000 --- a/Examples/TD-Examples/8-uri-variables/uri-href-structure.td.jsonld +++ /dev/null @@ -1,33 +0,0 @@ -{ - "@context": "https://www.w3.org/2022/wot/td/v1.1", - "title": "MyWeatherThing", - "description": "As defined in [RFC6570], uriVariables can be used for replacing the href structure", - "properties": { - "weather": { - "uriVariables": { - "city": { - "type": "string", - "description": "City name to find the weather information for" - } - }, - "forms": [{ - "href": "http://example.org/weather/{city}", - "htv:methodName": "GET" - }] - } - }, - "actions": { - "toggle": { - "forms": [{"href": "http://example.org/toggle"}] - } - }, - "events": { - "lowbatterie": { - "data": {"type": "string"}, - "forms": [{ - "href": "http://example.org/lb", - "subprotocol": "longpoll" - }] - } - } -} \ No newline at end of file diff --git a/Examples/TD-Examples/1-simple-default/basic-td.td.jsonld b/examples/td/1-simple-default/basic-td.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/basic-td.td.jsonld rename to examples/td/1-simple-default/basic-td.td.jsonld diff --git a/Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld b/examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/content-media-&-encoding.td.jsonld rename to examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld diff --git a/Examples/TD-Examples/1-simple-default/content-type.td.jsonld b/examples/td/1-simple-default/contentType.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/content-type.td.jsonld rename to examples/td/1-simple-default/contentType.td.jsonld diff --git a/Examples/TD-Examples/1-simple-default/defaults.td.jsonld b/examples/td/1-simple-default/defaults.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/defaults.td.jsonld rename to examples/td/1-simple-default/defaults.td.jsonld diff --git a/Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld b/examples/td/1-simple-default/form-serialization.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/form-serialization.td.jsonld rename to examples/td/1-simple-default/form-serialization.td.jsonld diff --git a/Examples/TD-Examples/1-simple-default/simple-context.td.jsonld b/examples/td/1-simple-default/simple-context.td.jsonld similarity index 100% rename from Examples/TD-Examples/1-simple-default/simple-context.td.jsonld rename to examples/td/1-simple-default/simple-context.td.jsonld diff --git a/Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld b/examples/td/10-response-and-additional-response/additional-responses.td.jsonld similarity index 100% rename from Examples/TD-Examples/10-response-and-additional-response/additional-responses.td.jsonld rename to examples/td/10-response-and-additional-response/additional-responses.td.jsonld diff --git a/Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld b/examples/td/10-response-and-additional-response/simple-response.td.jsonld similarity index 100% rename from Examples/TD-Examples/10-response-and-additional-response/simple-response.td.jsonld rename to examples/td/10-response-and-additional-response/simple-response.td.jsonld diff --git a/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld new file mode 100644 index 00000000..15d9daa7 --- /dev/null +++ b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld @@ -0,0 +1,102 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { + "@language": "de" + } + ], + "title": "MeinDing", + "titles": { + "en": "MyThing", + "de": "MeinDing", + "ja": "私の物", + "zh-Hans": "我的东西", + "zh-Hant": "我的東西" + }, + "description": "TD-Instanzen können auch die Verwendung von title und description mit Titeln und Beschreibungen kombinieren. title und description sind als Standardtext zu sehen", + "descriptions": { + "en": "TD instances may also combine the use of title and description with titles and descriptions. title and description are seeing as the default text", + "de": "TD-Instanzen können auch die Verwendung von title und description mit Titeln und Beschreibungen kombinieren. title und description sind als Standardtext zu sehen", + "ja": "TDインスタンスでは、タイトルと説明文を組み合わせて使用することもできます。タイトルと説明文は、デフォルトのテキストとして表示されます。", + "zh-Hans": "TD实例也可以结合使用标题和描述。标题和描述被视为默认文本", + "zh-Hant": "TD 實例還可以將標題和描述與標題和描述結合使用。標題和描述被視為默認文本" + }, + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "on": { + "title": "An/Aus", + "titles": { + "en": "On/Off", + "de": "An/Aus", + "ja": "オンオフ", + "zh-Hans": "开关", + "zh-Hant": "開關" + }, + "type": "boolean", + "forms": [ + { + "href": "https://mylamp.example.com/on" + } + ] + }, + "status": { + "title": "Zustand", + "titles": { + "en": "Status", + "de": "Zustand", + "ja": "状態", + "zh-Hans": "状态", + "zh-Hant": "狀態" + }, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + } + }, + "actions": { + "toggle": { + "title": "Umschalten", + "titles": { + "en": "Toggle", + "de": "Umschalten", + "ja": "トグル", + "zh-Hans": "切换", + "zh-Hant": "切換" + }, + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "title": "Überhitzung", + "titles": { + "en": "Overheating", + "de": "Überhitzung", + "ja": "オーバーヒート", + "zh-Hans": "过热", + "zh-Hant": "過熱" + }, + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld b/examples/td/11-multilanguage/multilanguage.td.jsonld similarity index 92% rename from Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld rename to examples/td/11-multilanguage/multilanguage.td.jsonld index cb9693ba..3f689092 100644 --- a/Examples/TD-Examples/7-multilanguage/multilanguage.td.jsonld +++ b/examples/td/11-multilanguage/multilanguage.td.jsonld @@ -9,6 +9,13 @@ "zh-Hant": "我的東西" }, "description": "A TD can contain multiple languages, where the name is a valid language tag as defined by [BCP47] and the value is a human-readable string in the language indicated by the tag", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", "properties": { "on": { "titles": { @@ -27,7 +34,6 @@ "ja": "状態", "zh-Hans": "状态", "zh-Hant": "狀態" }, - "type": "object", "forms": [{"href": "https://mylamp.example.com/status"}] } }, diff --git a/Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld b/examples/td/11-multilanguage/string-direction.td.jsonld similarity index 92% rename from Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld rename to examples/td/11-multilanguage/string-direction.td.jsonld index 7f36695d..b06debc7 100644 --- a/Examples/TD-Examples/7-multilanguage/string-direction.td.jsonld +++ b/examples/td/11-multilanguage/string-direction.td.jsonld @@ -20,17 +20,18 @@ }, "status": { "title": "حالة", - "type": "object", "forms": [{"href": "https://mylamp.example.com/status"}] } }, "actions": { "toggle": { + "title": "تبديل", "forms": [{"href": "https://mylamp.example.com/toggle"}] } }, "events": { "overheating": { + "title": "ارتفاع درجة الحرارة", "data": {"type": "string"}, "forms": [{ "href": "https://mylamp.example.com/oh", diff --git a/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld b/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld new file mode 100644 index 00000000..086f5ad9 --- /dev/null +++ b/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld @@ -0,0 +1,58 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "MyWeatherThing", + "description": "Combined dynamic uriVariables and uriVariables in href structure", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "weather": { + "uriVariables": { + "city": { + "type": "string", + "description": "City name to find the weather information for" + }, + "unit": { + "type": "string", + "enum": [ + "fahrenheit_value", + "celsius_value" + ], + "description": "Desired unit for the temperature value" + } + }, + "forms": [ + { + "href": "http://example.org/weather/{city}/{?unit}", + "htv:methodName": "GET" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "http://example.org/toggle" + } + ] + } + }, + "events": { + "lowbatterie": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "http://example.org/lb", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld b/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld similarity index 88% rename from Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld rename to examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld index 008a7c09..b78f859d 100644 --- a/Examples/TD-Examples/8-uri-variables/dynaic-uri-variables.td.jsonld +++ b/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld @@ -2,6 +2,13 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "title": "MyMapThing", "description": "href may also carry a URI that contains dynamic variables", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", "properties": { "weather": { "uriVariables": { diff --git a/examples/td/12-uri-variables/uri-href-structure.td.jsonld b/examples/td/12-uri-variables/uri-href-structure.td.jsonld new file mode 100644 index 00000000..8eabc908 --- /dev/null +++ b/examples/td/12-uri-variables/uri-href-structure.td.jsonld @@ -0,0 +1,50 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "MyWeatherThing", + "description": "As defined in [RFC6570], uriVariables can be used for replacing the href structure", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "weather": { + "uriVariables": { + "city": { + "type": "string", + "description": "City name to find the weather information for" + } + }, + "forms": [ + { + "href": "http://example.org/weather/{city}", + "htv:methodName": "GET" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "http://example.org/toggle" + } + ] + } + }, + "events": { + "lowbatterie": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "http://example.org/lb", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld b/examples/td/13-semantic-annotations/semantic-1.td.jsonld similarity index 100% rename from Examples/TD-Examples/13-semantic-annotations/semantic-1.td.jsonld rename to examples/td/13-semantic-annotations/semantic-1.td.jsonld diff --git a/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld b/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld new file mode 100644 index 00000000..0b86eb53 --- /dev/null +++ b/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld @@ -0,0 +1,52 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { + "saref": "https://w3id.org/saref#", + "ssn": "http://www.w3.org/ns/ssn/" + } + ], + "id": "urn:uuid:67c9122b-2680-4e1a-b41c-5af07edba1f4", + "@type": "saref:LightSwitch", + "saref:hasState": { + "@id": "urn:uuid:67c9122b-2680-4e1a-b41c-5af07edba1f4/state", + "@type": "saref:OnOffState" + }, + "title": "MyLampThing", + "description": "TD Context Extensions may be used to annotate pieces of a data schema, to be able to semantically process the state information of the physical world object, which is represented by the data exchanged during an interaction.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "status": { + "ssn:forProperty": "urn:uuid:67c9122b-2680-4e1a-b41c-5af07edba1f4/state", + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + }, + "fullStatus": { + "ssn:forProperty": "urn:uuid:67c9122b-2680-4e1a-b41c-5af07edba1f4/state", + "type": "object", + "properties": { + "statusString": { "type": "string" }, + "statusCode": { "type": "number" }, + "statusDescription": { "type": "string" } + }, + "forms": [{"href": "https://mylamp.example.com/status?full=true"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mylamp.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/examples/td/14-non-standard/additional-metadata.td.jsonld b/examples/td/14-non-standard/additional-metadata.td.jsonld new file mode 100644 index 00000000..8673ef75 --- /dev/null +++ b/examples/td/14-non-standard/additional-metadata.td.jsonld @@ -0,0 +1,48 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { + "saref": "https://w3id.org/saref#", + "om": "http://www.ontology-of-units-of-measure.org/resource/om-2/", + "schema": "http://schema.org" + } + ], + "version": { + "instance": "1.2.1", + "schema:softwareVersion": "1.0.1" + }, + "schema:serialNumber": "4CE0460D0G", + "schema:manufacturer": {"name": "CompanyName"}, + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyTemperatureSensor", + "description": "This example provides additional metadata terms from different external context files as provided in @context.", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "@type": "saref:TemperatureSensor", + "properties": { + "temperature": { + "description": "Temperature value of the weather station", + "type": "number", + "minimum": -32.5, + "maximum": 55.2, + "unit": "om:degree_Celsius", + "forms": [{"href": "https://mysensor.example.com/temperature"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://mysensor.example.com/toggle"}] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://mysensor.example.com/oh", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/examples/td/14-non-standard/location-based-metadata.td.jsonld b/examples/td/14-non-standard/location-based-metadata.td.jsonld new file mode 100644 index 00000000..df7dbcf6 --- /dev/null +++ b/examples/td/14-non-standard/location-based-metadata.td.jsonld @@ -0,0 +1,41 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1", + { + "schema": "http://schema.org#" + } + ], + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyRobotThing", + "description": "In some use cases location based metadata have to be provided at the interaction level, e.g., as provided as a Property that returns the latest longitude, latitude, and elevation values based on schema.org", + "securityDefinitions": { + "basic_sc": {"scheme": "basic", "in": "header"} + }, + "security": "basic_sc", + "properties": { + "position": { + "type": "object", + "@type": "schema:GeoCoordinates", + "properties": { + "longitude": { "type": "number" }, + "latitude": { "type": "number" }, + "elevation": { "type": "number" } + }, + "forms": [{"href": "https://robot.example.com/position"}] + } + }, + "actions": { + "toggle": { + "forms": [{"href": "https://robot.example.com/toggle"}] + } + }, + "events": { + "lowBattery": { + "data": {"type": "string"}, + "forms": [{ + "href": "https://robot.example.com/lb", + "subprotocol": "longpoll" + }] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld b/examples/td/15-link-relation-type/collection-rel.td.jsonld similarity index 100% rename from Examples/TD-Examples/15-link-relation-type/collection-rel.td.jsonld rename to examples/td/15-link-relation-type/collection-rel.td.jsonld diff --git a/Examples/TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld b/examples/td/15-link-relation-type/controlledBy-rel.td.jsonld similarity index 100% rename from Examples/TD-Examples/15-link-relation-type/controlledBy-rel.td.jsonld rename to examples/td/15-link-relation-type/controlledBy-rel.td.jsonld diff --git a/Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld b/examples/td/15-link-relation-type/item-rel.td.jsonld similarity index 100% rename from Examples/TD-Examples/15-link-relation-type/item-rel.td.jsonld rename to examples/td/15-link-relation-type/item-rel.td.jsonld diff --git a/Examples/TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld b/examples/td/15-link-relation-type/service-doc-rel.td.jsonld similarity index 100% rename from Examples/TD-Examples/15-link-relation-type/service-doc-rel.td.jsonld rename to examples/td/15-link-relation-type/service-doc-rel.td.jsonld diff --git a/Examples/TD-Examples/2-properties/properties-serializations.td.jsonld b/examples/td/2-properties/properties-serializations.td.jsonld similarity index 100% rename from Examples/TD-Examples/2-properties/properties-serializations.td.jsonld rename to examples/td/2-properties/properties-serializations.td.jsonld diff --git a/Examples/TD-Examples/2-properties/readOnly.td.jsonld b/examples/td/2-properties/readOnly.td.jsonld similarity index 100% rename from Examples/TD-Examples/2-properties/readOnly.td.jsonld rename to examples/td/2-properties/readOnly.td.jsonld diff --git a/Examples/TD-Examples/2-properties/writeOnly.td.jsonld b/examples/td/2-properties/writeOnly.td.jsonld similarity index 100% rename from Examples/TD-Examples/2-properties/writeOnly.td.jsonld rename to examples/td/2-properties/writeOnly.td.jsonld diff --git a/Examples/TD-Examples/3-actions/action-serialization.td.jsonld b/examples/td/3-actions/action-serialization.td.jsonld similarity index 100% rename from Examples/TD-Examples/3-actions/action-serialization.td.jsonld rename to examples/td/3-actions/action-serialization.td.jsonld diff --git a/Examples/TD-Examples/3-actions/response.td.jsonld b/examples/td/3-actions/response.td.jsonld similarity index 100% rename from Examples/TD-Examples/3-actions/response.td.jsonld rename to examples/td/3-actions/response.td.jsonld diff --git a/Examples/TD-Examples/4-events/event-serialization.td.jsonld b/examples/td/4-events/event-serialization.td.jsonld similarity index 100% rename from Examples/TD-Examples/4-events/event-serialization.td.jsonld rename to examples/td/4-events/event-serialization.td.jsonld diff --git a/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld b/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld new file mode 100644 index 00000000..1fe32e24 --- /dev/null +++ b/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld @@ -0,0 +1,47 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A cov:blockwise or cov:quickblockwise member may indicate relevant parameters, such as the largest block size that may be used in a Block2 Option.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [{ + "href": "coap://[2001:DB8::1]/status", + "contentType": "text/plain;charset=utf-8", + "cov:blockwise": { + "cov:block2SZX": 64 + } + }] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld b/examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld new file mode 100644 index 00000000..ca63aa8d --- /dev/null +++ b/examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld @@ -0,0 +1,45 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "CoAP supports block-wise transfers to allow large resource representations to be transferred between clients and servers. This feature enables clients and servers to request or provide resource representations in smaller blocks, which can be useful when constrained network conditions make it undesirable to transfer large amounts of data at once.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [{ + "href": "coap://mylamp.example.com/status", + "contentType": "text/plain;charset=utf-8", + "cov:blockwise": { } + }] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld b/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld new file mode 100644 index 00000000..8eb40540 --- /dev/null +++ b/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld @@ -0,0 +1,63 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "Content negotiation in CoAP is used to negotiate the representation of CoAP resources that may have different representations available. This is accomplished through the use of CoAP Accept and Content-Format options. The CoAP Accept option is used by clients to request a particular content format, while the Content-Format option is used by clients and servers to indicate the content format of the representation in requests and responses, respectively. ", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "coap://mylamp.example.com/status", + "contentType": "text/plain;charset=utf-8" + } + ] + } + }, + "actions": { + "toggle": { + "input": { "type": "integer" }, + "output": { "type": "string" }, + "forms": [ + { + "href": "coap://mylamp.example.comtoggle", + "cov:accept": 60, + "response": { + "contentType": "application/cbor", + "cov:contentFormat": 60 + } + }, + { + "href": "coap://mylamp.example.com/toggle", + "contentType": "application/cbor", + "cov:contentFormat": 60, + "cov:accept": 50, + "response": { + "contentType": "application/json", + "cov:contentFormat": 50 + } + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAP-hop-limit.td.jsonld b/examples/td/5-protocols/CoAP-hop-limit.td.jsonld new file mode 100644 index 00000000..b04b55e3 --- /dev/null +++ b/examples/td/5-protocols/CoAP-hop-limit.td.jsonld @@ -0,0 +1,45 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "The CoAP Hop-Limit option [RFC8768] limits the number of hops a CoAP message can take before it is considered undeliverable. This prevents infinite message loops in CoAP networks. The cov:hopLimit member can be used to set the desired hop limit for a particular CoAP request", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [{ + "href": "coap://[2001:DB8::1]/status", + "contentType": "text/plain;charset=utf-8", + "cov:hopLimit": 5 + }] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld b/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld new file mode 100644 index 00000000..89e9369f --- /dev/null +++ b/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld @@ -0,0 +1,64 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [ + { + "cov:method": "GET", + "href": "coap://mylamp.example.com/status", + "contentType": "text/plain;charset=utf-8", + "op": [ + "readproperty" + ] + } + ], + "observable": false, + "writeOnly": false + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle", + "op": "invokeaction", + "contentType": "application/json" + } + ], + "safe": false, + "idempotent": false + } + }, + "events": { + "overheating": { + "data": { + "type": "string", + "readOnly": false, + "writeOnly": false + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll", + "op": [ + "subscribeevent", + "unsubscribeevent" + ], + "contentType": "application/json" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld b/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld new file mode 100644 index 00000000..7c331e47 --- /dev/null +++ b/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld @@ -0,0 +1,46 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "coap://mylamp.example.com/status", + "contentType": "text/plain;charset=utf-8" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/CoAp-observing-resources.td.jsonld b/examples/td/5-protocols/CoAp-observing-resources.td.jsonld new file mode 100644 index 00000000..4199c6fa --- /dev/null +++ b/examples/td/5-protocols/CoAp-observing-resources.td.jsonld @@ -0,0 +1,47 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "MyLampThing", + "description": "CoAP provides a mechanism for clients to *observe* resources [RFC7641], i.e., to request notifications from the server whenever the resource changes. This is especially useful in the Web of Things where many Things are expected to have resources that change over time, such as sensor readings.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [{ + "cov:method": "GET", + "href": "coap://[2001:DB8::1]/status", + "contentType": "text/plain;charset=utf-8", + "subprotocol": "cov:observe", + "op": ["observeproperty"] + }] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "href": "coap://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "href": "coap://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/HTTP-readproperty.td.jsonld b/examples/td/5-protocols/HTTP-readproperty.td.jsonld new file mode 100644 index 00000000..eaef44de --- /dev/null +++ b/examples/td/5-protocols/HTTP-readproperty.td.jsonld @@ -0,0 +1,50 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", + "title": "MyLampThing", + "description": "This example shows the binding of the readproperty operation for the HTTP", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": [ + "basic_sc" + ], + "properties": { + "temperature": { + "type": "string", + "forms": [ + { + "href": "http://example.com/properties/temperature", + "op": "readproperty", + "htv:methodName": "GET" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "op": "invokeaction", + "href": "https://mylamp.example.com/actions/toggle", + "htv:methodName": "POST" + } + ] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [ + { + "op": "subscribeevent", + "href": "https://mylamp.example.com/envents/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld b/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld new file mode 100644 index 00000000..468bbf42 --- /dev/null +++ b/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld @@ -0,0 +1,53 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:3deca264-4f90-4321-a5ea-f197e6a1c7cf", + "title": "MyLampThing", + "description": "This example shows the default values for Procol Binding based on HTTP", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": [ + "basic_sc" + ], + "properties": { + "status": { + "type": "string", + "readOnly": true, + "forms": [ + { + "op": "readproperty", + "href": "https://mylamp.example.com/status", + "htv:methodName": "GET" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "htv:methodName": "POST" + } + ] + } + }, + "events": { + "overheating": { + "data": { + "type": "string" + }, + "forms": [ + { + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld b/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld new file mode 100644 index 00000000..24455e1d --- /dev/null +++ b/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld @@ -0,0 +1,40 @@ +{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "modbus": "https://www.example.com/ns/modbustcp" + } + ], + "title": "ModbusPLC", + "description": "This is an example of an extended version when using multiple operations with Modbus", + "id": "uri:dev:ModbusTCPThing", + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec" + } + }, + "security": "nosec_sc", + "properties": { + "limitSwitch1": { + "title": "downLimitSwitch", + "type": "boolean", + "description": "Limit switch moving downwards", + "forms": [ + { + "href": "modbus+tcp://127.0.0.1:60000/1/1", + "op": [ + "readproperty" + ], + "modbus:function": "readCoil" + }, + { + "href": "modbus+tcp://127.0.0.1:60000/1/1", + "op": [ + "writeproperty" + ], + "modbus:function": "writeCoil" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld b/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld new file mode 100644 index 00000000..2324b4fd --- /dev/null +++ b/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld @@ -0,0 +1,34 @@ +{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "modbus": "https://www.example.com/ns/modbustcp" + } + ], + "title": "ModbusPLC", + "description": "To describe forms with multiple operations types, the Entity keyword can be used to create a short description of the modbus endpoint. This example shows how to use the read and write property in a single coil", + "id": "uri:dev:ModbusTCPThing", + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec" + } + }, + "security": "nosec_sc", + "properties": { + "limitSwitch1": { + "title": "downLimitSwitch", + "type": "boolean", + "description": "Limit switch moving downwards", + "forms": [ + { + "href": "modbus+tcp://127.0.0.1:60000/1/1", + "op": [ + "readproperty", + "writeproperty" + ], + "modbus:entity": "Coil" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/Modbus-single-coil.td.jsonld b/examples/td/5-protocols/Modbus-single-coil.td.jsonld new file mode 100644 index 00000000..7ab8776d --- /dev/null +++ b/examples/td/5-protocols/Modbus-single-coil.td.jsonld @@ -0,0 +1,34 @@ +{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "modbus": "https://www.example.com/ns/modbustcp" + } + ], + "title": "ModbusPLC", + "description": "This example shows the minimal set of terms to configure a single coil reading using Modbus. Notice that the unitID is contained in the href as the first element of the path", + "id": "uri:dev:ModbusTCPThing", + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec" + } + }, + "security": "nosec_sc", + "properties": { + "limitSwitch1": { + "title": "downLimitSwitch", + "type": "boolean", + "description": "Limit switch moving downwards", + "forms": [ + { + "href": "modbus+tcp://127.0.0.1:60000/1", + "op": [ + "readproperty" + ], + "modbus:function": "readCoil", + "modbus:address": 1 + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld b/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld new file mode 100644 index 00000000..40b5ede5 --- /dev/null +++ b/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld @@ -0,0 +1,55 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", + "title": "MyLampThing", + "description": "In the case of a forms entry that has multiple op values the usage of the htv:methodName is not permitted. A TD Processor will extend the multiple op values to separate forms entries and associates a single operation with the default assumption.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": [ + "basic_sc" + ], + "properties": { + "status": { + "type": "string", + "forms": [ + { + "op": "readproperty", + "href": "https://mylamp.example.com/status", + "htv:methodName": "GET" + }, + { + "op": "writeproperty", + "href": "https://mylamp.example.com/status", + "htv:methodName": "PUT" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "htv:methodName": "POST" + } + ] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [ + { + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/5-protocols/subprotocol-longpoll.td.jsonld b/examples/td/5-protocols/subprotocol-longpoll.td.jsonld new file mode 100644 index 00000000..26f7fc92 --- /dev/null +++ b/examples/td/5-protocols/subprotocol-longpoll.td.jsonld @@ -0,0 +1,50 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", + "title": "MyLampThing", + "description": " protocols may have defined Subprotocols that can be used for some interaction types. For example, to receive asynchronous notifications using HTTP, some servers may support long polling", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": [ + "basic_sc" + ], + "properties": { + "status": { + "type": "string", + "forms": [ + { + "op": "readproperty", + "href": "https://mylamp.example.com/status", + "htv:methodName": "GET" + } + ] + } + }, + "actions": { + "toggle": { + "forms": [ + { + "op": "invokeaction", + "href": "https://mylamp.example.com/toggle", + "htv:methodName": "POST" + } + ] + } + }, + "events": { + "overheating": { + "data": {"type": "string"}, + "forms": [ + { + "op": "subscribeevent", + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld b/examples/td/6-security-schemes/OAuth2-scopes.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-schemes/OAuth2-scopes.td.jsonld rename to examples/td/6-security-schemes/OAuth2-scopes.td.jsonld diff --git a/Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld b/examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-scheme/apikey-in-body-simplified.td.jsonld rename to examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld diff --git a/Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld b/examples/td/6-security-schemes/apikey-in-body.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-scheme/apikey-in-body.td.jsonld rename to examples/td/6-security-schemes/apikey-in-body.td.jsonld diff --git a/Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld b/examples/td/6-security-schemes/apikey-security.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-scheme/apikey-security.td.jsonld rename to examples/td/6-security-schemes/apikey-security.td.jsonld diff --git a/Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld b/examples/td/6-security-schemes/basic-security.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-schemes/basic-security.td.jsonld rename to examples/td/6-security-schemes/basic-security.td.jsonld diff --git a/Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld b/examples/td/6-security-schemes/combo-apikey-security.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-scheme/combo-apikey-security.td.jsonld rename to examples/td/6-security-schemes/combo-apikey-security.td.jsonld diff --git a/Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld b/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld similarity index 92% rename from Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld rename to examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld index ace14cf6..6cda7f15 100644 --- a/Examples/TD-Examples/6-security-schemes/combo-security-def-allOf.td.jsonld +++ b/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld @@ -36,8 +36,7 @@ "overheating": { "data": {"type": "string"}, "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" + "href": "https://mylamp.example.com/oh" }] } } diff --git a/Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld b/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld similarity index 91% rename from Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld rename to examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld index 18c14bad..340528d4 100644 --- a/Examples/TD-Examples/6-security-schemes/combo-security-def-oneOf.td.jsonld +++ b/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld @@ -27,8 +27,7 @@ "overheating": { "data": {"type": "string"}, "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" + "href": "https://mylamp.example.com/oh" }] } } diff --git a/Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld b/examples/td/6-security-schemes/multiple-security-def.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-schemes/multiple-security-def.td.jsonld rename to examples/td/6-security-schemes/multiple-security-def.td.jsonld diff --git a/Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld b/examples/td/6-security-schemes/multiple-security-forms.td.jsonld similarity index 92% rename from Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld rename to examples/td/6-security-schemes/multiple-security-forms.td.jsonld index 6ff62963..fdde7bae 100644 --- a/Examples/TD-Examples/6-security-schemes/multiple-security-forms.td.jsonld +++ b/examples/td/6-security-schemes/multiple-security-forms.td.jsonld @@ -31,8 +31,7 @@ "overheating": { "data": {"type": "string"}, "forms": [{ - "href": "https://mylamp.example.com/oh", - "security": "nosec_sc" + "href": "https://mylamp.example.com/oh" }] } } diff --git a/Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld b/examples/td/6-security-schemes/noSec-security.td.jsonld similarity index 100% rename from Examples/TD-Examples/6-security-schemes/noSec-security.td.jsonld rename to examples/td/6-security-schemes/noSec-security.td.jsonld diff --git a/Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld b/examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld similarity index 100% rename from Examples/TD-Examples/11-complex-data-schemas/data-schema-serialization.td.jsonld rename to examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld diff --git a/Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld b/examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld similarity index 100% rename from Examples/TD-Examples/11-complex-data-schemas/read-&-writeOnly.td.jsonld rename to examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld diff --git a/Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld b/examples/td/8-meta-interactions/readallproperties.td.jsonld similarity index 100% rename from Examples/TD-Examples/12-meta-interactions/readallproperties.td.jsonld rename to examples/td/8-meta-interactions/readallproperties.td.jsonld diff --git a/Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld b/examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld similarity index 100% rename from Examples/TD-Examples/12-meta-interactions/top-level-uriVariables.td.jsonld rename to examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld diff --git a/Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld b/examples/td/8-meta-interactions/writeallproperties.td.jsonld similarity index 100% rename from Examples/TD-Examples/12-meta-interactions/writeallproperties.td.jsonld rename to examples/td/8-meta-interactions/writeallproperties.td.jsonld diff --git a/Examples/TD-Examples/9-versioning/versioning.td.jsonld b/examples/td/9-versioning/versioning.td.jsonld similarity index 100% rename from Examples/TD-Examples/9-versioning/versioning.td.jsonld rename to examples/td/9-versioning/versioning.td.jsonld diff --git a/Examples/TM-Examples/1-basic/simple-tm.json b/examples/tm/1-basic/simple-tm.json similarity index 100% rename from Examples/TM-Examples/1-basic/simple-tm.json rename to examples/tm/1-basic/simple-tm.json diff --git a/packages/core/examples/scripts/readFile.js b/packages/core/examples/scripts/readFile.js index e67039b5..5a82d64f 100644 --- a/packages/core/examples/scripts/readFile.js +++ b/packages/core/examples/scripts/readFile.js @@ -2,9 +2,13 @@ const tdValidator = require("../../index").tdValidator const fs = require("fs") -const simpleTD = fs.readFileSync("../tds/valid/simple.json") +const data = fs.readFileSync("../tds/valid/simple.json") +const simpleTD = data.toString() -/** + +console.log(simpleTD) + +/* * No logging and no additional checks */ tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) From 432738b784f165597f216c41f038d856400f6121 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 11 Mar 2023 18:51:55 +0100 Subject: [PATCH 07/38] addded td validator to the examples folder --- examples/scripts/validator.js | 76 ++++++++++++++++++++++ packages/core/examples/scripts/readFile.js | 6 +- 2 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 examples/scripts/validator.js diff --git a/examples/scripts/validator.js b/examples/scripts/validator.js new file mode 100644 index 00000000..69151fa3 --- /dev/null +++ b/examples/scripts/validator.js @@ -0,0 +1,76 @@ +// Test utility to test index.js +const tdValidator = require("../../packages/core/index").tdValidator +const fs = require("fs") + +// Function to get current filenames in directory + +const fileNames = fs.readdirSync("../td/1-simple-default") + +fileNames.forEach(file => { + const data = fs.readFileSync("../td/1-simple-default/"+file) + const TD = data.toString() + tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", file) + console.log("OKAY") + console.log(result) + console.log("________________") + }, err => { + console.log("ERROR") + console.error(err) + }) +}) + + + + +/** First way **/ +/* +console.log("\nCurrent directory filenames:") +filenames.forEach(file => { + let i = 0 + console.log(file, ": ") + const subFiles = fs.readdirSync("../td/"+file) + console.log(subFiles) + subFiles.forEach(subFile => { + console.log("Sub file", ++i,": ",subFile) + const data = fs.readFileSync("../td/"+file+"/"+subFile) + const simpleTD = data.toString() + tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", file, "Sub file: ",subFile) + console.log("OKAY") + console.log(result) + console.log("________________") + }, err => { + console.log("ERROR") + console.error(err) + }) + }) + console.log("______________________") +})*/ + +/** second version with for loop **/ +/* +for(let i = 0; i < filenames.length; i++){ + console.log(filenames[i]) + + const subFiles = fs.readdirSync("../td/"+filenames[i]) + + for(let j = 0; j < subFiles.length; j++){ + console.log(subFiles[j]) + const data = fs.readFileSync("../td/"+filenames[i]+"/"+subFiles[j]) + const simpleTD = data.toString() + tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", filenames[i], "Sub file: ",subFiles[j]) + console.log("OKAY") + console.log(result) + console.log("________________") + }, err => { + console.log("ERROR") + console.error(err) + }) + } +} +*/ diff --git a/packages/core/examples/scripts/readFile.js b/packages/core/examples/scripts/readFile.js index 5a82d64f..c5ac3597 100644 --- a/packages/core/examples/scripts/readFile.js +++ b/packages/core/examples/scripts/readFile.js @@ -2,15 +2,15 @@ const tdValidator = require("../../index").tdValidator const fs = require("fs") -const data = fs.readFileSync("../tds/valid/simple.json") +const data = fs.readFileSync("../../../../examples/td/1-simple-default/basic-td.td.jsonld") const simpleTD = data.toString() - console.log(simpleTD) /* * No logging and no additional checks */ + tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) .then( result => { console.log("OKAY") @@ -18,4 +18,4 @@ tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) }, err => { console.log("ERROR") console.error(err) -}) +}) \ No newline at end of file From 3bbed76f8f4d123feb2fbb96ece1ff2fd2d5c5c9 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 12 Mar 2023 20:03:17 +0100 Subject: [PATCH 08/38] new td validator for the new examples folder --- examples/scripts/validator.js | 104 +++++++++++++++++---- packages/core/examples/scripts/readFile.js | 67 ++++++++++--- 2 files changed, 136 insertions(+), 35 deletions(-) diff --git a/examples/scripts/validator.js b/examples/scripts/validator.js index 69151fa3..5551cd8d 100644 --- a/examples/scripts/validator.js +++ b/examples/scripts/validator.js @@ -1,30 +1,94 @@ // Test utility to test index.js const tdValidator = require("../../packages/core/index").tdValidator const fs = require("fs") +const path = require('path') -// Function to get current filenames in directory - -const fileNames = fs.readdirSync("../td/1-simple-default") - -fileNames.forEach(file => { - const data = fs.readFileSync("../td/1-simple-default/"+file) - const TD = data.toString() - tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", file) - console.log("OKAY") - console.log(result) - console.log("________________") - }, err => { - console.log("ERROR") - console.error(err) - }) -}) +const [option, inputPath] = process.argv.splice(2) + +if(fs.existsSync(inputPath)) +{ + if((option == "-i" || option == "--input") && inputPath != undefined){ + + //if it is a directory with multiple td + if( fs.lstatSync(inputPath).isDirectory()){ + const fileNames = fs.readdirSync(inputPath) + fileNames.forEach(file => { + //Check if it is a valid td extension + if(path.extname(file) == ".jsonld"){ + const data = fs.readFileSync(inputPath+file) + const TD = data.toString() + tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", file) + console.log("OKAY") + console.log(result) + console.log("________________\n") + }, err => { + console.log("ERROR") + console.error(err) + }) + } + else{ + console.log("The file: ", file, "is not a TD") + } + }) + } + + //if it is an individual td + if(fs.lstatSync(inputPath).isFile()){ + const file = fs.readFileSync(inputPath) + const fileName = path.basename(inputPath) + //Check if it is a valid td extension + if(path.extname(fileName) == ".jsonld"){ + const TD = file.toString() + tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", fileName) + console.log("OKAY") + console.log(result) + console.log("________________") + }, err => { + console.log("ERROR") + console.error(err) + }) + } + else{ + console.log("The file: ", file, "is not a TD") + } + } + } +} +else{ + console.log("Invalid path"); +} + + + + + +/* First way */ + +// const fileNames = fs.readdirSync("../td/1-simple-default") + +// fileNames.forEach(file => { +// const data = fs.readFileSync("../td/1-simple-default/"+file) +// const TD = data.toString() +// tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) +// .then( result => { +// console.log("File: ", file) +// console.log("OKAY") +// console.log(result) +// console.log("________________") +// }, err => { +// console.log("ERROR") +// console.error(err) +// }) +// }) -/** First way **/ +/** Second way **/ /* console.log("\nCurrent directory filenames:") filenames.forEach(file => { @@ -50,7 +114,7 @@ filenames.forEach(file => { console.log("______________________") })*/ -/** second version with for loop **/ +/** Third version with for loop **/ /* for(let i = 0; i < filenames.length; i++){ console.log(filenames[i]) diff --git a/packages/core/examples/scripts/readFile.js b/packages/core/examples/scripts/readFile.js index c5ac3597..eec43c31 100644 --- a/packages/core/examples/scripts/readFile.js +++ b/packages/core/examples/scripts/readFile.js @@ -1,21 +1,58 @@ // Test utility to test index.js const tdValidator = require("../../index").tdValidator -const fs = require("fs") +const fs = require('fs') -const data = fs.readFileSync("../../../../examples/td/1-simple-default/basic-td.td.jsonld") -const simpleTD = data.toString() +// Function to get current filenames in directory -console.log(simpleTD) +const fileNames = fs.readdirSync("../../../../examples/td/1-simple-default/") -/* - * No logging and no additional checks - */ +fileNames.forEach(file => { + const data = fs.readFileSync("../../../../examples/td/1-simple-default/"+file) + const TD = data.toString() + tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) + .then( result => { + console.log("File: ", file) + console.log("OKAY") + console.log(result) + console.log("________________") + }, err => { + console.log("ERROR") + console.error(err) + }) +}) -tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) -.then( result => { - console.log("OKAY") - console.log(result) -}, err => { - console.log("ERROR") - console.error(err) -}) \ No newline at end of file + + + + + + + + + + + + + + + +// // Test utility to test index.js +// const tdValidator = require("../../index").tdValidator +// const fs = require("fs") +// const commander = require('commander') + +// const data = fs.readFileSync("../../../../examples/td/1-simple-default/basic-td.td.jsonld") +// const simpleTD = data.toString() + +// /* +// * No logging and no additional checks +// */ + +// tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) +// .then( result => { +// console.log("OKAY") +// console.log(result) +// }, err => { +// console.log("ERROR") +// console.error(err) +// }) \ No newline at end of file From d789db60f6365ed7d055769b4e82845b2fff4516 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:23:39 +0100 Subject: [PATCH 09/38] . --- .github/workflows/ci-cd.yaml | 3 + examples/scripts/validator.js | 140 ------------------ .../td/1-simple-default/basic-td.td.jsonld | 2 +- 3 files changed, 4 insertions(+), 141 deletions(-) delete mode 100644 examples/scripts/validator.js diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index db30e5be..b05e8d63 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -40,6 +40,9 @@ jobs: - name: Test run: lerna run test --no-bail --stream + -name: Examples test + run: node packages/cli/index.js -i examples/td/*/* > examples/test-output.txt + deploy-via-ssh: runs-on: ubuntu-latest diff --git a/examples/scripts/validator.js b/examples/scripts/validator.js deleted file mode 100644 index 5551cd8d..00000000 --- a/examples/scripts/validator.js +++ /dev/null @@ -1,140 +0,0 @@ -// Test utility to test index.js -const tdValidator = require("../../packages/core/index").tdValidator -const fs = require("fs") -const path = require('path') - -const [option, inputPath] = process.argv.splice(2) - -if(fs.existsSync(inputPath)) -{ - if((option == "-i" || option == "--input") && inputPath != undefined){ - - //if it is a directory with multiple td - if( fs.lstatSync(inputPath).isDirectory()){ - const fileNames = fs.readdirSync(inputPath) - fileNames.forEach(file => { - //Check if it is a valid td extension - if(path.extname(file) == ".jsonld"){ - const data = fs.readFileSync(inputPath+file) - const TD = data.toString() - tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", file) - console.log("OKAY") - console.log(result) - console.log("________________\n") - }, err => { - console.log("ERROR") - console.error(err) - }) - } - else{ - console.log("The file: ", file, "is not a TD") - } - }) - } - - //if it is an individual td - if(fs.lstatSync(inputPath).isFile()){ - const file = fs.readFileSync(inputPath) - const fileName = path.basename(inputPath) - //Check if it is a valid td extension - if(path.extname(fileName) == ".jsonld"){ - const TD = file.toString() - tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", fileName) - console.log("OKAY") - console.log(result) - console.log("________________") - }, err => { - console.log("ERROR") - console.error(err) - }) - } - else{ - console.log("The file: ", file, "is not a TD") - } - } - } -} -else{ - console.log("Invalid path"); -} - - - - - -/* First way */ - -// const fileNames = fs.readdirSync("../td/1-simple-default") - -// fileNames.forEach(file => { -// const data = fs.readFileSync("../td/1-simple-default/"+file) -// const TD = data.toString() -// tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) -// .then( result => { -// console.log("File: ", file) -// console.log("OKAY") -// console.log(result) -// console.log("________________") -// }, err => { -// console.log("ERROR") -// console.error(err) -// }) -// }) - - - - -/** Second way **/ -/* -console.log("\nCurrent directory filenames:") -filenames.forEach(file => { - let i = 0 - console.log(file, ": ") - const subFiles = fs.readdirSync("../td/"+file) - console.log(subFiles) - subFiles.forEach(subFile => { - console.log("Sub file", ++i,": ",subFile) - const data = fs.readFileSync("../td/"+file+"/"+subFile) - const simpleTD = data.toString() - tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", file, "Sub file: ",subFile) - console.log("OKAY") - console.log(result) - console.log("________________") - }, err => { - console.log("ERROR") - console.error(err) - }) - }) - console.log("______________________") -})*/ - -/** Third version with for loop **/ -/* -for(let i = 0; i < filenames.length; i++){ - console.log(filenames[i]) - - const subFiles = fs.readdirSync("../td/"+filenames[i]) - - for(let j = 0; j < subFiles.length; j++){ - console.log(subFiles[j]) - const data = fs.readFileSync("../td/"+filenames[i]+"/"+subFiles[j]) - const simpleTD = data.toString() - tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", filenames[i], "Sub file: ",subFiles[j]) - console.log("OKAY") - console.log(result) - console.log("________________") - }, err => { - console.log("ERROR") - console.error(err) - }) - } -} -*/ diff --git a/examples/td/1-simple-default/basic-td.td.jsonld b/examples/td/1-simple-default/basic-td.td.jsonld index aa66cb9f..92f483c4 100644 --- a/examples/td/1-simple-default/basic-td.td.jsonld +++ b/examples/td/1-simple-default/basic-td.td.jsonld @@ -16,7 +16,7 @@ "actions": { "toggle": { "forms": [{"href": "https://mylamp.example.com/toggle"}] - } + } }, "events": { "overheating": { From 1bd5371f5378d5dbd67de160da53b85a026f4019 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:25:38 +0100 Subject: [PATCH 10/38] . --- .github/workflows/ci-cd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index b05e8d63..b3cc4cdd 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -41,7 +41,7 @@ jobs: run: lerna run test --no-bail --stream -name: Examples test - run: node packages/cli/index.js -i examples/td/*/* > examples/test-output.txt + run: node packages/cli/index.js -i examples/td/*/* deploy-via-ssh: From 06d437db9534533cf9e6825606c9a5a4fe19b29d Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 25 Mar 2023 18:23:11 +0100 Subject: [PATCH 11/38] tm examples,cli tm validator fix, new $title value --- .../{simple-tm.json => basic-tm.tm.jsonld} | 4 ++- .../tm/2-tm-versioning/versioning.tm.jsonld | 26 +++++++++++++++ .../extends-basic.tm.jsonld | 33 +++++++++++++++++++ .../import-existing-definition.tm.jsonld | 24 ++++++++++++++ packages/cli/index.js | 5 ++- 5 files changed, 90 insertions(+), 2 deletions(-) rename examples/tm/1-basic/{simple-tm.json => basic-tm.tm.jsonld} (70%) create mode 100644 examples/tm/2-tm-versioning/versioning.tm.jsonld create mode 100644 examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld create mode 100644 examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld diff --git a/examples/tm/1-basic/simple-tm.json b/examples/tm/1-basic/basic-tm.tm.jsonld similarity index 70% rename from examples/tm/1-basic/simple-tm.json rename to examples/tm/1-basic/basic-tm.tm.jsonld index 8f9ca418..fe86cf36 100644 --- a/examples/tm/1-basic/simple-tm.json +++ b/examples/tm/1-basic/basic-tm.tm.jsonld @@ -2,7 +2,9 @@ "@context": ["https://www.w3.org/2022/wot/td/v1.1"], "@type": "tm:ThingModel", "title": "Lamp Thing Model", - "description": "Basic example of TM", + "$title": "Basic Thing Model Example", + "description": "TM for a lamp thing", + "$description": "This is an example of a basic Thing Model, which is use as a sort of template for creating a Thing Description instance of a Lamp TD", "properties": { "status": { "description": "current status of the lamp (on|off)", diff --git a/examples/tm/2-tm-versioning/versioning.tm.jsonld b/examples/tm/2-tm-versioning/versioning.tm.jsonld new file mode 100644 index 00000000..f4eb934b --- /dev/null +++ b/examples/tm/2-tm-versioning/versioning.tm.jsonld @@ -0,0 +1,26 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Lamp Thing Model", + "$title": "Versioning Thing Model Example", + "description": "TM for a lamp thing", + "$description": "When the Thing Model definitions change over time, this should be reflected in the version container. The term model is used with the version container in order to provide such versioning information.", + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld b/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld new file mode 100644 index 00000000..57beaf6c --- /dev/null +++ b/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld @@ -0,0 +1,33 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Smart Lamp Control with Dimming", + "$title": "Extend Thing Model Example", + "description": "TM for controlling a Lamp thing with dimming fuctions", + "$description": "A Thing Model can extend an existing Thing Model by using the tm:extends mechanism. When a Thing Model extends another Thing Model, at least one links entry with 'rel: tm:extends' that targets a Thing Model that is be extended must be used", + "links" : [{ + "rel": "tm:extends", + "href": "http://example.com/BasicOnOffTM", + "type": "application/tm+json" + }], + "properties" : { + "dim" : { + "title": "Dimming level", + "description": "Dimms the lamp between the values: 0 and 100", + "type": "integer", + "minimum": 0, + "maximum": 100 + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld new file mode 100644 index 00000000..a13ba813 --- /dev/null +++ b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld @@ -0,0 +1,24 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Smart Lamp Contorl", + "$title": "Import Existing Definitions TM Example", + "description": "TM for a lamp thing controller", + "$description": "For importing pieces of definitions of one or more existing Thiing Models, the 'tm:ref' term is utilized which provides the location of an existing (sub-)definition that should be reused. This example shows a TM definition that imports the existing definition of the property onOff from another TM into the new property definition switch.", + "properties" : { + "switch" : { + "tm:ref": "http://example.com/BasicOnOffTM.tm.jsonld#/properties/onOff" + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/packages/cli/index.js b/packages/cli/index.js index 3d5cc012..9fbdac63 100644 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -941,7 +941,10 @@ function checkTm(tm, suite) { .then(result => { console.log("OKAY \n") console.log("\n") - console.log("--- Report ",JSON.parse(td).title,"---\n", result, "\n--------------") + if(JSON.parse(tm).$title){ + console.log("--- Identifier name: ",JSON.parse(tm).$title,"---\n") + } + console.log("--- Report: ",JSON.parse(tm).title,"---\n", result, "\n--------------") if (myArguments.junit) { builder.writeTo("junit-tests.xml") } From a3cb6f05a5f00de96f5af61f12b59cde0f753f6d Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:24:55 +0100 Subject: [PATCH 12/38] new tm examples --- .../extend-and-import.tm.jsonld | 21 +++++++++++ .../import-existing-definition.tm.jsonld | 2 +- .../overwrite-existing-definitions.tm.jsonld | 27 ++++++++++++++ .../relative-imports.tm.jsonld | 36 ++++++++++++++++++ .../optional-interaction.tm.jsonld | 29 +++++++++++++++ .../overwrite-optional-interactions.tm.jsonld | 20 ++++++++++ examples/tm/5-tm-submodel/submodel.tm.jsonld | 37 +++++++++++++++++++ .../tm/6-placeholder/placeholder.tm.jsonld | 30 +++++++++++++++ 8 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld create mode 100644 examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld create mode 100644 examples/tm/3-tm-extends-imports/relative-imports.tm.jsonld create mode 100644 examples/tm/4-tm-optional/optional-interaction.tm.jsonld create mode 100644 examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld create mode 100644 examples/tm/5-tm-submodel/submodel.tm.jsonld create mode 100644 examples/tm/6-placeholder/placeholder.tm.jsonld diff --git a/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld b/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld new file mode 100644 index 00000000..1b9e5b14 --- /dev/null +++ b/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld @@ -0,0 +1,21 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Smart Lamp Control", + "$title": "Smart Lamp Control TM with Extend and Import", + "description": "TM for a lamp thing controller", + "$description": "The tm:extends and the import mechanism based on tm:ref can also be used at the same time in a TM definition. This example extends the a basic TM with an On/Off property and imports the status and dim definitions from pther TMs respectively.", + "links" : [{ + "rel": "extends", + "href": "http://example.com/BasicOnOffTM", + "type": "application/tm+json" + }], + "properties" : { + "status" : { + "tm:ref": "http://example.com/LampTM.tm.jsonld#/properties/status" + }, + "dimming" : { + "tm:ref": "http://example.com/LampWithDimmingTM.tm.jsonld#/properties/dim" + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld index a13ba813..d7fae8de 100644 --- a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld @@ -1,7 +1,7 @@ { "@context": ["https://www.w3.org/2022/wot/td/v1.1"], "@type": "tm:ThingModel", - "title": "Smart Lamp Contorl", + "title": "Smart Lamp Control", "$title": "Import Existing Definitions TM Example", "description": "TM for a lamp thing controller", "$description": "For importing pieces of definitions of one or more existing Thiing Models, the 'tm:ref' term is utilized which provides the location of an existing (sub-)definition that should be reused. This example shows a TM definition that imports the existing definition of the property onOff from another TM into the new property definition switch.", diff --git a/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld new file mode 100644 index 00000000..6b3e4e16 --- /dev/null +++ b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld @@ -0,0 +1,27 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Smart Lamp Control", + "$title": "Overwrite Existing Definitions TM Example", + "description": "TM for a lamp thing controller", + "$description": "At the place the 'tm:ref' is defined, additional name-value pairs can be added. It is also permitted to override name-value pairs from the referenced definition. If the intention is to override an existing JSON name-value pair definition from tm:ref, the same JSON name MUST be used at the same level of the tm:ref declaration that provides a new value. This example shows a new TM definition that overwrites (maximum), enhances (unit), and removes (title) existing definitions", + "properties" : { + "dimming" : { + "tm:ref": "http://example.com/SmartLampControlwithDimming.tm.jsonld#/properties/dim", + "title": null, + "maximum": 80, + "unit": "%" + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/relative-imports.tm.jsonld b/examples/tm/3-tm-extends-imports/relative-imports.tm.jsonld new file mode 100644 index 00000000..f2b9d9e4 --- /dev/null +++ b/examples/tm/3-tm-extends-imports/relative-imports.tm.jsonld @@ -0,0 +1,36 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "@type": "tm:ThingModel", + "title": "Multi Sensor", + "$title": "Relative Imports TM Example", + "description": "TM for a multisensor thing", + "$description": "This Thing Model example re-uses and augments a 'genericTemperature' property in two more specific properties, which describe an inner and an outer temperature value, respectively.", + "properties": { + "genericTemperature": { + "type": "number", + "unit": "C" + }, + "innerTemperature": { + "tm:ref": "#/properties/genericTemperature", + "title": "The inner temperature", + "minimum": 10 + }, + "outerTemperature": { + "tm:ref": "#/properties/genericTemperature", + "title": "The outer temperature", + "description": "The outer temperature is measured in Kelvin", + "unit": "K" + } + }, + "actions": { + "toggle": { + "description": "Turn the sensor on or off" + } + }, + "events": { + "overheating": { + "description": "The sensor reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/4-tm-optional/optional-interaction.tm.jsonld b/examples/tm/4-tm-optional/optional-interaction.tm.jsonld new file mode 100644 index 00000000..ecd08ed7 --- /dev/null +++ b/examples/tm/4-tm-optional/optional-interaction.tm.jsonld @@ -0,0 +1,29 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Lamp Thing Model", + "$title": "Optinal Interaction Affordances Example", + "description": "TM for a lamp thing", + "$description": "In some cases it is desirable to not enforce which interaction affordances are mandatory and do not necessarily need to be implemented in a Thing Description instance. If interaction models are not mandatory to be implemented in a Thing Description instance, Thing Model definitions MUST use the JSON member name tm:optional.", + "tm:optional": [ + "/events/overheating" + ], + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld b/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld new file mode 100644 index 00000000..57a58886 --- /dev/null +++ b/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld @@ -0,0 +1,20 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Lamp Thing Model (All Mandatory)", + "$title": "Overwriting Optinal Interaction Affordances Example", + "description": "Lamp Thing Model description wich expects all interaction affordances (status, toggle, and overheating)", + "$description": "An optional definition in a Thing Model definition can be overwritten in the case it is extended by another Thing Model through the use of tm:ref. This examples overwrites the 'tm:optional' of another TM with an optional 'overheating' event", + "links": [ + { + "rel": "tm:extends", + "href": "./lampThingModel.tm.jsonld", + "type": "application/tm+json" + } + ], + "events": { + "overheating": { + "tm:ref": "./lampThingModel.tm.jsonld#/events/overheating" + } + } +} \ No newline at end of file diff --git a/examples/tm/5-tm-submodel/submodel.tm.jsonld b/examples/tm/5-tm-submodel/submodel.tm.jsonld new file mode 100644 index 00000000..c03311a5 --- /dev/null +++ b/examples/tm/5-tm-submodel/submodel.tm.jsonld @@ -0,0 +1,37 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "@type": "tm:ThingModel", + "title": "Smart Ventilator Thing Model", + "$title": "Top level/parent Thing Model Example", + "description": "Top level/parent Smart Ventilator Thing Model ", + "$description": "If it is desired to provide information that a Thing Model consists of one or more (sub-)TMs, the links entries must use the 'rel': 'tm:submodel' that targets to the (sub-)TM. Optionally an instanceName may be provided to associate an individual name to the composed (sub-)TM. This is useful when multiple similar Thing Model definitions are composed and needs to be distinguished.", + "version" : { "model": "1.0.0" }, + "links": [ + { + "rel": "tm:submodel", + "href": "./Ventilation.tm.jsonld", + "type": "application/tm+json", + "instanceName": "ventilation" + }, + { + "rel": "tm:submodel", + "href": "./LED.tm.jsonld", + "type": "application/tm+json", + "instanceName": "led" + } + ], + "properties" : { + "status" : {"type": "string", "enum": ["on_value", "off_value", "error_value"]} + }, + "actions": { + "toggle": { + "description": "Turn the ventilator on or off" + } + }, + "events": { + "overheating": { + "description": "Ventilator reaches a critical temperature (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file diff --git a/examples/tm/6-placeholder/placeholder.tm.jsonld b/examples/tm/6-placeholder/placeholder.tm.jsonld new file mode 100644 index 00000000..582035a0 --- /dev/null +++ b/examples/tm/6-placeholder/placeholder.tm.jsonld @@ -0,0 +1,30 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "thermostat No. {{THERMOSTAT_NUMBER}}", + "$title": "Placeholder TM Example", + "description": "A TM for a thermostat with placeholder labeling", + "$description": " In a case where TD instance terms, but not their values, are known in advance, the placeholder labeling may be used in a Thing Model. The string-based pattern of the placeholder must follow a valid pattern based on the regular expression {{2}[ -~]+}{2} (e.g., {{PLACEHOLDER_IDENTIFIER}}). The characters between {{ and }} are used as identifier name of the placeholder.", + "version": "{{VERSION_INFO}}", + "base": "mqtt://{{MQTT_BROKER_ADDRESS}}", + "properties": { + "temperature": { + "description": "Shows the current temperature value", + "type": "number", + "minimum": -20, + "maximum": "{{THERMOSTAT_TEMPERATURE_MAXIMUM}}", + "observable": "{{THERMOSTAT_TEMPERATURE_OBSERVABLE}}" + } + }, + "actions": { + "toggle": { + "description": "Turn the thermostat on or off" + } + }, + "events": { + "overheating": { + "description": "critical temperature reached (overheating)", + "data": {"type": "string"} + } + } +} \ No newline at end of file From bd2f27b92d3afa2b0d97b183cf58ee542f48a7ac Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 25 Mar 2023 19:56:05 +0100 Subject: [PATCH 13/38] minor bug tm validator, add tm test to workflow --- .github/workflows/ci-cd.yaml | 5 ++++- packages/cli/index.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index b3cc4cdd..2ec468b3 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -40,8 +40,11 @@ jobs: - name: Test run: lerna run test --no-bail --stream - -name: Examples test + -name: TD test run: node packages/cli/index.js -i examples/td/*/* + + -name: TM test + run: node packages/cli/index.js -t TM -i examples/tm/*/* deploy-via-ssh: diff --git a/packages/cli/index.js b/packages/cli/index.js index 9fbdac63..fdcd665e 100644 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -883,7 +883,7 @@ function tmCoreValidation(input) { } else { - const suite = builder.testSuite().name(el) + const suite = builder.testSuite().name(input) tmToCheck = fs.readFileSync(input, "utf-8") checkTm(tmToCheck, suite) } From a80dec7abac03185c9db52a50841a818f4f88a36 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 03:30:58 +0200 Subject: [PATCH 14/38] fixes and unique titles for the td examples --- examples/td/1-simple-default/basic-td.td.jsonld | 4 +++- .../contentMedia-&-contentEncoding.td.jsonld | 4 +++- examples/td/1-simple-default/contentType.td.jsonld | 4 +++- examples/td/1-simple-default/defaults.td.jsonld | 4 +++- .../1-simple-default/form-serialization.td.jsonld | 4 +++- .../td/1-simple-default/simple-context.td.jsonld | 4 +++- .../additional-responses.td.jsonld | 4 +++- .../simple-response.td.jsonld | 4 +++- .../multilanguage-title-description.td.jsonld | 14 ++++++++------ .../td/11-multilanguage/multilanguage.td.jsonld | 4 +++- .../td/11-multilanguage/string-direction.td.jsonld | 4 +++- .../combined-uriVariables-href.td.jsonld | 4 +++- .../12-uri-variables/dynaic-uriVariables.td.jsonld | 4 +++- .../12-uri-variables/uri-href-structure.td.jsonld | 4 +++- .../{semantic-1.td.jsonld => semantic.td.jsonld} | 4 +++- .../state-information-context-extension.td.jsonld | 4 +++- .../14-non-standard/additional-metadata.td.jsonld | 4 +++- .../location-based-metadata.td.jsonld | 4 +++- .../15-link-relation-type/collection-rel.td.jsonld | 4 +++- .../controlledBy-rel.td.jsonld | 4 +++- .../td/15-link-relation-type/item-rel.td.jsonld | 4 +++- .../service-doc-rel.td.jsonld | 4 +++- .../properties-serializations.td.jsonld | 4 +++- examples/td/2-properties/readOnly.td.jsonld | 4 +++- examples/td/2-properties/writeOnly.td.jsonld | 4 +++- .../td/3-actions/action-serialization.td.jsonld | 4 +++- examples/td/3-actions/response.td.jsonld | 5 ++++- examples/td/4-events/event-serialization.td.jsonld | 4 +++- ...nld => CoAP-block-wise-no-parameters.td.jsonld} | 4 +++- .../CoAP-block-wise-parameters.td.jsonld | 4 +++- .../5-protocols/CoAP-content-negotiation.td.jsonld | 4 +++- examples/td/5-protocols/CoAP-hop-limit.td.jsonld | 4 +++- .../5-protocols/CoAP-simple-td-defaults.td.jsonld | 4 +++- .../CoAP-simple-td-no-defaults.td.jsonld | 4 +++- .../5-protocols/CoAp-observing-resources.td.jsonld | 4 +++- .../td/5-protocols/HTTP-readproperty.td.jsonld | 4 +++- .../5-protocols/HTTP-simple-td-defaults.td.jsonld | 4 +++- .../Modbus-multiple-operations-expanded.td.jsonld | 4 +++- .../Modbus-multiple-operations.td.jsonld | 4 +++- .../td/5-protocols/Modbus-single-coil.td.jsonld | 4 +++- .../extended-forms-multiple-op.td.jsonld | 4 +++- .../td/5-protocols/subprotocol-longpoll.td.jsonld | 4 +++- .../td/6-security-schemes/OAuth2-scopes.td.jsonld | 4 +++- .../apikey-in-body-simplified.td.jsonld | 4 +++- .../td/6-security-schemes/apikey-in-body.td.jsonld | 4 +++- .../6-security-schemes/apikey-security.td.jsonld | 4 +++- .../td/6-security-schemes/basic-security.td.jsonld | 4 +++- .../combo-apikey-security.td.jsonld | 4 +++- .../combo-security-def-allOf.td.jsonld | 4 +++- .../combo-security-def-oneOf.td.jsonld | 4 +++- .../multiple-security-def.td.jsonld | 4 +++- .../multiple-security-forms.td.jsonld | 4 +++- .../td/6-security-schemes/noSec-security.td.jsonld | 4 +++- .../data-schema-serialization.td.jsonld | 4 +++- .../readOnly-&-writeOnly.td.jsonld | 4 +++- .../readallproperties.td.jsonld | 4 +++- .../top-level-uriVariables.td.jsonld | 4 +++- .../writeallproperties.td.jsonld | 4 +++- examples/td/9-versioning/versioning.td.jsonld | 4 +++- packages/cli/index.js | 5 ++++- 60 files changed, 187 insertions(+), 65 deletions(-) rename examples/td/13-semantic-annotations/{semantic-1.td.jsonld => semantic.td.jsonld} (84%) rename examples/td/5-protocols/{CoAP-block-wise-transfer.td.jsonld => CoAP-block-wise-no-parameters.td.jsonld} (69%) diff --git a/examples/td/1-simple-default/basic-td.td.jsonld b/examples/td/1-simple-default/basic-td.td.jsonld index 92f483c4..cd894cbe 100644 --- a/examples/td/1-simple-default/basic-td.td.jsonld +++ b/examples/td/1-simple-default/basic-td.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "This is an example of the most basic form of a td", + "$title": "Basic TD Example", + "description": "Thing Description for a Lamp thing", + "$description": "This is an example of the most basic form of a td", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld b/examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld index 9ef68cb1..22b8b938 100644 --- a/examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld +++ b/examples/td/1-simple-default/contentMedia-&-contentEncoding.td.jsonld @@ -3,7 +3,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", "title": "MyCameraThing", - "description": "In some cases binary data is embedded in text-based values, e.g., a JSON string-based value embeds a base64 encoded image. The terms contentMediaType and contentEncoding can be used to clarify the context and encoding format of such name-value pairs.", + "$title": "contentMedia and contentEncoding TD Example", + "description": "Thing description for a camera thing", + "$description": "In some cases binary data is embedded in text-based values, e.g., a JSON string-based value embeds a base64 encoded image. The terms contentMediaType and contentEncoding can be used to clarify the context and encoding format of such name-value pairs.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/1-simple-default/contentType.td.jsonld b/examples/td/1-simple-default/contentType.td.jsonld index 3bc51eb8..ee9bad65 100644 --- a/examples/td/1-simple-default/contentType.td.jsonld +++ b/examples/td/1-simple-default/contentType.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", "title": "MyCameraThing", - "description": "The contentType member is used to assign a media type [RFC2046] including media type parameters as attribute-value pairs separated by a ; character", + "$title": "contentType TD Example", + "description": "Thing description for a camera thing", + "$description": "The contentType member is used to assign a media type [RFC2046] including media type parameters as attribute-value pairs separated by a ; character.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/1-simple-default/defaults.td.jsonld b/examples/td/1-simple-default/defaults.td.jsonld index 56a3e842..99acebdf 100644 --- a/examples/td/1-simple-default/defaults.td.jsonld +++ b/examples/td/1-simple-default/defaults.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", "title": "MyLampThing", - "description": "A basic TD with all default values", + "$title": "All Default Values TD Example", + "description": "TD for a lamp thing", + "$description": "A basic TD with all default values", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/1-simple-default/form-serialization.td.jsonld b/examples/td/1-simple-default/form-serialization.td.jsonld index 803fec41..81d27362 100644 --- a/examples/td/1-simple-default/form-serialization.td.jsonld +++ b/examples/td/1-simple-default/form-serialization.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "This is an example of the most basic form of a td", + "$title": "Form Serialization TD Example", + "description": "TD for a lamp thing", + "$description": "This is an example for proper form serialization", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/1-simple-default/simple-context.td.jsonld b/examples/td/1-simple-default/simple-context.td.jsonld index 571bf1a9..ed7ae0a7 100644 --- a/examples/td/1-simple-default/simple-context.td.jsonld +++ b/examples/td/1-simple-default/simple-context.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A member with the name @context and a value of type string is generally used to identify the TD representation format version defined by this specification.", + "$title": "@context TD Example", + "description": "TD for a lamp thing", + "$description": "A member with the name @context and a value of type string is generally used to identify the TD representation format version defined by this specification.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/10-response-and-additional-response/additional-responses.td.jsonld b/examples/td/10-response-and-additional-response/additional-responses.td.jsonld index 3178e714..8c672f3f 100644 --- a/examples/td/10-response-and-additional-response/additional-responses.td.jsonld +++ b/examples/td/10-response-and-additional-response/additional-responses.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyCarThing", - "description": "The message received from the Thing as part of an Interaction Affordance can differ due to different reasons. Such reasons could be error cases or alternative responses for a valid response. In these cases, additionalResponses terms can be used to describe this behavior", + "$title": "Additional Responses TD Example", + "description": "TD for a Car Thing", + "$description": "The message received from the Thing as part of an Interaction Affordance can differ due to different reasons. Such reasons could be error cases or alternative responses for a valid response. In these cases, additionalResponses terms can be used to describe this behavior.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/10-response-and-additional-response/simple-response.td.jsonld b/examples/td/10-response-and-additional-response/simple-response.td.jsonld index 65f45793..385f5548 100644 --- a/examples/td/10-response-and-additional-response/simple-response.td.jsonld +++ b/examples/td/10-response-and-additional-response/simple-response.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:014139c9-b267-4db5-9c61-cc2d2bfc217d", "title": "MyCameraThing", - "description": "the Interaction Affordance not only describes the request, but also provides metadata for the expected response. In such cases, the response member is used to indicate the representation format of the response payload. therefore no output schema is required, as the content type fully specifies the representation format.", + "$title": "Simple Response TD Example", + "description": "TD for a Camera Thing", + "$description": "The Interaction Affordance not only describes the request, but also provides metadata for the expected response. In such cases, the response member is used to indicate the representation format of the response payload. therefore no output schema is required, as the content type fully specifies the representation format.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld index 15d9daa7..feb262b5 100644 --- a/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld +++ b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld @@ -13,14 +13,16 @@ "zh-Hans": "我的东西", "zh-Hant": "我的東西" }, - "description": "TD-Instanzen können auch die Verwendung von title und description mit Titeln und Beschreibungen kombinieren. title und description sind als Standardtext zu sehen", + "$title": "Multilanguage Title and Description TD Example", + "description": "TD für ein generisches Ding in verschiedenen Sprachen.", "descriptions": { - "en": "TD instances may also combine the use of title and description with titles and descriptions. title and description are seeing as the default text", - "de": "TD-Instanzen können auch die Verwendung von title und description mit Titeln und Beschreibungen kombinieren. title und description sind als Standardtext zu sehen", - "ja": "TDインスタンスでは、タイトルと説明文を組み合わせて使用することもできます。タイトルと説明文は、デフォルトのテキストとして表示されます。", - "zh-Hans": "TD实例也可以结合使用标题和描述。标题和描述被视为默认文本", - "zh-Hant": "TD 實例還可以將標題和描述與標題和描述結合使用。標題和描述被視為默認文本" + "en": "TD for a generic thing in various languages.", + "de": "TD für ein generisches Ding in verschiedenen Sprachen", + "ja": "様々な言語で汎用的なものを扱うTD", + "zh-Hans": "TD 用于各种语言的通用事物", + "zh-Hant": "TD 用於各種語言的通用事物" }, + "$description": "TD instances may also combine the use of title and description with titles and descriptions. title and description are seeing as the default text.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/11-multilanguage/multilanguage.td.jsonld b/examples/td/11-multilanguage/multilanguage.td.jsonld index 3f689092..9a9a8a7d 100644 --- a/examples/td/11-multilanguage/multilanguage.td.jsonld +++ b/examples/td/11-multilanguage/multilanguage.td.jsonld @@ -8,7 +8,9 @@ "zh-Hans": "我的东西", "zh-Hant": "我的東西" }, - "description": "A TD can contain multiple languages, where the name is a valid language tag as defined by [BCP47] and the value is a human-readable string in the language indicated by the tag", + "$title": "Multilanguage TD Example", + "description": "TD for a Generic Thing", + "$description": "A TD can contain multiple languages, where the name is a valid language tag as defined by [BCP47] and the value is a human-readable string in the language indicated by the tag.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/11-multilanguage/string-direction.td.jsonld b/examples/td/11-multilanguage/string-direction.td.jsonld index b06debc7..b8a746c3 100644 --- a/examples/td/11-multilanguage/string-direction.td.jsonld +++ b/examples/td/11-multilanguage/string-direction.td.jsonld @@ -7,7 +7,9 @@ } ], "title": "شيء يخصني يقيس درجة الحرارة", - "description": "Metadata can be used to determine the base direction of string values, utilizing @direction and the values rtl, ltr and null for default direcction", + "$title": "String Direction TD Example", + "description": "TD for a sensor that measures the temperature", + "$description": "Metadata can be used to determine the base direction of string values, utilizing @direction and the values rtl, ltr and null for default direcction.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld b/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld index 086f5ad9..c5f9bb62 100644 --- a/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld +++ b/examples/td/12-uri-variables/combined-uriVariables-href.td.jsonld @@ -1,7 +1,9 @@ { "@context": "https://www.w3.org/2022/wot/td/v1.1", "title": "MyWeatherThing", - "description": "Combined dynamic uriVariables and uriVariables in href structure", + "$title": "Combined uirVariables in href TD Example", + "description": "TD for Weather Sensor Thing", + "$description": "Combined dynamic uriVariables and uriVariables in href structure.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld b/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld index b78f859d..37f49041 100644 --- a/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld +++ b/examples/td/12-uri-variables/dynaic-uriVariables.td.jsonld @@ -1,7 +1,9 @@ { "@context": "https://www.w3.org/2022/wot/td/v1.1", "title": "MyMapThing", - "description": "href may also carry a URI that contains dynamic variables", + "$title": "Dynamic uirVariables TD Example", + "description": "TD for Geolocation Thing", + "$description": "href may also carry a URI that contains dynamic variables.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/12-uri-variables/uri-href-structure.td.jsonld b/examples/td/12-uri-variables/uri-href-structure.td.jsonld index 8eabc908..308b133e 100644 --- a/examples/td/12-uri-variables/uri-href-structure.td.jsonld +++ b/examples/td/12-uri-variables/uri-href-structure.td.jsonld @@ -1,7 +1,9 @@ { "@context": "https://www.w3.org/2022/wot/td/v1.1", "title": "MyWeatherThing", - "description": "As defined in [RFC6570], uriVariables can be used for replacing the href structure", + "$title": "URI href Structure TD Example", + "description": "TD for Weather sensor Thing", + "$description": "As defined in [RFC6570], uriVariables can be used for replacing the href structure.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/13-semantic-annotations/semantic-1.td.jsonld b/examples/td/13-semantic-annotations/semantic.td.jsonld similarity index 84% rename from examples/td/13-semantic-annotations/semantic-1.td.jsonld rename to examples/td/13-semantic-annotations/semantic.td.jsonld index 225d9bf9..325c01ca 100644 --- a/examples/td/13-semantic-annotations/semantic-1.td.jsonld +++ b/examples/td/13-semantic-annotations/semantic.td.jsonld @@ -5,7 +5,9 @@ ], "id": "urn:uuid:300f4c4b-ca6b-484a-88cf-fd5224a9a61d", "title": "MyLampThing", - "description": "Thing Description with TD Context Extension for semantic annotations", + "$title": "Semantic TD Example", + "description": "TD for a Lamp Thing", + "$description": "Thing Description with TD Context Extension for semantic annotations.", "@type": "saref:LightSwitch", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} diff --git a/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld b/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld index 0b86eb53..db4fc73a 100644 --- a/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld +++ b/examples/td/13-semantic-annotations/state-information-context-extension.td.jsonld @@ -13,7 +13,9 @@ "@type": "saref:OnOffState" }, "title": "MyLampThing", - "description": "TD Context Extensions may be used to annotate pieces of a data schema, to be able to semantically process the state information of the physical world object, which is represented by the data exchanged during an interaction.", + "$title": "State Information Context Extension TD Example", + "description": "TD for a Lamp Thing", + "$description": "TD Context Extensions may be used to annotate pieces of a data schema, to be able to semantically process the state information of the physical world object, which is represented by the data exchanged during an interaction.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/14-non-standard/additional-metadata.td.jsonld b/examples/td/14-non-standard/additional-metadata.td.jsonld index 8673ef75..121e1ea2 100644 --- a/examples/td/14-non-standard/additional-metadata.td.jsonld +++ b/examples/td/14-non-standard/additional-metadata.td.jsonld @@ -15,7 +15,9 @@ "schema:manufacturer": {"name": "CompanyName"}, "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyTemperatureSensor", - "description": "This example provides additional metadata terms from different external context files as provided in @context.", + "$title": "Additional Metadata TD Example", + "description": "TD for a Temperature Sensor Thing", + "$description": "This example provides additional metadata terms from different external context files as provided in @context.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/14-non-standard/location-based-metadata.td.jsonld b/examples/td/14-non-standard/location-based-metadata.td.jsonld index df7dbcf6..4f81b8de 100644 --- a/examples/td/14-non-standard/location-based-metadata.td.jsonld +++ b/examples/td/14-non-standard/location-based-metadata.td.jsonld @@ -7,7 +7,9 @@ ], "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyRobotThing", - "description": "In some use cases location based metadata have to be provided at the interaction level, e.g., as provided as a Property that returns the latest longitude, latitude, and elevation values based on schema.org", + "$title": "Location Based Metadata TD Example", + "description": "TD for a Robot Thing", + "$description": "In some use cases location based metadata have to be provided at the interaction level, e.g., as provided as a Property that returns the latest longitude, latitude, and elevation values based on schema.org", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/15-link-relation-type/collection-rel.td.jsonld b/examples/td/15-link-relation-type/collection-rel.td.jsonld index 6e2af6d1..bf20b4ca 100644 --- a/examples/td/15-link-relation-type/collection-rel.td.jsonld +++ b/examples/td/15-link-relation-type/collection-rel.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "Electric Motor 1", - "description": "A Thing can also refer to a group in which it is collected with the collection value", + "$title": "Collection relation TD Example", + "description": "TD for an Electric Motor Thing", + "$description": "A Thing can also refer to a group in which it is collected with the collection value.", "base": "coaps://motor1.example.com", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} diff --git a/examples/td/15-link-relation-type/controlledBy-rel.td.jsonld b/examples/td/15-link-relation-type/controlledBy-rel.td.jsonld index c080d989..5d634f67 100644 --- a/examples/td/15-link-relation-type/controlledBy-rel.td.jsonld +++ b/examples/td/15-link-relation-type/controlledBy-rel.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A reference can be provided that points to a Thing (e.g., a controller) that controls the underlying unit (e.g., a lamp) utilizing controlledBy", + "$title": "controlledBy Relation TD Example", + "description": "TD for a Lamp Thing", + "$description": "A reference can be provided that points to a Thing (e.g., a controller) that controls the underlying unit (e.g., a lamp) utilizing controlledBy.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/15-link-relation-type/item-rel.td.jsonld b/examples/td/15-link-relation-type/item-rel.td.jsonld index 7ace70fc..99cd1d06 100644 --- a/examples/td/15-link-relation-type/item-rel.td.jsonld +++ b/examples/td/15-link-relation-type/item-rel.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "Electric Drive", - "description": "A superordinate Thing can collect a group of Things and refer to them by using the item value", + "$title": "Item Relation TD Example", + "description": "TD for an Electric Drive Thing", + "$description": "A superordinate Thing can collect a group of Things and refer to them by using the item value.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/15-link-relation-type/service-doc-rel.td.jsonld b/examples/td/15-link-relation-type/service-doc-rel.td.jsonld index 3fdf431e..56fdff2c 100644 --- a/examples/td/15-link-relation-type/service-doc-rel.td.jsonld +++ b/examples/td/15-link-relation-type/service-doc-rel.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "To point to a developer documentation of a Thing the value service-doc can be used", + "$title": "Service-doc Relation TD Example", + "description": "TD for a Lamp Thing", + "$description": "To point to a developer documentation of a Thing the value service-doc can be used.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/2-properties/properties-serializations.td.jsonld b/examples/td/2-properties/properties-serializations.td.jsonld index fb2cc808..80eb2cff 100644 --- a/examples/td/2-properties/properties-serializations.td.jsonld +++ b/examples/td/2-properties/properties-serializations.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "All name-value pairs of a map of PropertyAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", + "$title": "Properties Serialization TD Example", + "description": "TD for a lamp thing", + "$description": "All name-value pairs of a map of PropertyAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/2-properties/readOnly.td.jsonld b/examples/td/2-properties/readOnly.td.jsonld index 21d0e9b7..1e9b3147 100644 --- a/examples/td/2-properties/readOnly.td.jsonld +++ b/examples/td/2-properties/readOnly.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "readOnly can be used to signal which data items are exchanged in read interactions (i.e., when reading a Property)", + "$title": "readOnly TD Example", + "description": "TD for a lamp thing", + "$description": "readOnly can be used to signal which data items are exchanged in read interactions (i.e., when reading a Property)", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/2-properties/writeOnly.td.jsonld b/examples/td/2-properties/writeOnly.td.jsonld index 8d831209..d7abceca 100644 --- a/examples/td/2-properties/writeOnly.td.jsonld +++ b/examples/td/2-properties/writeOnly.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "writeOnly can be used to signal which data items are exchanged in write interactions (i.e., when writing a Property)", + "$title": "writeOnly TD Example", + "description": "TD for a lamp thing", + "$description": "writeOnly can be used to signal which data items are exchanged in write interactions (i.e., when writing a Property)", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/3-actions/action-serialization.td.jsonld b/examples/td/3-actions/action-serialization.td.jsonld index d7dbf95e..3acfaa52 100644 --- a/examples/td/3-actions/action-serialization.td.jsonld +++ b/examples/td/3-actions/action-serialization.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "All name-value pairs of a Map of ActionAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", + "$title": "Action Serialization TD Example", + "description": "TD for a Lamp Thing", + "$description": "All name-value pairs of a Map of ActionAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/3-actions/response.td.jsonld b/examples/td/3-actions/response.td.jsonld index 035597d5..a674ef35 100644 --- a/examples/td/3-actions/response.td.jsonld +++ b/examples/td/3-actions/response.td.jsonld @@ -2,7 +2,10 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyCameraThing", - "description": "In some use cases, the form metadata of the Interaction Affordance not only describes the request, but also provides metadata for the expected response. The response must be a JSON object and contain a contentType", + "$title": "Action Response TD Example", + "description": "TD for a Camera Thing", + "$description": "In some use cases, the form metadata of the Interaction Affordance not only describes the request, but also provides metadata for the expected response. The response must be a JSON object and contain a contentType", + "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/4-events/event-serialization.td.jsonld b/examples/td/4-events/event-serialization.td.jsonld index fe4afd9c..6792558d 100644 --- a/examples/td/4-events/event-serialization.td.jsonld +++ b/examples/td/4-events/event-serialization.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "All name-value pairs of a Map of EventAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", + "$title": "Event Serialization TD Example", + "description": "TD for a Lamp Thing", + "$description": "All name-value pairs of a Map of EventAffordance instances MUST be serialized as members of the JSON object that results from serializing the Map", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld b/examples/td/5-protocols/CoAP-block-wise-no-parameters.td.jsonld similarity index 69% rename from examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld rename to examples/td/5-protocols/CoAP-block-wise-no-parameters.td.jsonld index ca63aa8d..8df9e814 100644 --- a/examples/td/5-protocols/CoAP-block-wise-transfer.td.jsonld +++ b/examples/td/5-protocols/CoAP-block-wise-no-parameters.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "CoAP supports block-wise transfers to allow large resource representations to be transferred between clients and servers. This feature enables clients and servers to request or provide resource representations in smaller blocks, which can be useful when constrained network conditions make it undesirable to transfer large amounts of data at once.", + "$title": "CoAP Block Wise No Parameters TD Example", + "description": "TD for a Lamp Thing", + "$description": "CoAP supports block-wise transfers to allow large resource representations to be transferred between clients and servers. This feature enables clients and servers to request or provide resource representations in smaller blocks, which can be useful when constrained network conditions make it undesirable to transfer large amounts of data at once.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld b/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld index 1fe32e24..0ff6de8a 100644 --- a/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld +++ b/examples/td/5-protocols/CoAP-block-wise-parameters.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A cov:blockwise or cov:quickblockwise member may indicate relevant parameters, such as the largest block size that may be used in a Block2 Option.", + "$title": "CoAP Block Wise Parameters TD Example", + "description": "TD for a Lamp Thing", + "$description": "A cov:blockwise or cov:quickblockwise member may indicate relevant parameters, such as the largest block size that may be used in a Block2 Option.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld b/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld index 8eb40540..d871da49 100644 --- a/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld +++ b/examples/td/5-protocols/CoAP-content-negotiation.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Content negotiation in CoAP is used to negotiate the representation of CoAP resources that may have different representations available. This is accomplished through the use of CoAP Accept and Content-Format options. The CoAP Accept option is used by clients to request a particular content format, while the Content-Format option is used by clients and servers to indicate the content format of the representation in requests and responses, respectively. ", + "$title": "CoAP Content Negotiation TD Example", + "description": "TD for a Lamp Thing", + "$description": "Content negotiation in CoAP is used to negotiate the representation of CoAP resources that may have different representations available. This is accomplished through the use of CoAP Accept and Content-Format options. The CoAP Accept option is used by clients to request a particular content format, while the Content-Format option is used by clients and servers to indicate the content format of the representation in requests and responses, respectively.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/CoAP-hop-limit.td.jsonld b/examples/td/5-protocols/CoAP-hop-limit.td.jsonld index b04b55e3..a99591f5 100644 --- a/examples/td/5-protocols/CoAP-hop-limit.td.jsonld +++ b/examples/td/5-protocols/CoAP-hop-limit.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "The CoAP Hop-Limit option [RFC8768] limits the number of hops a CoAP message can take before it is considered undeliverable. This prevents infinite message loops in CoAP networks. The cov:hopLimit member can be used to set the desired hop limit for a particular CoAP request", + "$title": "CoAP Hop Limit TD Example", + "description": "TD for a Lamp Thing", + "$description": "The CoAP Hop-Limit option [RFC8768] limits the number of hops a CoAP message can take before it is considered undeliverable. This prevents infinite message loops in CoAP networks. The cov:hopLimit member can be used to set the desired hop limit for a particular CoAP request.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld b/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld index 89e9369f..e32d93d8 100644 --- a/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld +++ b/examples/td/5-protocols/CoAP-simple-td-defaults.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", + "$title": "CoAP Simple Defaults TD Example", + "description": "TD for a Lamp Thing", + "$description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld b/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld index 7c331e47..93f39199 100644 --- a/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld +++ b/examples/td/5-protocols/CoAP-simple-td-no-defaults.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", + "$title": "CoAP Simple No Defaults TD Example", + "description": "TD for a Lamp Thing", + "$description": "A simple Thing Description using CoAP. The target resource is specified in the Thing Description by the href member of a form and the request method (e.g., GET, PUT, POST, or DELETE) is specified using the cov:method member of a form.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/CoAp-observing-resources.td.jsonld b/examples/td/5-protocols/CoAp-observing-resources.td.jsonld index 4199c6fa..082bd31c 100644 --- a/examples/td/5-protocols/CoAp-observing-resources.td.jsonld +++ b/examples/td/5-protocols/CoAp-observing-resources.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "CoAP provides a mechanism for clients to *observe* resources [RFC7641], i.e., to request notifications from the server whenever the resource changes. This is especially useful in the Web of Things where many Things are expected to have resources that change over time, such as sensor readings.", + "$title": "CoAP Observing Resources TD Example", + "description": "TD for a Lamp Thing", + "$description": "CoAP provides a mechanism for clients to *observe* resources [RFC7641], i.e., to request notifications from the server whenever the resource changes. This is especially useful in the Web of Things where many Things are expected to have resources that change over time, such as sensor readings.", "securityDefinitions": { "basic_sc": { "scheme": "basic" diff --git a/examples/td/5-protocols/HTTP-readproperty.td.jsonld b/examples/td/5-protocols/HTTP-readproperty.td.jsonld index eaef44de..179a37f9 100644 --- a/examples/td/5-protocols/HTTP-readproperty.td.jsonld +++ b/examples/td/5-protocols/HTTP-readproperty.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", "title": "MyLampThing", - "description": "This example shows the binding of the readproperty operation for the HTTP", + "$title": "HTTP readproperty TD Example", + "description": "TD for a Lamp Thing", + "$description": "This example shows the binding of the readproperty operation for the HTTP", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld b/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld index 468bbf42..052241fa 100644 --- a/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld +++ b/examples/td/5-protocols/HTTP-simple-td-defaults.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:3deca264-4f90-4321-a5ea-f197e6a1c7cf", "title": "MyLampThing", - "description": "This example shows the default values for Procol Binding based on HTTP", + "$title": "HTTP Simple with Defaults TD Example", + "description": "TD for a Lamp Thing", + "$description": "This example shows the default values for Procol Binding based on HTTP", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld b/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld index 24455e1d..ea0701a9 100644 --- a/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld +++ b/examples/td/5-protocols/Modbus-multiple-operations-expanded.td.jsonld @@ -6,7 +6,9 @@ } ], "title": "ModbusPLC", - "description": "This is an example of an extended version when using multiple operations with Modbus", + "$title": "Modbus Multiple Operations Expanded TD Example", + "description": "TD for a ModbusPLC", + "$description": "This is an example of an extended version when using multiple operations with Modbus", "id": "uri:dev:ModbusTCPThing", "securityDefinitions": { "nosec_sc": { diff --git a/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld b/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld index 2324b4fd..6029cc1d 100644 --- a/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld +++ b/examples/td/5-protocols/Modbus-multiple-operations.td.jsonld @@ -6,7 +6,9 @@ } ], "title": "ModbusPLC", - "description": "To describe forms with multiple operations types, the Entity keyword can be used to create a short description of the modbus endpoint. This example shows how to use the read and write property in a single coil", + "$title": "Modbus Multiple Operations TD Example", + "description": "TD for a ModbusPLC", + "$description": "To describe forms with multiple operations types, the Entity keyword can be used to create a short description of the modbus endpoint. This example shows how to use the read and write property in a single coil.", "id": "uri:dev:ModbusTCPThing", "securityDefinitions": { "nosec_sc": { diff --git a/examples/td/5-protocols/Modbus-single-coil.td.jsonld b/examples/td/5-protocols/Modbus-single-coil.td.jsonld index 7ab8776d..90a98396 100644 --- a/examples/td/5-protocols/Modbus-single-coil.td.jsonld +++ b/examples/td/5-protocols/Modbus-single-coil.td.jsonld @@ -6,7 +6,9 @@ } ], "title": "ModbusPLC", - "description": "This example shows the minimal set of terms to configure a single coil reading using Modbus. Notice that the unitID is contained in the href as the first element of the path", + "$title": "Modbus Single Coil TD Example", + "description": "TD for a ModbusPLC", + "$description": "This example shows the minimal set of terms to configure a single coil reading using Modbus. Notice that the unitID is contained in the href as the first element of the path.", "id": "uri:dev:ModbusTCPThing", "securityDefinitions": { "nosec_sc": { diff --git a/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld b/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld index 40b5ede5..a4174e27 100644 --- a/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld +++ b/examples/td/5-protocols/extended-forms-multiple-op.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", "title": "MyLampThing", - "description": "In the case of a forms entry that has multiple op values the usage of the htv:methodName is not permitted. A TD Processor will extend the multiple op values to separate forms entries and associates a single operation with the default assumption.", + "$title": "Extended Forms Multiple op TD Example", + "description": "TD for a Lamp Thing", + "$description": "In the case of a forms entry that has multiple op values the usage of the htv:methodName is not permitted. A TD Processor will extend the multiple op values to separate forms entries and associates a single operation with the default assumption.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/5-protocols/subprotocol-longpoll.td.jsonld b/examples/td/5-protocols/subprotocol-longpoll.td.jsonld index 26f7fc92..bc485daf 100644 --- a/examples/td/5-protocols/subprotocol-longpoll.td.jsonld +++ b/examples/td/5-protocols/subprotocol-longpoll.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:9cd44eef-0b3f-4566-94b0-1358af3d86bd", "title": "MyLampThing", - "description": " protocols may have defined Subprotocols that can be used for some interaction types. For example, to receive asynchronous notifications using HTTP, some servers may support long polling", + "$title": "Subprotocol Longpoll TD Example", + "description": "TD for a Lamp Thing", + "$description": "protocols may have defined Subprotocols that can be used for some interaction types. For example, to receive asynchronous notifications using HTTP, some servers may support long polling.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/6-security-schemes/OAuth2-scopes.td.jsonld b/examples/td/6-security-schemes/OAuth2-scopes.td.jsonld index 39226292..4227eb6a 100644 --- a/examples/td/6-security-schemes/OAuth2-scopes.td.jsonld +++ b/examples/td/6-security-schemes/OAuth2-scopes.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "OAuth 2.0 makes use of scopes. These are identifiers that may appear in tokens and must match with corresponding identifiers in a resource to allow access to that resource", + "$title": "OAuth2 Scopes TD Example", + "description": "TD for a Lamp Thing", + "$description": "OAuth 2.0 makes use of scopes. These are identifiers that may appear in tokens and must match with corresponding identifiers in a resource to allow access to that resource.", "securityDefinitions": { "oauth2_sc": { "scheme": "oauth2", diff --git a/examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld b/examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld index ab137e8d..84b5cab1 100644 --- a/examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld +++ b/examples/td/6-security-schemes/apikey-in-body-simplified.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "It is possbile to simplify how security parameters are included in the payload by using the feature that the location referenced by a JSON pointer in a body location will be automatically inserted if it does not exist.", + "$title": "Apikey In Body Simplified TD Example", + "description": "TD for a Lamp Thing", + "$description": "It is possbile to simplify how security parameters are included in the payload by using the feature that the location referenced by a JSON pointer in a body location will be automatically inserted if it does not exist.", "securityDefinitions": { "apikey_body": { "scheme": "apikey", diff --git a/examples/td/6-security-schemes/apikey-in-body.td.jsonld b/examples/td/6-security-schemes/apikey-in-body.td.jsonld index ad3f4eb6..c27e2570 100644 --- a/examples/td/6-security-schemes/apikey-in-body.td.jsonld +++ b/examples/td/6-security-schemes/apikey-in-body.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "This in an example on how to include security parameters along with the payload", + "$title": "Apikey In Body TD Example", + "description": "TD for a Lamp Thing", + "$description": "This in an example on how to include security parameters along with the payload.", "securityDefinitions": { "apikey_body": { "scheme": "apikey", diff --git a/examples/td/6-security-schemes/apikey-security.td.jsonld b/examples/td/6-security-schemes/apikey-security.td.jsonld index 801c64f0..dd01a082 100644 --- a/examples/td/6-security-schemes/apikey-security.td.jsonld +++ b/examples/td/6-security-schemes/apikey-security.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "API key can be included in the request to the Thing in different ways. One way it can be used, is as a URI template where the API key should be replaced in the URI when sending an HTTPS request", + "$title": "Apikey Security TD Example", + "description": "TD for a Lamp Thing", + "$description": "API key can be included in the request to the Thing in different ways. One way it can be used, is as a URI template where the API key should be replaced in the URI when sending an HTTPS request.", "securityDefinitions": { "apikey_key": { "scheme": "apikey", diff --git a/examples/td/6-security-schemes/basic-security.td.jsonld b/examples/td/6-security-schemes/basic-security.td.jsonld index 626eaa8c..c0b3e652 100644 --- a/examples/td/6-security-schemes/basic-security.td.jsonld +++ b/examples/td/6-security-schemes/basic-security.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A simple security configuration specifying basic username/password authentication in the header", + "$title": "Basic Security TD Example", + "description": "TD for a Lamp Thing", + "$description": "A simple security configuration specifying basic username/password authentication in the header.", "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/6-security-schemes/combo-apikey-security.td.jsonld b/examples/td/6-security-schemes/combo-apikey-security.td.jsonld index a3a95afe..90a8b8cb 100644 --- a/examples/td/6-security-schemes/combo-apikey-security.td.jsonld +++ b/examples/td/6-security-schemes/combo-apikey-security.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Multiple intances of API security schemes are also possible. These must then be used in the href in in a Form where the security scheme is active", + "$title": "Combo Apikey Security TD Example", + "description": "TD for a Lamp Thing", + "$description": "Multiple intances of API security schemes are also possible. These must then be used in the href in in a Form where the security scheme is active.", "securityDefinitions": { "apikey_key": { "scheme": "apikey", diff --git a/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld b/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld index 6cda7f15..da31f9a7 100644 --- a/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld +++ b/examples/td/6-security-schemes/combo-security-def-allOf.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "TDs can specify a combination of security schemes. A ComboSecurityScheme with allOf can be used to specify that all need to be satisfied to allow activation of the Interaction Affordance. ", + "$title": "Combo Security allOf TD Example", + "description": "TD for a Lamp Thing", + "$description": "TDs can specify a combination of security schemes. A ComboSecurityScheme with allOf can be used to specify that all need to be satisfied to allow activation of the Interaction Affordance.", "securityDefinitions": { "proxy_sc": { "scheme": "digest", diff --git a/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld b/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld index 340528d4..c53b073b 100644 --- a/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld +++ b/examples/td/6-security-schemes/combo-security-def-oneOf.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "TDs can specify a combination of security schemes. To avoid redundancy in this case, e.g. repeating the details of the form elements, a ComboSecurityScheme with oneOf can be used instead. ", + "$title": "Combo Security oneOf TD Example", + "description": "TD for a Lamp Thing", + "$description": "TDs can specify a combination of security schemes. To avoid redundancy in this case, e.g. repeating the details of the form elements, a ComboSecurityScheme with oneOf can be used instead.", "securityDefinitions": { "basic_sc": { "scheme": "basic" }, "digest_sc": { "scheme": "digest" }, diff --git a/examples/td/6-security-schemes/multiple-security-def.td.jsonld b/examples/td/6-security-schemes/multiple-security-def.td.jsonld index 13ebed79..262d8eee 100644 --- a/examples/td/6-security-schemes/multiple-security-def.td.jsonld +++ b/examples/td/6-security-schemes/multiple-security-def.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "A TD can also have multiple security definitions", + "$title": "Multiple Security Definitions TD Example", + "description": "TD for a Lamp Thing", + "$description": "A TD can also have multiple security definitions.", "securityDefinitions": { "basic_sc": {"scheme": "basic"}, "nosec_sc": {"scheme": "nosec"} diff --git a/examples/td/6-security-schemes/multiple-security-forms.td.jsonld b/examples/td/6-security-schemes/multiple-security-forms.td.jsonld index fdde7bae..a4413a0b 100644 --- a/examples/td/6-security-schemes/multiple-security-forms.td.jsonld +++ b/examples/td/6-security-schemes/multiple-security-forms.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Security configurations can also be specified for different forms within the same Interaction Affordance", + "$title": "Multiple Security Forms TD Example", + "description": "TD for a Lamp Thing", + "$description": "Security configurations can also be specified for different forms within the same Interaction Affordance.", "securityDefinitions": { "basic_sc": { "scheme": "basic" }, "digest_sc": { "scheme": "digest" }, diff --git a/examples/td/6-security-schemes/noSec-security.td.jsonld b/examples/td/6-security-schemes/noSec-security.td.jsonld index 7433a5e4..7c38bc51 100644 --- a/examples/td/6-security-schemes/noSec-security.td.jsonld +++ b/examples/td/6-security-schemes/noSec-security.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Security configuration in the TD is mandatory, therefore the nosec security scheme is provided for the case that no security is needed", + "$title": "noSec Security TD Example", + "description": "TD for a Lamp Thing", + "$description": "Security configuration in the TD is mandatory, therefore the nosec security scheme is provided for the case that no security is needed.", "securityDefinitions": { "nosec_sc": { "scheme": "nosec" diff --git a/examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld b/examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld index 61c45d26..903f5b03 100644 --- a/examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld +++ b/examples/td/7-complex-data-schemas/data-schema-serialization.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", + "$title": "Data Schema Serialization TD Example", + "description": "TD for a Lamp Thing", + "$description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld b/examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld index d45c3bc6..407452be 100644 --- a/examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld +++ b/examples/td/7-complex-data-schemas/readOnly-&-writeOnly.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", + "$title": "readOnly And writeOnly TD Example", + "description": "TD for a Lamp Thing", + "$description": "Data schema serialization applies to PropertyAffordance instances, the values assigned to input and output in ActionAffordance instances, the values assigned to subscription, data, and cancellation in EventAffordance instances, and the value assigned to uriVariables in instances of Subclasses of InteractionAffordance.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/8-meta-interactions/readallproperties.td.jsonld b/examples/td/8-meta-interactions/readallproperties.td.jsonld index c5e4a614..2c8fef6d 100644 --- a/examples/td/8-meta-interactions/readallproperties.td.jsonld +++ b/examples/td/8-meta-interactions/readallproperties.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. readallproperties is a type of meta interaction which allows the consumer to read all properties at once", + "$title": "Readallproperties TD Example", + "description": "TD for a Lamp Thing", + "$description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. readallproperties is a type of meta interaction which allows the consumer to read all properties at once.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld b/examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld index 443a63b7..ee6af39c 100644 --- a/examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld +++ b/examples/td/8-meta-interactions/top-level-uriVariables.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyThing", - "description": "Thing-level uriVariables can be used here to supply further variables to the operation or to specify a list of Property Affordance names for a readmultipleproperties operation", + "$title": "Top Level uriVariables TD Example", + "description": "TD for a generic Thing", + "$description": "Thing-level uriVariables can be used here to supply further variables to the operation or to specify a list of Property Affordance names for a readmultipleproperties operation.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/8-meta-interactions/writeallproperties.td.jsonld b/examples/td/8-meta-interactions/writeallproperties.td.jsonld index 7d8f48ce..54d990d4 100644 --- a/examples/td/8-meta-interactions/writeallproperties.td.jsonld +++ b/examples/td/8-meta-interactions/writeallproperties.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. writeallproperties is a type of meta interaction which allows the consumer to write all properties at once", + "$title": "Writeallproperties TD Example", + "description": "TD for a Lamp Thing", + "$description": "When forms is present at the top level, it can be used to describe meta interactions offered by a Thing. writeallproperties is a type of meta interaction which allows the consumer to write all properties at once.", "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} }, diff --git a/examples/td/9-versioning/versioning.td.jsonld b/examples/td/9-versioning/versioning.td.jsonld index 2b25700c..517d4341 100644 --- a/examples/td/9-versioning/versioning.td.jsonld +++ b/examples/td/9-versioning/versioning.td.jsonld @@ -2,7 +2,9 @@ "@context": "https://www.w3.org/2022/wot/td/v1.1", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "MyLampThing", - "description": "The version member is intended as container for additional application- and/or device-specific version information based on TD Context Extensions", + "$title": "Versioning TD Example", + "description": "TD for a Lamp Thing", + "$description": "The version member is intended as container for additional application- and/or device-specific version information based on TD Context Extensions.", "version": { "instance": "1.2.1" }, "securityDefinitions": { "basic_sc": {"scheme": "basic", "in": "header"} diff --git a/packages/cli/index.js b/packages/cli/index.js index fdcd665e..df1dfbf5 100644 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -519,7 +519,10 @@ function checkTd(td, suite) { .then(result => { console.log("OKAY \n") console.log("\n") - console.log("--- Report ",JSON.parse(td).title,"---\n", result, "\n--------------") + if(JSON.parse(td).$title){ + console.log("--- Identifier name: ",JSON.parse(td).$title,"---\n") + } + console.log("--- Report: ",JSON.parse(td).title,"---\n", result, "\n--------------") if (myArguments.junit) { builder.writeTo("junit-tests.xml") } From b5107eaac69ca17d8e2845e9dcfd2e81a3e0073a Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 03:43:54 +0200 Subject: [PATCH 15/38] workflow test --- .github/workflows/ci-cd.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 2ec468b3..db30e5be 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -40,12 +40,6 @@ jobs: - name: Test run: lerna run test --no-bail --stream - -name: TD test - run: node packages/cli/index.js -i examples/td/*/* - - -name: TM test - run: node packages/cli/index.js -t TM -i examples/tm/*/* - deploy-via-ssh: runs-on: ubuntu-latest From 4ae959a0032f7e08fe879643d743bd2c71a74191 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 03:46:42 +0200 Subject: [PATCH 16/38] . --- .github/workflows/ci-cd.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index db30e5be..b3044ed2 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -39,6 +39,9 @@ jobs: - name: Test run: lerna run test --no-bail --stream + + -name: TM test + run: node packages/cli/index.js -t TM -i examples/tm/*/* deploy-via-ssh: From 43a4c69d26fc3b1610fb0133e6ba0c43121de7e9 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 03:48:22 +0200 Subject: [PATCH 17/38] . --- .github/workflows/ci-cd.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index b3044ed2..d6c08a8f 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -39,8 +39,11 @@ jobs: - name: Test run: lerna run test --no-bail --stream + + - name: TD test + run: node packages/cli/index.js -i examples/td/*/* - -name: TM test + - name: TM test run: node packages/cli/index.js -t TM -i examples/tm/*/* deploy-via-ssh: From 200f5d94cf9b3090dd03ea6589ae96d913f3f46a Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 23:26:04 +0200 Subject: [PATCH 18/38] README files for each td examples folder --- examples/td/1-simple-default/README.txt | 1 + examples/td/10-response-and-additional-response/README.txt | 1 + examples/td/11-multilanguage/README.txt | 1 + examples/td/12-uri-variables/README.txt | 1 + examples/td/13-semantic-annotations/README.txt | 0 examples/td/14-non-standard/README.txt | 1 + examples/td/15-link-relation-type/README.txt | 1 + examples/td/16-td-tm-relationships/README.txt | 1 + examples/td/2-properties/README.txt | 1 + examples/td/3-actions/README.txt | 1 + examples/td/4-events/README.txt | 1 + examples/td/5-protocols/README.txt | 1 + examples/td/6-security-schemes/README.txt | 1 + examples/td/7-complex-data-schemas/README.txt | 1 + examples/td/8-meta-interactions/README.txt | 1 + examples/td/9-versioning/README.txt | 1 + 16 files changed, 15 insertions(+) create mode 100644 examples/td/1-simple-default/README.txt create mode 100644 examples/td/10-response-and-additional-response/README.txt create mode 100644 examples/td/11-multilanguage/README.txt create mode 100644 examples/td/12-uri-variables/README.txt create mode 100644 examples/td/13-semantic-annotations/README.txt create mode 100644 examples/td/14-non-standard/README.txt create mode 100644 examples/td/15-link-relation-type/README.txt create mode 100644 examples/td/16-td-tm-relationships/README.txt create mode 100644 examples/td/2-properties/README.txt create mode 100644 examples/td/3-actions/README.txt create mode 100644 examples/td/4-events/README.txt create mode 100644 examples/td/5-protocols/README.txt create mode 100644 examples/td/6-security-schemes/README.txt create mode 100644 examples/td/7-complex-data-schemas/README.txt create mode 100644 examples/td/8-meta-interactions/README.txt create mode 100644 examples/td/9-versioning/README.txt diff --git a/examples/td/1-simple-default/README.txt b/examples/td/1-simple-default/README.txt new file mode 100644 index 00000000..6dff4bd8 --- /dev/null +++ b/examples/td/1-simple-default/README.txt @@ -0,0 +1 @@ +This Folder contains multiple simple/basic examples of Thing Description as well as its most basic components. \ No newline at end of file diff --git a/examples/td/10-response-and-additional-response/README.txt b/examples/td/10-response-and-additional-response/README.txt new file mode 100644 index 00000000..5a29e459 --- /dev/null +++ b/examples/td/10-response-and-additional-response/README.txt @@ -0,0 +1 @@ +This folder contains examples that show how an interaction affordance can provide additonal metadata as a response. \ No newline at end of file diff --git a/examples/td/11-multilanguage/README.txt b/examples/td/11-multilanguage/README.txt new file mode 100644 index 00000000..5fff8361 --- /dev/null +++ b/examples/td/11-multilanguage/README.txt @@ -0,0 +1 @@ +This folder contains examples on how multiple languages as well as reading directions can be implemented on a Thing Description. \ No newline at end of file diff --git a/examples/td/12-uri-variables/README.txt b/examples/td/12-uri-variables/README.txt new file mode 100644 index 00000000..f7505d7e --- /dev/null +++ b/examples/td/12-uri-variables/README.txt @@ -0,0 +1 @@ +This folder contains examples regarding the use of URI variables in Thing Descriptions. \ No newline at end of file diff --git a/examples/td/13-semantic-annotations/README.txt b/examples/td/13-semantic-annotations/README.txt new file mode 100644 index 00000000..e69de29b diff --git a/examples/td/14-non-standard/README.txt b/examples/td/14-non-standard/README.txt new file mode 100644 index 00000000..c2c1a1b6 --- /dev/null +++ b/examples/td/14-non-standard/README.txt @@ -0,0 +1 @@ +This folder contains examples regarding how additional non-standard metadata could be used to personalize or adapt a Thing Description to a specific situtation or appplication. \ No newline at end of file diff --git a/examples/td/15-link-relation-type/README.txt b/examples/td/15-link-relation-type/README.txt new file mode 100644 index 00000000..f859d833 --- /dev/null +++ b/examples/td/15-link-relation-type/README.txt @@ -0,0 +1 @@ +This folder contains examples regarding the possible relation links that could be used between individual or a collection of Thing Descriptions. \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/README.txt b/examples/td/16-td-tm-relationships/README.txt new file mode 100644 index 00000000..5b1ef1ae --- /dev/null +++ b/examples/td/16-td-tm-relationships/README.txt @@ -0,0 +1 @@ +This folder contains examples of Thing Descriptions that would result from one or many Thing Models. \ No newline at end of file diff --git a/examples/td/2-properties/README.txt b/examples/td/2-properties/README.txt new file mode 100644 index 00000000..d77b3dd0 --- /dev/null +++ b/examples/td/2-properties/README.txt @@ -0,0 +1 @@ +This folder contains various examples concerning the "properties" interaction affordance. \ No newline at end of file diff --git a/examples/td/3-actions/README.txt b/examples/td/3-actions/README.txt new file mode 100644 index 00000000..98be0ea1 --- /dev/null +++ b/examples/td/3-actions/README.txt @@ -0,0 +1 @@ +This folder contains various examples concerning the "actions" interaction affordance. \ No newline at end of file diff --git a/examples/td/4-events/README.txt b/examples/td/4-events/README.txt new file mode 100644 index 00000000..e5aae543 --- /dev/null +++ b/examples/td/4-events/README.txt @@ -0,0 +1 @@ +This folder contains various examples concerning the "events" interaction affordance. \ No newline at end of file diff --git a/examples/td/5-protocols/README.txt b/examples/td/5-protocols/README.txt new file mode 100644 index 00000000..195954da --- /dev/null +++ b/examples/td/5-protocols/README.txt @@ -0,0 +1 @@ +This folder contains various examples concerning the different types of protocols that can be used with Thing Descriptions such as HTTP, Modbus, CoAP, etc. \ No newline at end of file diff --git a/examples/td/6-security-schemes/README.txt b/examples/td/6-security-schemes/README.txt new file mode 100644 index 00000000..f6eaf9a3 --- /dev/null +++ b/examples/td/6-security-schemes/README.txt @@ -0,0 +1 @@ +This folder contains various examples concerning the different types of security schemes that could/should be used for a Thing Description, as well as the different ways to combiine multiple security schemes. \ No newline at end of file diff --git a/examples/td/7-complex-data-schemas/README.txt b/examples/td/7-complex-data-schemas/README.txt new file mode 100644 index 00000000..59d3ff24 --- /dev/null +++ b/examples/td/7-complex-data-schemas/README.txt @@ -0,0 +1 @@ +This folder contains various examples of Thing Descriptions with more complex data schemas. \ No newline at end of file diff --git a/examples/td/8-meta-interactions/README.txt b/examples/td/8-meta-interactions/README.txt new file mode 100644 index 00000000..7c9484bb --- /dev/null +++ b/examples/td/8-meta-interactions/README.txt @@ -0,0 +1 @@ +This folder contains various examples of meta interactions that can be used in Thing Descriptions such as readallproperties, writeallproperties, etc. \ No newline at end of file diff --git a/examples/td/9-versioning/README.txt b/examples/td/9-versioning/README.txt new file mode 100644 index 00000000..e28bb914 --- /dev/null +++ b/examples/td/9-versioning/README.txt @@ -0,0 +1 @@ +This folder contains examples that show how to manage versioning on Thing Descriptions. \ No newline at end of file From ef5c6884eb8c5950225e1fe3748e06f427279539 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sun, 26 Mar 2023 23:48:45 +0200 Subject: [PATCH 19/38] README files for TM examples --- examples/tm/1-basic/README.txt | 1 + examples/tm/2-tm-versioning/README.txt | 1 + examples/tm/3-tm-extends-imports/README.txt | 1 + examples/tm/4-tm-optional/README.txt | 1 + examples/tm/5-tm-submodel/README.txt | 1 + examples/tm/6-placeholder/README.txt | 1 + examples/tm/6-placeholder/placeholder.tm.jsonld | 2 +- 7 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 examples/tm/1-basic/README.txt create mode 100644 examples/tm/2-tm-versioning/README.txt create mode 100644 examples/tm/3-tm-extends-imports/README.txt create mode 100644 examples/tm/4-tm-optional/README.txt create mode 100644 examples/tm/5-tm-submodel/README.txt create mode 100644 examples/tm/6-placeholder/README.txt diff --git a/examples/tm/1-basic/README.txt b/examples/tm/1-basic/README.txt new file mode 100644 index 00000000..c6971206 --- /dev/null +++ b/examples/tm/1-basic/README.txt @@ -0,0 +1 @@ +This folder contains simple examples of how a Thing Model is done. \ No newline at end of file diff --git a/examples/tm/2-tm-versioning/README.txt b/examples/tm/2-tm-versioning/README.txt new file mode 100644 index 00000000..47512e8b --- /dev/null +++ b/examples/tm/2-tm-versioning/README.txt @@ -0,0 +1 @@ +This folder contains examples of how to handle versioning on Thing Models. \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/README.txt b/examples/tm/3-tm-extends-imports/README.txt new file mode 100644 index 00000000..b69a6376 --- /dev/null +++ b/examples/tm/3-tm-extends-imports/README.txt @@ -0,0 +1 @@ +This folder contains examples of how to extend a Thing Model by using other Thing Models, whether by using the extend or the import mechanism. \ No newline at end of file diff --git a/examples/tm/4-tm-optional/README.txt b/examples/tm/4-tm-optional/README.txt new file mode 100644 index 00000000..bea25dca --- /dev/null +++ b/examples/tm/4-tm-optional/README.txt @@ -0,0 +1 @@ +This folder contains examples of how to implement optional interaction affordances as well as how to overwrite them. \ No newline at end of file diff --git a/examples/tm/5-tm-submodel/README.txt b/examples/tm/5-tm-submodel/README.txt new file mode 100644 index 00000000..e1df4a1e --- /dev/null +++ b/examples/tm/5-tm-submodel/README.txt @@ -0,0 +1 @@ +This folder contains examples of ways to provide information of Thing Models that consist of one or more (sub-)Thing Models. \ No newline at end of file diff --git a/examples/tm/6-placeholder/README.txt b/examples/tm/6-placeholder/README.txt new file mode 100644 index 00000000..11fe355f --- /dev/null +++ b/examples/tm/6-placeholder/README.txt @@ -0,0 +1 @@ +This folder contains examples of how to utilize placeholder labeling for Thing Models where the terms are known in advance but not the values. \ No newline at end of file diff --git a/examples/tm/6-placeholder/placeholder.tm.jsonld b/examples/tm/6-placeholder/placeholder.tm.jsonld index 582035a0..8c6409ae 100644 --- a/examples/tm/6-placeholder/placeholder.tm.jsonld +++ b/examples/tm/6-placeholder/placeholder.tm.jsonld @@ -4,7 +4,7 @@ "title": "thermostat No. {{THERMOSTAT_NUMBER}}", "$title": "Placeholder TM Example", "description": "A TM for a thermostat with placeholder labeling", - "$description": " In a case where TD instance terms, but not their values, are known in advance, the placeholder labeling may be used in a Thing Model. The string-based pattern of the placeholder must follow a valid pattern based on the regular expression {{2}[ -~]+}{2} (e.g., {{PLACEHOLDER_IDENTIFIER}}). The characters between {{ and }} are used as identifier name of the placeholder.", + "$description": "In a case where TD instance terms, but not their values, are known in advance, the placeholder labeling may be used in a Thing Model. The string-based pattern of the placeholder must follow a valid pattern based on the regular expression {{2}[ -~]+}{2} (e.g., {{PLACEHOLDER_IDENTIFIER}}). The characters between {{ and }} are used as identifier name of the placeholder.", "version": "{{VERSION_INFO}}", "base": "mqtt://{{MQTT_BROKER_ADDRESS}}", "properties": { From 721bd16cbca9db81ec7f6a865877fd82e3cb4b30 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:07:35 +0200 Subject: [PATCH 20/38] workflow test --- .github/workflows/ci-cd.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d6c08a8f..c7a3a70b 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -40,9 +40,6 @@ jobs: - name: Test run: lerna run test --no-bail --stream - - name: TD test - run: node packages/cli/index.js -i examples/td/*/* - - name: TM test run: node packages/cli/index.js -t TM -i examples/tm/*/* From af70b6d0f394ee279a3be9408ca1a302407f172f Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:22:18 +0200 Subject: [PATCH 21/38] . --- .github/workflows/ci-cd.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index c7a3a70b..d6c08a8f 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -40,6 +40,9 @@ jobs: - name: Test run: lerna run test --no-bail --stream + - name: TD test + run: node packages/cli/index.js -i examples/td/*/* + - name: TM test run: node packages/cli/index.js -t TM -i examples/tm/*/* From 24b0ccc9402fb4f0ea5b1497a74aaaf7798545af Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 31 Mar 2023 15:36:33 +0200 Subject: [PATCH 22/38] fixed multilanguage td --- .../multilanguage-title-description.td.jsonld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld index feb262b5..acec161b 100644 --- a/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld +++ b/examples/td/11-multilanguage/multilanguage-title-description.td.jsonld @@ -14,9 +14,9 @@ "zh-Hant": "我的東西" }, "$title": "Multilanguage Title and Description TD Example", - "description": "TD für ein generisches Ding in verschiedenen Sprachen.", + "description": "TD für ein generisches Ding in verschiedenen Sprachen", "descriptions": { - "en": "TD for a generic thing in various languages.", + "en": "TD for a generic thing in various languages", "de": "TD für ein generisches Ding in verschiedenen Sprachen", "ja": "様々な言語で汎用的なものを扱うTD", "zh-Hans": "TD 用于各种语言的通用事物", From 682368953058ec210e4a0a4e4175bf86a52d16c1 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 31 Mar 2023 18:42:30 +0200 Subject: [PATCH 23/38] new tm and td examples --- .../basic-td-from-tm.td.jsonld | 60 +++++++++++++++++ .../versioning-td-from-tm.td.jsonld | 64 +++++++++++++++++++ examples/tm/1-basic/basic-on-off-tm.tm.jsonld | 12 ++++ .../tm/2-tm-versioning/versioning.tm.jsonld | 1 + 4 files changed, 137 insertions(+) create mode 100644 examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/versioning-td-from-tm.td.jsonld create mode 100644 examples/tm/1-basic/basic-on-off-tm.tm.jsonld diff --git a/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld new file mode 100644 index 00000000..62227e8f --- /dev/null +++ b/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld @@ -0,0 +1,60 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Lamp Thing Model", + "$title": "Basic Thing Model Example", + "description": "TM for a lamp thing", + "$description": "This is an example of a basic Thing Model, which is use as a sort of template for creating a Thing Description instance of a Lamp TD", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-tm.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/versioning-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/versioning-td-from-tm.td.jsonld new file mode 100644 index 00000000..0848bfc9 --- /dev/null +++ b/examples/td/16-td-tm-relationships/versioning-td-from-tm.td.jsonld @@ -0,0 +1,64 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Lamp Thing Model", + "$title": "Versioning Thing Model Example", + "description": "TM for a lamp thing", + "$description": "When the Thing Model definitions change over time, this should be reflected in the version container. The term model is used with the version container in order to provide such versioning information.", + "version": { + "instance": "1.0.0", + "model": "1.0.0" + }, + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/2-tm-versioning/versioning.tm.jsonld", + "type": "application/tm+json" + } + ], + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/1-basic/basic-on-off-tm.tm.jsonld b/examples/tm/1-basic/basic-on-off-tm.tm.jsonld new file mode 100644 index 00000000..0c87fd7c --- /dev/null +++ b/examples/tm/1-basic/basic-on-off-tm.tm.jsonld @@ -0,0 +1,12 @@ +{ + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "@type": "tm:ThingModel", + "title": "Basic On/Off Thing Model", + "$title": "Basic Thing Model Example for an On and Off Thing Description", + "$description": "This is an Examples of a simple Thing Model which is utilized to extend onto another Thing Model", + "properties": { + "onOff": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/examples/tm/2-tm-versioning/versioning.tm.jsonld b/examples/tm/2-tm-versioning/versioning.tm.jsonld index f4eb934b..c5805b19 100644 --- a/examples/tm/2-tm-versioning/versioning.tm.jsonld +++ b/examples/tm/2-tm-versioning/versioning.tm.jsonld @@ -5,6 +5,7 @@ "$title": "Versioning Thing Model Example", "description": "TM for a lamp thing", "$description": "When the Thing Model definitions change over time, this should be reflected in the version container. The term model is used with the version container in order to provide such versioning information.", + "version" : {"model": "1.0.0"}, "properties": { "status": { "description": "current status of the lamp (on|off)", From c43e65f9ac68be9a2065475a9445817e82ee6ddd Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:03:36 +0200 Subject: [PATCH 24/38] new examples --- .../extends-basic-td-from-tm.td.jsonld | 63 +++++++++++++++++++ .../extends-basic.tm.jsonld | 2 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld diff --git a/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld new file mode 100644 index 00000000..b4356435 --- /dev/null +++ b/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld @@ -0,0 +1,63 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Smart Lamp Control with Dimming", + "$title": "Extend Thing Model Example", + "description": "TM for controlling a Lamp thing with dimming fuctions", + "$description": "A Thing Model can extend an existing Thing Model by using the tm:extends mechanism. When a Thing Model extends another Thing Model, at least one links entry with 'rel: tm:extends' that targets a Thing Model that is be extended must be used", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "onOff": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/dim"}] + }, + "dim" : { + "title": "Dimming level", + "description": "Dimms the lamp between the values: 0 and 100", + "type": "integer", + "minimum": 0, + "maximum": 100, + "forms": [{"href": "https://mylamp.example.com/dim"}] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld b/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld index 57beaf6c..514bec96 100644 --- a/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld @@ -7,7 +7,7 @@ "$description": "A Thing Model can extend an existing Thing Model by using the tm:extends mechanism. When a Thing Model extends another Thing Model, at least one links entry with 'rel: tm:extends' that targets a Thing Model that is be extended must be used", "links" : [{ "rel": "tm:extends", - "href": "http://example.com/BasicOnOffTM", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-on-off-tm.tm.jsonld", "type": "application/tm+json" }], "properties" : { From 913ad19c252dca1a841d7951135bd47dab78b1ab Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:17:55 +0200 Subject: [PATCH 25/38] new changes --- .../extends-basic-td-from-tm.td.jsonld | 8 +-- .../import-definition-td-from-tm.td.jsonld | 55 +++++++++++++++++++ .../import-existing-definition.tm.jsonld | 12 ++-- 3 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld diff --git a/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld index b4356435..f9ef36fe 100644 --- a/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/extends-basic-td-from-tm.td.jsonld @@ -23,10 +23,6 @@ } ], "properties": { - "onOff": { - "type": "boolean", - "forms": [{"href": "https://mylamp.example.com/dim"}] - }, "dim" : { "title": "Dimming level", "description": "Dimms the lamp between the values: 0 and 100", @@ -34,6 +30,10 @@ "minimum": 0, "maximum": 100, "forms": [{"href": "https://mylamp.example.com/dim"}] + }, + "onOff": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/onOff"}] } }, "actions": { diff --git a/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld new file mode 100644 index 00000000..edc38833 --- /dev/null +++ b/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld @@ -0,0 +1,55 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Smart Lamp Control", + "$title": "Import Existing Definitions TM Example", + "description": "TM for a lamp thing controller", + "$description": "For importing pieces of definitions of one or more existing Thiing Models, the 'tm:ref' term is utilized which provides the location of an existing (sub-)definition that should be reused. This example shows a TM definition that imports the existing definition of the property onOff from another TM into the new property definition switch.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "switch": { + "type": "boolean", + "forms": [{"href": "https://mylamp.example.com/onOff"}] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld index d7fae8de..8e1ed0b5 100644 --- a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld @@ -7,13 +7,13 @@ "$description": "For importing pieces of definitions of one or more existing Thiing Models, the 'tm:ref' term is utilized which provides the location of an existing (sub-)definition that should be reused. This example shows a TM definition that imports the existing definition of the property onOff from another TM into the new property definition switch.", "properties" : { "switch" : { - "tm:ref": "http://example.com/BasicOnOffTM.tm.jsonld#/properties/onOff" + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-on-off-tm.tm.jsonld" + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off" } - }, - "actions": { - "toggle": { - "description": "Turn the lamp on or off" - } }, "events": { "overheating": { From 9ec21ce09ffce231627c61d6e6d27d8213e2e555 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 13:35:15 +0200 Subject: [PATCH 26/38] fixed tms --- .../import-definition-td-from-tm.td.jsonld | 30 +++++++++++++++---- .../extend-and-import.tm.jsonld | 10 +++---- .../overwrite-existing-definitions.tm.jsonld | 4 +-- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld index edc38833..fedb54b5 100644 --- a/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/import-definition-td-from-tm.td.jsonld @@ -25,7 +25,16 @@ "properties": { "switch": { "type": "boolean", - "forms": [{"href": "https://mylamp.example.com/onOff"}] + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/onOff", + "op": "readproperty", + "contentType": "application/json" + } + ], + "observable": false, + "writeOnly": false } }, "actions": { @@ -33,21 +42,32 @@ "description": "Turn the lamp on or off", "forms": [ { - "href": "https://mylamp.example.com/toggle" + "href": "https://mylamp.example.com/toggle", + "op": "invokeaction", + "contentType": "application/json" } - ] + ], + "safe": false, + "idempotent": false } }, "events": { "overheating": { "description": "Lamp reaches a critical temperature (overheating)", "data": { - "type": "string" + "type": "string", + "readOnly": false, + "writeOnly": false }, "forms": [ { "href": "https://mylamp.example.com/oh", - "subprotocol": "longpoll" + "subprotocol": "longpoll", + "op": [ + "subscribeevent", + "unsubscribeevent" + ], + "contentType": "application/json" } ] } diff --git a/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld b/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld index 1b9e5b14..7fb6e4fc 100644 --- a/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld @@ -6,16 +6,16 @@ "description": "TM for a lamp thing controller", "$description": "The tm:extends and the import mechanism based on tm:ref can also be used at the same time in a TM definition. This example extends the a basic TM with an On/Off property and imports the status and dim definitions from pther TMs respectively.", "links" : [{ - "rel": "extends", - "href": "http://example.com/BasicOnOffTM", + "rel": "tm:extends", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-on-off-tm.tm.jsonld", "type": "application/tm+json" - }], + }], "properties" : { "status" : { - "tm:ref": "http://example.com/LampTM.tm.jsonld#/properties/status" + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-tm.tm.jsonld#/properties/status" }, "dimming" : { - "tm:ref": "http://example.com/LampWithDimmingTM.tm.jsonld#/properties/dim" + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld#/properties/dim" } } } \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld index 6b3e4e16..6d3fc18b 100644 --- a/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld @@ -7,8 +7,8 @@ "$description": "At the place the 'tm:ref' is defined, additional name-value pairs can be added. It is also permitted to override name-value pairs from the referenced definition. If the intention is to override an existing JSON name-value pair definition from tm:ref, the same JSON name MUST be used at the same level of the tm:ref declaration that provides a new value. This example shows a new TM definition that overwrites (maximum), enhances (unit), and removes (title) existing definitions", "properties" : { "dimming" : { - "tm:ref": "http://example.com/SmartLampControlwithDimming.tm.jsonld#/properties/dim", - "title": null, + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld", + "title": "", "maximum": 80, "unit": "%" } From 250b479d726b0d51e266c8a04735324bcb6aa1b0 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 14:02:49 +0200 Subject: [PATCH 27/38] new tds from tms --- .../extend-and-import-td-from-tm.td.jsonld | 81 +++++++++++++++++++ ...overwrite-definitions-td-from-tm.td.jsonld | 64 +++++++++++++++ .../relative-imports-td-from-tm.td.jsonld | 80 ++++++++++++++++++ .../import-existing-definition.tm.jsonld | 2 +- .../overwrite-existing-definitions.tm.jsonld | 2 +- 5 files changed, 227 insertions(+), 2 deletions(-) create mode 100644 examples/td/16-td-tm-relationships/extend-and-import-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/overwrite-definitions-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld diff --git a/examples/td/16-td-tm-relationships/extend-and-import-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/extend-and-import-td-from-tm.td.jsonld new file mode 100644 index 00000000..cb5011be --- /dev/null +++ b/examples/td/16-td-tm-relationships/extend-and-import-td-from-tm.td.jsonld @@ -0,0 +1,81 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Smart Lamp Control", + "$title": "Smart Lamp Control TM with Extend and Import", + "description": "TM for a lamp thing controller", + "$description": "The tm:extends and the import mechanism based on tm:ref can also be used at the same time in a TM definition. This example extends the a basic TM with an On/Off property and imports the status and dim definitions from pther TMs respectively.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extend-and-import.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "onOff": { + "type": "boolean", + "forms": [ + { + "href": "https://mylamp.example.com/onOff" + } + ] + }, + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + }, + "dimming": { + "title": "Dimming level", + "description": "Dimms the lamp between the values: 0 and 100", + "type": "integer", + "minimum": 0, + "maximum": 100, + "forms": [ + { + "href": "https://mylamp.example.com/dim" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/overwrite-definitions-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/overwrite-definitions-td-from-tm.td.jsonld new file mode 100644 index 00000000..f58b6afe --- /dev/null +++ b/examples/td/16-td-tm-relationships/overwrite-definitions-td-from-tm.td.jsonld @@ -0,0 +1,64 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Smart Lamp Control", + "$title": "Overwrite Existing Definitions TM Example", + "description": "TM for a lamp thing controller", + "$description": "At the place the 'tm:ref' is defined, additional name-value pairs can be added. It is also permitted to override name-value pairs from the referenced definition. If the intention is to override an existing JSON name-value pair definition from tm:ref, the same JSON name MUST be used at the same level of the tm:ref declaration that provides a new value. This example shows a new TM definition that overwrites (maximum), enhances (unit), and removes (title) existing definitions", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "dimming": { + "title": "", + "description": "Dimms the lamp between the values: 0 and 100", + "type": "integer", + "minimum": 0, + "maximum": 80, + "unit": "%", + "forms": [ + { + "href": "https://mylamp.example.com/dimming" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh", + "subprotocol": "longpoll" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld new file mode 100644 index 00000000..191bdc48 --- /dev/null +++ b/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld @@ -0,0 +1,80 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Multi Sensor", + "$title": "Relative Imports TM Example", + "description": "TM for a multisensor thing", + "$description": "This Thing Model example re-uses and augments a 'genericTemperature' property in two more specific properties, which describe an inner and an outer temperature value, respectively.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/relative-imports.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "genericTemperature": { + "type": "number", + "unit": "C", + "forms": [ + { + "href": "https://multisensor.example.com/dim" + } + ] + }, + "innerTemperature": { + "tm:ref": "#/properties/genericTemperature", + "title": "The inner temperature", + "minimum": 10, + "forms": [ + { + "href": "https://multisensor.example.com/dim" + } + ] + }, + "outerTemperature": { + "tm:ref": "#/properties/genericTemperature", + "title": "The outer temperature", + "description": "The outer temperature is measured in Kelvin", + "unit": "K", + "forms": [ + { + "href": "https://multisensor.example.com/dim" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the sensor on or off", + "forms": [ + { + "href": "https://multisensor.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "The sensor reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://multisensor.example.com/toggle" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld index 8e1ed0b5..2821cd36 100644 --- a/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/import-existing-definition.tm.jsonld @@ -7,7 +7,7 @@ "$description": "For importing pieces of definitions of one or more existing Thiing Models, the 'tm:ref' term is utilized which provides the location of an existing (sub-)definition that should be reused. This example shows a TM definition that imports the existing definition of the property onOff from another TM into the new property definition switch.", "properties" : { "switch" : { - "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-on-off-tm.tm.jsonld" + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/1-basic/basic-on-off-tm.tm.jsonld#/properties/onOff" } }, "actions": { diff --git a/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld index 6d3fc18b..4e34d9d8 100644 --- a/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld +++ b/examples/tm/3-tm-extends-imports/overwrite-existing-definitions.tm.jsonld @@ -7,7 +7,7 @@ "$description": "At the place the 'tm:ref' is defined, additional name-value pairs can be added. It is also permitted to override name-value pairs from the referenced definition. If the intention is to override an existing JSON name-value pair definition from tm:ref, the same JSON name MUST be used at the same level of the tm:ref declaration that provides a new value. This example shows a new TM definition that overwrites (maximum), enhances (unit), and removes (title) existing definitions", "properties" : { "dimming" : { - "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld", + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/3-tm-extends-imports/extends-basic.tm.jsonld#/properties/dim", "title": "", "maximum": 80, "unit": "%" From c3d0651b3f898fe270a2f91d69b2a0765bc3a2c7 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 14:15:25 +0200 Subject: [PATCH 28/38] new td, updated tms --- .../optional-interaction-td-from-tm.td.jsonld | 50 +++++++++++++++++++ .../overwrite-optional-interactions.tm.jsonld | 4 +- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 examples/td/16-td-tm-relationships/optional-interaction-td-from-tm.td.jsonld diff --git a/examples/td/16-td-tm-relationships/optional-interaction-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/optional-interaction-td-from-tm.td.jsonld new file mode 100644 index 00000000..257dcce0 --- /dev/null +++ b/examples/td/16-td-tm-relationships/optional-interaction-td-from-tm.td.jsonld @@ -0,0 +1,50 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Lamp Thing Model", + "$title": "Optinal Interaction Affordances Example", + "description": "TM for a lamp thing", + "$description": "In some cases it is desirable to not enforce which interaction affordances are mandatory and do not necessarily need to be implemented in a Thing Description instance. If interaction models are not mandatory to be implemented in a Thing Description instance, Thing Model definitions MUST use the JSON member name tm:optional.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/4-tm-optional/optional-interaction.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + + } +} \ No newline at end of file diff --git a/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld b/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld index 57a58886..56dab821 100644 --- a/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld +++ b/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld @@ -8,13 +8,13 @@ "links": [ { "rel": "tm:extends", - "href": "./lampThingModel.tm.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/4-tm-optional/optional-interaction.tm.jsonld", "type": "application/tm+json" } ], "events": { "overheating": { - "tm:ref": "./lampThingModel.tm.jsonld#/events/overheating" + "tm:ref": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/4-tm-optional/optional-interaction.tm.jsonld#/events/overheating" } } } \ No newline at end of file From 2d8b2035b79534b55317345d452fce1cf8a961d5 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:02:35 +0200 Subject: [PATCH 29/38] new tds and tm examples --- .../overwrite-optional-td-from-tm.td.jsonld | 60 +++++++++++++++++ .../placeholder-td-from-tm.td.jsonld | 67 +++++++++++++++++++ examples/tm/1-basic/basic-on-off-tm.tm.jsonld | 2 +- .../tm/5-tm-submodel/basic-led-tm.tm.jsonld | 41 ++++++++++++ .../basic-ventilation-tm.tm.jsonld | 22 ++++++ 5 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 examples/td/16-td-tm-relationships/overwrite-optional-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/placeholder-td-from-tm.td.jsonld create mode 100644 examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld create mode 100644 examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld diff --git a/examples/td/16-td-tm-relationships/overwrite-optional-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/overwrite-optional-td-from-tm.td.jsonld new file mode 100644 index 00000000..f9ad8220 --- /dev/null +++ b/examples/td/16-td-tm-relationships/overwrite-optional-td-from-tm.td.jsonld @@ -0,0 +1,60 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "Lamp Thing Model (All Mandatory)", + "$title": "Overwriting Optinal Interaction Affordances Example", + "description": "Lamp Thing Model description wich expects all interaction affordances (status, toggle, and overheating)", + "$description": "An optional definition in a Thing Model definition can be overwritten in the case it is extended by another Thing Model through the use of tm:ref. This examples overwrites the 'tm:optional' of another TM with an optional 'overheating' event", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/4-tm-optional/overwrite-optional-interactions.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "status": { + "description": "current status of the lamp (on|off)", + "type": "string", + "readOnly": true, + "forms": [ + { + "href": "https://mylamp.example.com/status" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the lamp on or off", + "forms": [ + { + "href": "https://mylamp.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "Lamp reaches a critical temperature (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://mylamp.example.com/oh" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/placeholder-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/placeholder-td-from-tm.td.jsonld new file mode 100644 index 00000000..145b16c8 --- /dev/null +++ b/examples/td/16-td-tm-relationships/placeholder-td-from-tm.td.jsonld @@ -0,0 +1,67 @@ +{ + "@context": [ + "https://www.w3.org/2022/wot/td/v1.1" + ], + "@type": "Thing", + "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", + "title": "thermostat No. 4", + "$title": "Placeholder TM Example", + "description": "A TM for a thermostat with placeholder labeling", + "$description": "In a case where TD instance terms, but not their values, are known in advance, the placeholder labeling may be used in a Thing Model. The string-based pattern of the placeholder must follow a valid pattern based on the regular expression {{2}[ -~]+}{2} (e.g., {{PLACEHOLDER_IDENTIFIER}}). The characters between {{ and }} are used as identifier name of the placeholder.", + "version": { + "instance": "1.0.1", + "model": "2.0.0" + }, + "base": "mqtt://192.168.178.72:1883", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/6-placeholder/placeholder.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "temperature": { + "description": "Shows the current temperature value", + "type": "number", + "minimum": -20.0, + "maximum": 47.7, + "observable": true, + "forms": [ + { + "href": "https://thermostat.example.com/temperature" + } + ] + } + }, + "actions": { + "toggle": { + "description": "Turn the thermostat on or off", + "forms": [ + { + "href": "https://thermostat.example.com/toggle" + } + ] + } + }, + "events": { + "overheating": { + "description": "critical temperature reached (overheating)", + "data": { + "type": "string" + }, + "forms": [ + { + "href": "https://thermostat.example.com/oh" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/1-basic/basic-on-off-tm.tm.jsonld b/examples/tm/1-basic/basic-on-off-tm.tm.jsonld index 0c87fd7c..b05aabe7 100644 --- a/examples/tm/1-basic/basic-on-off-tm.tm.jsonld +++ b/examples/tm/1-basic/basic-on-off-tm.tm.jsonld @@ -3,7 +3,7 @@ "@type": "tm:ThingModel", "title": "Basic On/Off Thing Model", "$title": "Basic Thing Model Example for an On and Off Thing Description", - "$description": "This is an Examples of a simple Thing Model which is utilized to extend onto another Thing Model", + "$description": "This is an example of a simple Thing Model which is utilized to extend onto another Thing Model", "properties": { "onOff": { "type": "boolean" diff --git a/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld b/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld new file mode 100644 index 00000000..da123fc2 --- /dev/null +++ b/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld @@ -0,0 +1,41 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "@type": "tm:ThingModel", + "title": "LED Thing Model", + "$title": "Basic LED Thing Model Example", + "description": "Thing Model for a simple LED Thing", + "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "version": { + "model": "1.0.0" + }, + "properties": { + "R": { + "type": "number", + "description": "Red color" + }, + "G": { + "type": "number", + "description": "Green color" + }, + "B": { + "type": "number", + "description": "Blue color" + } + }, + "actions": { + "fadeIn": { + "title": "fadeIn", + "input": { + "type": "number", + "description": "fadeIn in ms" + } + }, + "fadeOut": { + "title": "fadeIn", + "input": { + "type": "number", + "description": "fadeOut in ms" + } + } + } +} \ No newline at end of file diff --git a/examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld b/examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld new file mode 100644 index 00000000..4fac4e27 --- /dev/null +++ b/examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld @@ -0,0 +1,22 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "@type": "tm:ThingModel", + "title": "Ventilator Thing Model", + "$title": "Basic Ventilator Thing Model Example", + "description": "Thing Model for a simple Ventilator Thing", + "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "version": { + "model": "1.0.0" + }, + "properties": { + "switch": { + "type": "boolean", + "description": "True=On; False=Off" + }, + "adjustRpm": { + "type": "number", + "minimum": 200, + "maximum": 1200 + } + } +} \ No newline at end of file From ab46d4529c88697a0ca4708b924e1ce5a0866b52 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:15:04 +0200 Subject: [PATCH 30/38] new tms and tds --- ...composition-top-level-td-from-tm.td.jsonld | 46 +++++++++++ .../submodel-led-td-from-tm.td.jsonld | 81 +++++++++++++++++++ .../submodel-ventilator-td-from-tm.td.jsonld | 47 +++++++++++ examples/tm/5-tm-submodel/submodel.tm.jsonld | 4 +- 4 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld create mode 100644 examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld diff --git a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld new file mode 100644 index 00000000..26b86fa3 --- /dev/null +++ b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld @@ -0,0 +1,46 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "Smart Ventilator Thing Model", + "$title": "Top level/parent Thing Model Example", + "description": "Top level/parent Smart Ventilator Thing Model ", + "$description": "If it is desired to provide information that a Thing Model consists of one or more (sub-)TMs, the links entries must use the 'rel': 'tm:submodel' that targets to the (sub-)TM. Optionally an instanceName may be provided to associate an individual name to the composed (sub-)TM. This is useful when multiple similar Thing Model definitions are composed and needs to be distinguished.", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "item", + "href": "./Ventilation.td.jsonld", + "type": "application/td+json" + }, + { + "rel": "item", + "href": "./LED.td.jsonld", + "type": "application/td+json" + }, + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/5-tm-submodel/submodel.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "on_value", + "off_value", + "error_value" + ], + "forms": [ + { + "href": "http://smartventilator.example.com/status" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld new file mode 100644 index 00000000..5598b69e --- /dev/null +++ b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld @@ -0,0 +1,81 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "LED Thing Model", + "$title": "Basic LED Thing Model Example", + "description": "Thing Model for a simple LED Thing", + "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "collection", + "href": "./SmartVentilation.td.jsonld", + "type": "application/td+json" + }, + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "R": { + "type": "number", + "description": "Red color", + "forms": [ + { + "href": "http://led.example.com/R" + } + ] + }, + "G": { + "type": "number", + "description": "Green color", + "forms": [ + { + "href": "http://led.example.com/G" + } + ] + }, + "B": { + "type": "number", + "description": "Blue color", + "forms": [ + { + "href": "http://led.example.com/B" + } + ] + } + }, + "actions": { + "fadeIn": { + "title": "fadeIn", + "input": { + "type": "number", + "description": "fadeIn in ms" + }, + "forms": [ + { + "href": "http://led.example.com/fadeIn" + } + ] + }, + "fadeOut": { + "title": "fadeOut", + "input": { + "type": "number", + "description": "fadeOut in ms" + }, + "forms": [ + { + "href": "http://led.example.com/fadeOut" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld new file mode 100644 index 00000000..9472e13b --- /dev/null +++ b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld @@ -0,0 +1,47 @@ +{ + "@context": "https://www.w3.org/2022/wot/td/v1.1", + "title": "Ventilator Thing Model", + "$title": "Basic Ventilator Thing Model Example", + "description": "Thing Model for a simple Ventilator Thing", + "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "securityDefinitions": { + "basic_sc": { + "scheme": "basic", + "in": "header" + } + }, + "security": "basic_sc", + "links": [ + { + "rel": "collection", + "href": "./SmartVentilation.td.jsonld", + "type": "application/td+json" + }, + { + "rel": "type", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld", + "type": "application/tm+json" + } + ], + "properties": { + "switch": { + "type": "boolean", + "description": "True=On; False=Off", + "forms": [ + { + "href": "http://ventilator.example.com/switch" + } + ] + }, + "adjustRpm": { + "type": "number", + "minimum": 200, + "maximum": 1200, + "forms": [ + { + "href": "http://ventilator.example.com/adjustRpm" + } + ] + } + } +} \ No newline at end of file diff --git a/examples/tm/5-tm-submodel/submodel.tm.jsonld b/examples/tm/5-tm-submodel/submodel.tm.jsonld index c03311a5..aace82dd 100644 --- a/examples/tm/5-tm-submodel/submodel.tm.jsonld +++ b/examples/tm/5-tm-submodel/submodel.tm.jsonld @@ -9,13 +9,13 @@ "links": [ { "rel": "tm:submodel", - "href": "./Ventilation.tm.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/5-tm-submodel/basic-ventilation-tm.tm.jsonld", "type": "application/tm+json", "instanceName": "ventilation" }, { "rel": "tm:submodel", - "href": "./LED.tm.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld", "type": "application/tm+json", "instanceName": "led" } From 9ba33199433e681a73810c21c2523d12d27f09d8 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:17:19 +0200 Subject: [PATCH 31/38] td from tms fixes --- .../composition-top-level-td-from-tm.td.jsonld | 4 ++-- .../16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld | 2 +- .../submodel-ventilator-td-from-tm.td.jsonld | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld index 26b86fa3..e886589e 100644 --- a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld @@ -14,12 +14,12 @@ "links": [ { "rel": "item", - "href": "./Ventilation.td.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld", "type": "application/td+json" }, { "rel": "item", - "href": "./LED.td.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld", "type": "application/td+json" }, { diff --git a/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld index 5598b69e..0fa840d7 100644 --- a/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld @@ -14,7 +14,7 @@ "links": [ { "rel": "collection", - "href": "./SmartVentilation.td.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld", "type": "application/td+json" }, { diff --git a/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld index 9472e13b..c4784798 100644 --- a/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld @@ -14,7 +14,7 @@ "links": [ { "rel": "collection", - "href": "./SmartVentilation.td.jsonld", + "href": "https://raw.githubusercontent.com/thingweb/thingweb-playground/UI-fixes/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld", "type": "application/td+json" }, { From 8a32a744695bb2deb1d46b996b625c41ff863a96 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:20:44 +0200 Subject: [PATCH 32/38] new changes to tm --- .../composition-top-level-td-from-tm.td.jsonld | 6 ++++++ examples/tm/5-tm-submodel/submodel.tm.jsonld | 11 ----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld index e886589e..2c270b75 100644 --- a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld @@ -42,5 +42,11 @@ } ] } + }, + "actions": { + + }, + "events": { + } } \ No newline at end of file diff --git a/examples/tm/5-tm-submodel/submodel.tm.jsonld b/examples/tm/5-tm-submodel/submodel.tm.jsonld index aace82dd..df2a1122 100644 --- a/examples/tm/5-tm-submodel/submodel.tm.jsonld +++ b/examples/tm/5-tm-submodel/submodel.tm.jsonld @@ -22,16 +22,5 @@ ], "properties" : { "status" : {"type": "string", "enum": ["on_value", "off_value", "error_value"]} - }, - "actions": { - "toggle": { - "description": "Turn the ventilator on or off" - } - }, - "events": { - "overheating": { - "description": "Ventilator reaches a critical temperature (overheating)", - "data": {"type": "string"} - } } } \ No newline at end of file From c99e4761791de4f8f14cc739e3b50f9a88493efd Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 15:30:13 +0200 Subject: [PATCH 33/38] new fixes --- .../16-td-tm-relationships/basic-td-from-tm.td.jsonld | 1 + .../composition-top-level-td-from-tm.td.jsonld | 10 ++++------ .../submodel-led-td-from-tm.td.jsonld | 4 ++++ .../submodel-ventilator-td-from-tm.td.jsonld | 4 ++++ examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld index 62227e8f..a74f24bd 100644 --- a/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/basic-td-from-tm.td.jsonld @@ -2,6 +2,7 @@ "@context": [ "https://www.w3.org/2022/wot/td/v1.1" ], + "@type": "Thing", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "Lamp Thing Model", "$title": "Basic Thing Model Example", diff --git a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld index 2c270b75..758385e7 100644 --- a/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/composition-top-level-td-from-tm.td.jsonld @@ -4,6 +4,10 @@ "$title": "Top level/parent Thing Model Example", "description": "Top level/parent Smart Ventilator Thing Model ", "$description": "If it is desired to provide information that a Thing Model consists of one or more (sub-)TMs, the links entries must use the 'rel': 'tm:submodel' that targets to the (sub-)TM. Optionally an instanceName may be provided to associate an individual name to the composed (sub-)TM. This is useful when multiple similar Thing Model definitions are composed and needs to be distinguished.", + "version": { + "instance": "1.0.0", + "model": "1.0.0" + }, "securityDefinitions": { "basic_sc": { "scheme": "basic", @@ -42,11 +46,5 @@ } ] } - }, - "actions": { - - }, - "events": { - } } \ No newline at end of file diff --git a/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld index 0fa840d7..551ac095 100644 --- a/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/submodel-led-td-from-tm.td.jsonld @@ -4,6 +4,10 @@ "$title": "Basic LED Thing Model Example", "description": "Thing Model for a simple LED Thing", "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "version": { + "instance": "1.0.0", + "model": "1.0.0" + }, "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld index c4784798..f514df20 100644 --- a/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/submodel-ventilator-td-from-tm.td.jsonld @@ -4,6 +4,10 @@ "$title": "Basic Ventilator Thing Model Example", "description": "Thing Model for a simple Ventilator Thing", "$description": "This is an example of a simple Thing Model which is utilized as a submodel of another Thing Model", + "version": { + "instance": "1.0.0", + "model": "1.0.0" + }, "securityDefinitions": { "basic_sc": { "scheme": "basic", diff --git a/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld b/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld index da123fc2..dd2ed2a8 100644 --- a/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld +++ b/examples/tm/5-tm-submodel/basic-led-tm.tm.jsonld @@ -31,7 +31,7 @@ } }, "fadeOut": { - "title": "fadeIn", + "title": "fadeOut", "input": { "type": "number", "description": "fadeOut in ms" From 24cb0be54adb11f896fdab2f164d873ad459b042 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:31:23 +0200 Subject: [PATCH 34/38] final fixes --- .../relative-imports-td-from-tm.td.jsonld | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld b/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld index 191bdc48..ed3e92b2 100644 --- a/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld +++ b/examples/td/16-td-tm-relationships/relative-imports-td-from-tm.td.jsonld @@ -1,7 +1,5 @@ { - "@context": [ - "https://www.w3.org/2022/wot/td/v1.1" - ], + "@context": "https://www.w3.org/2022/wot/td/v1.1", "@type": "Thing", "id": "urn:uuid:0804d572-cce8-422a-bb7c-4412fcd56f06", "title": "Multi Sensor", From 4359e4d8fba05f1b30a8bdda212a3dcfb036a107 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:36:20 +0200 Subject: [PATCH 35/38] no td test trial --- .github/workflows/ci-cd.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d6c08a8f..b26260ae 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -39,9 +39,6 @@ jobs: - name: Test run: lerna run test --no-bail --stream - - - name: TD test - run: node packages/cli/index.js -i examples/td/*/* - name: TM test run: node packages/cli/index.js -t TM -i examples/tm/*/* From 4916d892260add66980ca578455bacd18881be98 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:40:44 +0200 Subject: [PATCH 36/38] . --- .github/workflows/ci-cd.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index b26260ae..d6c08a8f 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -39,6 +39,9 @@ jobs: - name: Test run: lerna run test --no-bail --stream + + - name: TD test + run: node packages/cli/index.js -i examples/td/*/* - name: TM test run: node packages/cli/index.js -t TM -i examples/tm/*/* From 4cc11222a003c486650626d7ee15e601c9bf1081 Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:26:35 +0200 Subject: [PATCH 37/38] reverted the readFile --- packages/core/examples/scripts/readFile.js | 71 +++++----------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/packages/core/examples/scripts/readFile.js b/packages/core/examples/scripts/readFile.js index eec43c31..2a7fe384 100644 --- a/packages/core/examples/scripts/readFile.js +++ b/packages/core/examples/scripts/readFile.js @@ -1,58 +1,17 @@ // Test utility to test index.js const tdValidator = require("../../index").tdValidator -const fs = require('fs') - -// Function to get current filenames in directory - -const fileNames = fs.readdirSync("../../../../examples/td/1-simple-default/") - -fileNames.forEach(file => { - const data = fs.readFileSync("../../../../examples/td/1-simple-default/"+file) - const TD = data.toString() - tdValidator(TD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) - .then( result => { - console.log("File: ", file) - console.log("OKAY") - console.log(result) - console.log("________________") - }, err => { - console.log("ERROR") - console.error(err) - }) -}) - - - - - - - - - - - - - - - - -// // Test utility to test index.js -// const tdValidator = require("../../index").tdValidator -// const fs = require("fs") -// const commander = require('commander') - -// const data = fs.readFileSync("../../../../examples/td/1-simple-default/basic-td.td.jsonld") -// const simpleTD = data.toString() - -// /* -// * No logging and no additional checks -// */ - -// tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) -// .then( result => { -// console.log("OKAY") -// console.log(result) -// }, err => { -// console.log("ERROR") -// console.error(err) -// }) \ No newline at end of file +const fs = require("fs") + +const simpleTD = fs.readFileSync("../tds/valid/simple.json") + +/** + * No logging and no additional checks + */ +tdValidator(simpleTD, ()=>{}, {checkDefaults: false, checkJsonLd: false}) +.then( result => { + console.log("OKAY") + console.log(result) +}, err => { + console.log("ERROR") + console.error(err) +}) \ No newline at end of file From 1f8264b6060c7086cf376831c239b085dc81d94b Mon Sep 17 00:00:00 2001 From: Sergio Eduardo Castro Ceballos <72516762+SergioCasCeb@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:37:10 +0200 Subject: [PATCH 38/38] ci pipeline test --- .github/workflows/ci-cd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d6c08a8f..93c66aa1 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -41,10 +41,10 @@ jobs: run: lerna run test --no-bail --stream - name: TD test - run: node packages/cli/index.js -i examples/td/*/* + run: node packages/cli/index.js -i examples/td/*/*.jsonld - name: TM test - run: node packages/cli/index.js -t TM -i examples/tm/*/* + run: node packages/cli/index.js -t TM -i examples/tm/*/*.jsonld deploy-via-ssh: