From b075a81bcdfef34a2316ccc9509fe557140d9ce8 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 18:03:23 +0100 Subject: [PATCH 1/9] Combine properties into a single things property --- directory.td.json | 136 ++++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 64 deletions(-) diff --git a/directory.td.json b/directory.td.json index 657a02d1..7aec1141 100644 --- a/directory.td.json +++ b/directory.td.json @@ -199,53 +199,45 @@ } }, "properties": { - "retrieveTD": { - "description": "Retrieve a Thing Description", + "things": { + "@type": "ThingListProperty", + "description": "Collection of Thing Descriptions in the directory", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" - } - }, - "forms": [ - { - "href": "/td/{id}", - "htv:methodName": "GET", - "response": { - "description": "Success response", - "htv:statusCodeValue": 200, - "contentType": "application/td+json" - }, - "additionalResponses": [ - { - "description": "TD with the given id not found", - "contentType": "application/problem+json", - "htv:statusCodeValue": 404 - } - ], - "scopes": "read" - } - ] - }, - "retrieveTDs": { - "description": "Retrieve all Thing Descriptions", - "uriVariables": { + }, + "jsonpath": { + "@type": "JSONPathExpression", + "title": "A valid JSONPath expression", + "type": "string" + }, + "xpath": { + "@type": "XPathExpression", + "title": "A valid XPath expression", + "type": "string" + }, "offset": { + "@type": "PageOffset", "title": "Number of TDs to skip before the page", "type": "number", "default": 0 }, "limit": { + "@type": "PageLimit", "title": "Number of TDs in a page", "type": "number" }, "sort_by": { + "@type": "SortAttribute", "title": "Comparator TD attribute for collection sorting", "type": "string", "default": "id" }, "sort_order": { + "@type": "SortOrder", "title": "Sorting order", "type": "string", "enum": ["asc", "desc"], @@ -254,17 +246,17 @@ }, "forms": [ { - "href": "/td", + "href": "/things", "htv:methodName": "GET", "response": { "description": "Success response", "htv:statusCodeValue": 200, - "contentType": "application/ld+json" + "contentType": "application/td+json" }, "scopes": "readAll" }, { - "href": "/td{?offset,limit,sort_by,sort_order}", + "href": "/things{?offset,limit,sort_by,sort_order}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -284,20 +276,26 @@ } ], "scopes": "readAll" - } - ] - }, - "searchJSONPath": { - "description": "JSONPath syntactic search", - "uriVariables": { - "query": { - "title": "A valid JSONPath expression", - "type": "string" - } - }, - "forms": [ + }, + { + "href": "/things/{id}", + "htv:methodName": "GET", + "response": { + "description": "Success response", + "htv:statusCodeValue": 200, + "contentType": "application/td+json" + }, + "additionalResponses": [ + { + "description": "TD with the given id not found", + "contentType": "application/problem+json", + "htv:statusCodeValue": 404 + } + ], + "scopes": "read" + }, { - "href": "/search/jsonpath?query={query}", + "href": "/things?jsonpath={jsonpath}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -312,20 +310,9 @@ } ], "scopes": "search" - } - ] - }, - "searchXPath": { - "description": "XPath syntactic search", - "uriVariables": { - "query": { - "title": "A valid XPath expression", - "type": "string" - } - }, - "forms": [ + }, { - "href": "/search/xpath?query={query}", + "href": "/things?xpath={xpath}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -334,7 +321,7 @@ }, "additionalResponses": [ { - "description": "JSONPath expression not provided or contains syntax errors", + "description": "XPath expression not provided or contains syntax errors", "contentType": "application/problem+json", "htv:statusCodeValue": 400 } @@ -343,17 +330,19 @@ } ] }, - "searchSPARQL": { - "description": "SPARQL semantic search", + "sparql": { + "@type": "SPARQLProperty", + "description": "Endpoint for querying the directory with SPARQL", "uriVariables": { "query": { + "@type": "SPARQLQuery", "title": "A valid SPARQL 1.1. query", "type": "string" } }, "forms": [ { - "href": "/search/sparql?query={query}", + "href": "/sparql?query={query}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -361,7 +350,7 @@ }, "additionalResponses": [ { - "description": "JSONPath expression not provided or contains syntax errors", + "description": "SPARQL query not provided or contains syntax errors", "contentType": "application/problem+json", "htv:statusCodeValue": 400 } @@ -369,8 +358,9 @@ "scopes": "search" }, { - "href": "/search/sparql", + "href": "/sparql", "htv:methodName": "POST", + "contentType:": "application/x-www-form-urlencoded", "response": { "description": "Success response", "contentType": "application/json", @@ -378,7 +368,25 @@ }, "additionalResponses": [ { - "description": "JSONPath expression not provided or contains syntax errors", + "description": "SPARQL query not provided or contains syntax errors", + "contentType": "application/problem+json", + "htv:statusCodeValue": 400 + } + ], + "scopes": "search" + }, + { + "href": "/sparql", + "htv:methodName": "POST", + "contentType:": "application/sparql-query", + "response": { + "description": "Success response", + "contentType": "application/json", + "htv:statusCodeValue": 200 + }, + "additionalResponses": [ + { + "description": "SPARQL query not provided or contains syntax errors", "contentType": "application/problem+json", "htv:statusCodeValue": 400 } @@ -428,4 +436,4 @@ ] } } -} \ No newline at end of file +} From bcf66a5ef9f4fb845553250ef6f8c51dda1c62fa Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 18:22:28 +0100 Subject: [PATCH 2/9] Rename DirectoryDescription to ThingDirectory --- directory.td.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/directory.td.json b/directory.td.json index 7aec1141..c7cbda92 100644 --- a/directory.td.json +++ b/directory.td.json @@ -3,7 +3,7 @@ "http://www.w3.org/ns/td", "https://w3c.github.io/wot-discovery/context/discovery-context.jsonld" ], - "@type": "DirectoryDescription", + "@type": "ThingDirectory", "title": "Thing Description Directory (TDD)", "version": { "instance": "1.0.0-alpha" From 7c092a344d0eddc6c7edd5bfa0ea76b6160a6dae Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 18:17:41 +0100 Subject: [PATCH 3/9] Rename actions to match properties and events --- directory.td.json | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/directory.td.json b/directory.td.json index c7cbda92..ae9158fc 100644 --- a/directory.td.json +++ b/directory.td.json @@ -53,10 +53,12 @@ "security": "combo_sc", "base": "https://tdd.example.com", "actions": { - "createTD": { + "createThing": { + "@type": "CreateThingAction", "description": "Create a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -64,7 +66,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PUT", "contentType": "application/td+json", "response": { @@ -81,14 +83,14 @@ "scopes": "write" }, { - "href": "/td", + "href": "/things", "htv:methodName": "POST", "contentType": "application/td+json", "response": { "description": "Success response", "htv:headers": [ { - "description": "System-generated UUID (version 4) URN", + "description": "System-generated URI", "htv:fieldName": "Location", "htv:fieldValue": "" } @@ -106,10 +108,11 @@ } ] }, - "updateTD": { + "updateThing": { "description": "Update a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -117,7 +120,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PUT", "contentType": "application/td+json", "response": { @@ -132,21 +135,9 @@ } ], "scopes": "write" - } - ] - }, - "updatePartialTD": { - "description": "Update parts of a Thing Description", - "uriVariables": { - "id": { - "title": "Thing Description ID", - "type": "string", - "format": "iri-reference" - } - }, - "forms": [ + }, { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "PATCH", "contentType": "application/merge-patch+json", "response": { @@ -169,10 +160,11 @@ } ] }, - "deleteTD": { + "deleteThing": { "description": "Delete a Thing Description", "uriVariables": { "id": { + "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -180,7 +172,7 @@ }, "forms": [ { - "href": "/td/{id}", + "href": "/things/{id}", "htv:methodName": "DELETE", "response": { "description": "Success response", From de43a891d6ce9bb875cb79ceb3d60c740e24388f Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 20:23:19 +0100 Subject: [PATCH 4/9] Address review comments --- directory.td.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/directory.td.json b/directory.td.json index ae9158fc..95d4efee 100644 --- a/directory.td.json +++ b/directory.td.json @@ -91,8 +91,7 @@ "htv:headers": [ { "description": "System-generated URI", - "htv:fieldName": "Location", - "htv:fieldValue": "" + "htv:fieldName": "Location" } ], "htv:statusCodeValue": 201 @@ -109,6 +108,7 @@ ] }, "updateThing": { + "@type": "UpdateThingAction", "description": "Update a Thing Description", "uriVariables": { "id": { @@ -161,6 +161,7 @@ ] }, "deleteThing": { + "@type": "DeleteThingAction", "description": "Delete a Thing Description", "uriVariables": { "id": { From 8157a1b4ba6002fc84a3e11581bfa472a1be6d65 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Tue, 18 May 2021 15:17:15 +0100 Subject: [PATCH 5/9] Re-separate update and partial update --- directory.td.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/directory.td.json b/directory.td.json index 95d4efee..0134a597 100644 --- a/directory.td.json +++ b/directory.td.json @@ -136,6 +136,20 @@ ], "scopes": "write" }, + ] + }, + "partialUpdateThing": { + "@type": "PartialUpdateThingAction", + "description": "Update a Thing Description", + "uriVariables": { + "id": { + "@type": "ThingID", + "title": "Thing Description ID", + "type": "string", + "format": "iri-reference" + } + }, + "forms": [ { "href": "/things/{id}", "htv:methodName": "PATCH", From 9012314cf0d8b0144533ea0aa986f34d78ccafe8 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Thu, 22 Apr 2021 18:13:20 +0100 Subject: [PATCH 6/9] Split registration event into multiple events --- directory.td.json | 137 +++++++++++++++++++++++++++++++++------------- 1 file changed, 100 insertions(+), 37 deletions(-) diff --git a/directory.td.json b/directory.td.json index 0134a597..d6855542 100644 --- a/directory.td.json +++ b/directory.td.json @@ -404,43 +404,106 @@ } }, "events": { - "registration": { - "description": "TD registration events", - "uriVariables": { - "type": { - "title": "Event type(s)", - "description": "Multiple types passed as type={type} pairs for SSE", - "type": "string", - "enum": [ - "create", - "update", - "delete" - ] - }, - "full": { - "title": "Include TD changes inside event data", - "type": "boolean" - } - }, - "forms": [ - { - "op": "subscribeevent", - "href": "/events{?type,full}", - "subprotocol": "sse", - "contentType": "text/event-stream", - "htv:headers": [ - { - "description": "ID of the last event provided by reconnecting clients", - "htv:fieldName": "Last-Event-ID" - } - ], - "data": { - "description": "Partial or complete TD", - "type": "object" - }, - "scopes": "notifications" - } - ] + "thingCreated": { + "@type": "ThingCreatedEvent", + "title": "Thing created", + "data": { + "type": "object", + "description": "The schema of created TD event data including the created TD", + "properties": { + "td_id": { + "type": "string", + "format": "iri-reference", + "description": "Identifier of TD in directory" + }, + "td": { + "type": "object", + "description": "The created TD in a create event" + } + } + }, + "forms": [ + { + "op": "subscribeevent", + "href": "/events/thingcreated", + "subprotocol": "sse", + "contentType": "text/event-stream", + "htv:headers": [ + { + "description": "ID of the last event for reconnection", + "htv:fieldName": "Last-Event-ID", + "htv:fieldValue": "" + } + ], + "scopes": "notifications" + } + ] + }, + "thingUpdated": { + "@type:": "ThingUpdatedEvent", + "title": "Thing updated", + "data": { + "type": "object", + "description": "The schema of updated TD event data including the TD updates", + "properties": { + "td_id": { + "type": "string", + "format": "iri-reference", + "description": "Identifier of TD in directory" + }, + "td_updates": { + "type": "object", + "description": "The partial TD composed of modified TD parts in an update event" + } + } + }, + "forms": [ + { + "op": "subscribeevent", + "href": "/events/thingupdated", + "subprotocol": "sse", + "contentType": "text/event-stream", + "htv:headers": [ + { + "description": "ID of the last event for reconnection", + "htv:fieldName": "Last-Event-ID", + "htv:fieldValue": "" + } + ], + "scopes": "notifications" + } + ] + }, + "thingDeleted": { + "@type": "ThingDeletedEvent", + "title": "Thing deleted", + "data": { + "type": "object", + "description": "The schema of deleted TD event data", + "properties": { + "td_id": { + "type": "string", + "format": "iri-reference", + "description": "Identifier of TD in directory" + } + } + }, + "forms": [ + { + "op": "subscribeevent", + "href": "/events/thingdeleted", + "subprotocol": "sse", + "contentType": "text/event-stream", + "htv:headers": [ + { + "description": "ID of the last event for reconnection", + "htv:fieldName": "Last-Event-ID", + "htv:fieldValue": "" + } + ], + "scopes": "notifications" + } + ] } } } From a4a0ae727f0faf535ebce8ac27ed849825017ab7 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Mon, 24 May 2021 18:15:36 +0100 Subject: [PATCH 7/9] Add compromises --- directory.td.json | 297 +++++++++++++++++++--------------------------- 1 file changed, 123 insertions(+), 174 deletions(-) diff --git a/directory.td.json b/directory.td.json index d6855542..127926b8 100644 --- a/directory.td.json +++ b/directory.td.json @@ -52,13 +52,72 @@ }, "security": "combo_sc", "base": "https://tdd.example.com", + "properties": { + "things": { + "description": "Collection of Thing Descriptions in the directory", + "uriVariables": { + "offset": { + "title": "Number of TDs to skip before the page", + "type": "number", + "default": 0 + }, + "limit": { + "title": "Number of TDs in a page", + "type": "number" + }, + "sort_by": { + "title": "Comparator TD attribute for collection sorting", + "type": "string", + "default": "id" + }, + "sort_order": { + "title": "Sorting order", + "type": "string", + "enum": ["asc", "desc"], + "default": "asc" + } + }, + "forms": [ + { + "href": "/things", + "htv:methodName": "GET", + "response": { + "description": "Success response", + "htv:statusCodeValue": 200, + "contentType": "application/td+json" + }, + "scopes": "readAll" + }, + { + "href": "/things{?offset,limit,sort_by,sort_order}", + "htv:methodName": "GET", + "response": { + "description": "Success response", + "htv:statusCodeValue": 200, + "contentType": "application/ld+json", + "htv:headers": [ + { + "htv:fieldName": "Link" + } + ] + }, + "additionalResponses": [ + { + "description": "Invalid query arguments", + "contentType": "application/problem+json", + "htv:statusCodeValue": 400 + } + ], + "scopes": "readAll" + } + ] + } + }, "actions": { "createThing": { - "@type": "CreateThingAction", "description": "Create a Thing Description", "uriVariables": { "id": { - "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -107,12 +166,39 @@ } ] }, + "retrieveThing": { + "description": "Retrieve an individual Thing Description by its ID", + "uriVariables": { + "id": { + "title": "Thing Description ID", + "type": "string", + "format": "iri-reference" + } + }, + "forms": [ + { + "href": "/things/{id}", + "htv:methodName": "GET", + "response": { + "description": "Success response", + "htv:statusCodeValue": 200, + "contentType": "application/td+json" + }, + "additionalResponses": [ + { + "description": "TD with the given id not found", + "contentType": "application/problem+json", + "htv:statusCodeValue": 404 + } + ], + "scopes": "read" + }, + ] + }, "updateThing": { - "@type": "UpdateThingAction", "description": "Update a Thing Description", "uriVariables": { "id": { - "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -139,11 +225,9 @@ ] }, "partialUpdateThing": { - "@type": "PartialUpdateThingAction", "description": "Update a Thing Description", "uriVariables": { "id": { - "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -175,11 +259,9 @@ ] }, "deleteThing": { - "@type": "DeleteThingAction", "description": "Delete a Thing Description", "uriVariables": { "id": { - "@type": "ThingID", "title": "Thing Description ID", "type": "string", "format": "iri-reference" @@ -203,106 +285,18 @@ "scopes": "write" } ] - } - }, - "properties": { - "things": { - "@type": "ThingListProperty", - "description": "Collection of Thing Descriptions in the directory", + }, + "searchJSONPath": { + "description": "JSONPath syntactic search", "uriVariables": { - "id": { - "@type": "ThingID", - "title": "Thing Description ID", - "type": "string", - "format": "iri-reference" - }, - "jsonpath": { - "@type": "JSONPathExpression", + "query": { "title": "A valid JSONPath expression", "type": "string" - }, - "xpath": { - "@type": "XPathExpression", - "title": "A valid XPath expression", - "type": "string" - }, - "offset": { - "@type": "PageOffset", - "title": "Number of TDs to skip before the page", - "type": "number", - "default": 0 - }, - "limit": { - "@type": "PageLimit", - "title": "Number of TDs in a page", - "type": "number" - }, - "sort_by": { - "@type": "SortAttribute", - "title": "Comparator TD attribute for collection sorting", - "type": "string", - "default": "id" - }, - "sort_order": { - "@type": "SortOrder", - "title": "Sorting order", - "type": "string", - "enum": ["asc", "desc"], - "default": "asc" } }, "forms": [ { - "href": "/things", - "htv:methodName": "GET", - "response": { - "description": "Success response", - "htv:statusCodeValue": 200, - "contentType": "application/td+json" - }, - "scopes": "readAll" - }, - { - "href": "/things{?offset,limit,sort_by,sort_order}", - "htv:methodName": "GET", - "response": { - "description": "Success response", - "htv:statusCodeValue": 200, - "contentType": "application/ld+json", - "htv:headers": [ - { - "htv:fieldName": "Link" - } - ] - }, - "additionalResponses": [ - { - "description": "Invalid query arguments", - "contentType": "application/problem+json", - "htv:statusCodeValue": 400 - } - ], - "scopes": "readAll" - }, - { - "href": "/things/{id}", - "htv:methodName": "GET", - "response": { - "description": "Success response", - "htv:statusCodeValue": 200, - "contentType": "application/td+json" - }, - "additionalResponses": [ - { - "description": "TD with the given id not found", - "contentType": "application/problem+json", - "htv:statusCodeValue": 404 - } - ], - "scopes": "read" - }, - { - "href": "/things?jsonpath={jsonpath}", + "href": "/search/jsonpath?query={query}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -317,9 +311,20 @@ } ], "scopes": "search" - }, + } + ] + }, + "searchXPath": { + "description": "XPath syntactic search", + "uriVariables": { + "query": { + "title": "A valid XPath expression", + "type": "string" + } + }, + "forms": [ { - "href": "/things?xpath={xpath}", + "href": "/search/xpath?query={query}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -328,7 +333,7 @@ }, "additionalResponses": [ { - "description": "XPath expression not provided or contains syntax errors", + "description": "JSONPath expression not provided or contains syntax errors", "contentType": "application/problem+json", "htv:statusCodeValue": 400 } @@ -337,19 +342,17 @@ } ] }, - "sparql": { - "@type": "SPARQLProperty", - "description": "Endpoint for querying the directory with SPARQL", + "searchSPARQL": { + "description": "SPARQL semantic search", "uriVariables": { "query": { - "@type": "SPARQLQuery", "title": "A valid SPARQL 1.1. query", "type": "string" } }, "forms": [ { - "href": "/sparql?query={query}", + "href": "/search/sparql?query={query}", "htv:methodName": "GET", "response": { "description": "Success response", @@ -365,9 +368,8 @@ "scopes": "search" }, { - "href": "/sparql", + "href": "/search/sparql", "htv:methodName": "POST", - "contentType:": "application/x-www-form-urlencoded", "response": { "description": "Success response", "contentType": "application/json", @@ -375,25 +377,7 @@ }, "additionalResponses": [ { - "description": "SPARQL query not provided or contains syntax errors", - "contentType": "application/problem+json", - "htv:statusCodeValue": 400 - } - ], - "scopes": "search" - }, - { - "href": "/sparql", - "htv:methodName": "POST", - "contentType:": "application/sparql-query", - "response": { - "description": "Success response", - "contentType": "application/json", - "htv:statusCodeValue": 200 - }, - "additionalResponses": [ - { - "description": "SPARQL query not provided or contains syntax errors", + "description": "JSONPath expression not provided or contains syntax errors", "contentType": "application/problem+json", "htv:statusCodeValue": 400 } @@ -405,34 +389,21 @@ }, "events": { "thingCreated": { - "@type": "ThingCreatedEvent", "title": "Thing created", "data": { - "type": "object", - "description": "The schema of created TD event data including the created TD", - "properties": { - "td_id": { - "type": "string", - "format": "iri-reference", - "description": "Identifier of TD in directory" - }, - "td": { - "type": "object", - "description": "The created TD in a create event" - } - } + "description": "Partial or complete TD", + "type": "object" }, "forms": [ { "op": "subscribeevent", - "href": "/events/thingcreated", + "href": "/events?type=thingCreated", "subprotocol": "sse", "contentType": "text/event-stream", "htv:headers": [ { "description": "ID of the last event for reconnection", "htv:fieldName": "Last-Event-ID", - "htv:fieldValue": "" } ], "scopes": "notifications" @@ -440,34 +411,21 @@ ] }, "thingUpdated": { - "@type:": "ThingUpdatedEvent", "title": "Thing updated", "data": { - "type": "object", - "description": "The schema of updated TD event data including the TD updates", - "properties": { - "td_id": { - "type": "string", - "format": "iri-reference", - "description": "Identifier of TD in directory" - }, - "td_updates": { - "type": "object", - "description": "The partial TD composed of modified TD parts in an update event" - } - } + "description": "Partial or complete TD", + "type": "object" }, "forms": [ { "op": "subscribeevent", - "href": "/events/thingupdated", + "href": "/events?type=thingUpdated", "subprotocol": "sse", "contentType": "text/event-stream", "htv:headers": [ { "description": "ID of the last event for reconnection", "htv:fieldName": "Last-Event-ID", - "htv:fieldValue": "" } ], "scopes": "notifications" @@ -475,30 +433,21 @@ ] }, "thingDeleted": { - "@type": "ThingDeletedEvent", "title": "Thing deleted", "data": { - "type": "object", - "description": "The schema of deleted TD event data", - "properties": { - "td_id": { - "type": "string", - "format": "iri-reference", - "description": "Identifier of TD in directory" - } - } + "description": "Partial or complete TD", + "type": "object" }, "forms": [ { "op": "subscribeevent", - "href": "/events/thingdeleted", + "href": "/events?type=thingDeleted", "subprotocol": "sse", "contentType": "text/event-stream", "htv:headers": [ { "description": "ID of the last event for reconnection", "htv:fieldName": "Last-Event-ID", - "htv:fieldValue": "" } ], "scopes": "notifications" From a4294abbd4f0060d0bd2e7b544c18639f492c0f7 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Mon, 31 May 2021 14:30:15 +0100 Subject: [PATCH 8/9] Add output data schema to retrieveThing action --- directory.td.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/directory.td.json b/directory.td.json index 127926b8..833500b1 100644 --- a/directory.td.json +++ b/directory.td.json @@ -175,6 +175,10 @@ "format": "iri-reference" } }, + "output" : { + "type": "object", + "description": "The retrieved Thing Description" + }, "forms": [ { "href": "/things/{id}", From 4dbbe47571ab80ac36bfa0f8294c1cfc93dff108 Mon Sep 17 00:00:00 2001 From: Ben Francis Date: Mon, 31 May 2021 14:46:48 +0100 Subject: [PATCH 9/9] Make read actions safe and idempotent --- directory.td.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/directory.td.json b/directory.td.json index 833500b1..623ff3f1 100644 --- a/directory.td.json +++ b/directory.td.json @@ -179,6 +179,8 @@ "type": "object", "description": "The retrieved Thing Description" }, + "safe": true, + "idempotent": true, "forms": [ { "href": "/things/{id}", @@ -298,6 +300,8 @@ "type": "string" } }, + "safe": true, + "idempotent": true, "forms": [ { "href": "/search/jsonpath?query={query}", @@ -326,6 +330,8 @@ "type": "string" } }, + "safe": true, + "idempotent": true, "forms": [ { "href": "/search/xpath?query={query}", @@ -354,6 +360,8 @@ "type": "string" } }, + "safe": true, + "idempotent": true, "forms": [ { "href": "/search/sparql?query={query}",