Subject: [T2TRG] Static and dynamic affordances

From: Carsten Bormann <[email-masked]>
Date: Mon, 8 Jun 2020 17:36:24 +0200

We had an interesting discussion today in the T2TRG meeting about using Hypermedia in Things described by W3C WoT TD.

I think we isolated at least one of the problems as the dynamic creation (and deletion) of additional affordances.  E.g., if starting an action creates a way to abort (or modify) that specific action, that ability to abort is a new affordance.  In a TD, which describes instances, this needs to be modeled as a new TD (or a new part of a TD).

Michael McCool stated the requirement that a client (called consumer here) needs to be able to plan for all the interactions provided by the server.  In terms of instances, this is impossible if there are dynamic affordances.

However, if the problem is restated in terms of classes, it’s suddenly easy.  In SDF terms, the creation of a set of affordances by an action could be modeled as the creation of an sdfObject.
The class for the sdfObject can have been part of the SDF from the outset, just without an instance before the execution of the action.

So if POSTing to /fade creates a /fade/1, the specific URI used and where it is conveyed (Location-* headers in CoAP) is really not something SDF is concerned about (that would be handled at the protocol binding level).  The important part is that the sdfAction that models the /fade needs to have an object reference among its outputData, the class (sdfObject) of which can be described in SDF.  The client can then go ahead and operate on that object using knowledge it already has:
The sdfObject class definition for the dynamic object.  No new Things, no new TDs, everything already was in the SDF.

Maybe this is too easy; comments welcome.

Grüße, Carsten