-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How complicated can default mappings be? #407
Comments
I think that this is a valid question but I think that I do not see a fundamental issue with bindings vs profiles. The main constraints you are highlighting comes from the lack of expressivity in the TD spec regarding async actions and meta operations. One point to highlight as a lack of binding is the SSE and/or WebHook. We definitely need it. I am not sure about WebHook though as it flips Thing and Consumer roles in relationship to Server/Client.
We had a discussion about this in node-wot and we think that the form should contain
We don't have an agreement so far but so far they are just operation to vocabulary term mappings. We can evaluate based on the examples/use cases but the answer to |
@egekorkan wrote:
I agree, I'm just worried about whether the necessary level of expressivity will ever be reached.
I agree an HTTP SSE Binding Template would be useful, and I would be happy to contribute to that.
I guess that makes sense and neatly sidesteps the need to describe a nested content type.
OK, so from my Web of Things (WoT) HTTP Protocol Binding 2.0 strawman proposal, only the blue tables would be allowed? All that can be specified in those tables is HTTP methods and headers, and if the protocol binding and payload binding are to be separated the Maybe by relying on the URI scheme to map to a protocol binding template and separating out the protocol binding and payload binding means a lot of the remaining content will drop out, but I still think that misses a lot of detail about how to interoperate. I notice the current HTTP Binding Template vocabulary doesn't even include a term to describe a response code, even though the WoT Discovery specification uses the term Have there been any more proposals about how to describe dynamic resources? I note that the issue about a lack of a data schema for
FWIW I agree it's not a default if it can't be overridden, I'm just not confident that a sufficiently expressive vocabulary to override every little detail needed for out-of-the-box interoperability is going to arrive any time soon. |
See also: #408 |
A key question that's on my mind when thinking about the relationship between Profiles and Protocol Binding Templates is how complicated default mappings inside a Binding Template can be, and at what point a default mapping becomes a sub-protocol.
We seem to have a tentative agreement around the idea that the Protocol Binding sections of Profiles don't really belong in Profiles and their content should be moved to individual binding documents as defaults instead. Those bindings and defaults can then be referenced as constraints in Profiles. E.g. The HTTP Basic Profile would assert that conforming Things must use the HTTP Binding Template and stick to its default mappings, and must use the JSON Payload Binding Template.
However, in order for this to work the default mappings in Binding Templates may have to become much more complicated than they are today. Currently almost all of the "default mappings" in existing binding documents map an operation to a single term in a binding vocabulary. E.g.:
The protocol binding sections in Profiles are much more comprehensive than this and are written as a collection of assertions, e.g.
These assertions specify protocols, sub-protocols, methods, headers, response codes, payload bindings and in some cases even dynamic resources with fixed data schemas (
ActionStatus
). Profiles also constrain things like units, date formats and error formats - but those could be specified separately from binding documents.As we all know by this point, the protocol bindings related to actions are of particular concern, because there are certain things that are currently very difficult or impossible to describe declaratively in a Thing Description. I know a lot of people think we should only set defaults for things that can be overridden using a binding vocabulary, which is where this gets tricky.
For example, in the HTTP Binding Template:
invokeaction
operation can have anhtv:methodName
ofPOST
, but what should the response data schema look like if the action has not completed by the time the HTTP response is sent? Should the response contain a link or redirect to another resource which represents the action status?queryaction
operation, given there's currently no way to specify a separate data schema for result of aqueryaction
operation or dynamic resources in a Thing Description. Aqueryaction
operation can have anhtv:methodName
ofGET
, but what URL does it act upon and what is the data schema of the response?cancelaction
operation could havehtv:methodName
set toDELETE
, but what resource does it act on if there's no way to specify dynamic resources?queryallactions
operation could have ahtv:methodName
set to GET, but what should the data schema of the response look like?readmultipleproperties
operation, how should a Consumer specify which properties to read?observeproperty
andsubscribeevent
operations? Should it use longpoll as a subprotocol? Or should these pub/sub style operations be separately defined in other binding templates like an HTTP SSE Binding Template and HTTP Webhook Template?In some cases it may also be difficult to separate the protocol binding from the payload binding, e.g. The Server-Sent Events protocol binding is tightly coupled with the text/event-stream payload format.
So my key questions are:
The text was updated successfully, but these errors were encountered: