diff --git a/index.html b/index.html index 8c5d14c2..3ac75bd3 100644 --- a/index.html +++ b/index.html @@ -173,6 +173,8 @@
+ Constraints are experimental feature, implementations are not required to support them. +
Semantic annotations need revisiting in order to simplify their representation. In the [[WOT-TD]] specification they represent the `@type` construct. At the moment only `@context`, `@type` and `@id` constructs are used in the TD.
@@ -471,7 +476,7 @@let subscription = wot.discover({ method: "local" }).subscribe({ - next: thing => { console.log("Found local Thing " + thing.name); }, + thing => { console.log("Found local Thing " + thing.name); }, error: err => { console.log("Discovery error: " + err.message); }, complete: () => { console.log("Discovery finished successfully");} }); @@ -507,7 +512,6 @@The ConsumedThing interface
interface ConsumedThing { readonly attribute DOMString name; - void setName(DOMString name); ThingDescription getThingDescription(); Promise<any> invokeAction(DOMString name, any parameters); Promise<void> writeProperty(DOMString name, any value); @@ -519,19 +523,13 @@The ConsumedThing interface
ConsumedThing
represents a local proxy object of the remote Thing. -
- Takes a name
parameter and sets the name of the Thing, as used in applications. Applications can provide a maximum 128 bytes long name, but implementations may reject (by throwing a `RangeError`) or truncate the provided name, depending on the capabilities of the underlying platform. Setting name
throws `TypeError` on other invalid (not string) input.
+ The `name` property represents the name of the Thing as specified in the TD. In this version it is read only.
Returns the Thing Description of the Thing. @@ -592,7 +590,8 @@
ConsumedThing
interface example is given.
- wot.fetch("http://mmyservice.org/mySensor").then(td => { + try { + let td = await wot.fetch("http://mmyservice.org/mySensor"); let thing = wot.consume(td); console.log("Thing " + thing.name + " has been consumed."); let subscription = thing.onPropertyChange("temperature") @@ -605,9 +604,9 @@Examples
console.log("Error starting measurement."); subscription.unsubscribe(); }) - }).catch(error => { + } catch(error) { console.log("Error during fetch or consume: " + error.message); - }); + };
- The DataSchema type represents a type name specified in the Thing Description in a serialized form, for instance JSON Schema. + The DataSchema type represents a data type specified in the Thing Description in a serialized form.
- DataSchema is under development, currently it can denote any type supported by the Thing Description and the WoT Runtime, such as simple type like "boolean"
, "number"
, "string"
, or "array"
, or "object"
that may specify value range etc.
+ DataSchema is under development, currently it can denote any type supported by the Thing Description and the WoT Runtime.
Adds a Property defined by the argument and updates the Thing Description. Throws on error. Returns a reference to the same object for supporting chaining.
-- dictionary ThingPropertyInit: SemanticAnnotations { + dictionary ThingProperty: SemanticAnnotations { required DOMString name; - required DataSchema type; + required DataSchema schema; any value; boolean writable = true; boolean observable = true; @@ -709,7 +708,7 @@The ThingPropertyInit dictionary
- Adds an Action to the Thing object as defined by the action
argument of type ThingActionInit and updates the Thing Description. Throws on error. Returns a reference to the same object for supporting chaining.
+ Adds an Action to the Thing object as defined by the action
argument of type ThingAction and updates the Thing Description. Throws on error. Returns a reference to the same object for supporting chaining.
- dictionary ThingActionInit: SemanticAnnotations { + dictionary ThingAction: SemanticAnnotations { required DOMString name; - DataSchema inputDataDescription; - DataSchema outputDataDescription; + DataSchema inputSchema; + DataSchema outputSchema; };
- The ThingActionInit dictionary describes the arguments and the return value. + The ThingAction dictionary describes the arguments and the return value.
- Adds an event to the Thing object as defined by the event
argument of type ThingEventInit and updates the Thing Description. Throws on error. Returns a reference to the same object for supporting chaining.
+ Adds an event to the Thing object as defined by the event
argument of type ThingEvent and updates the Thing Description. Throws on error. Returns a reference to the same object for supporting chaining.
- dictionary ThingEventInit: SemanticAnnotations { + dictionary ThingEvent: SemanticAnnotations { required DOMString name; - DataSchema dataDescription; + DataSchema schema; };
+ The ThingDescription related functionality, such as enumerating Properties, Actions, Events and links (introspection) is an API extension that is out of scope for this specification. However, the draft interfaces are defined here for informative purposes. +
++ partial interface ConsumedThing { + sequence<ThingProperty> getProperties(); + sequence<ThingAction> getActions(); + sequence<ThingEvent> getEvents(); + sequence<TDLink> getLinks(); + }; ++ +
+ Returns the list of Properties defined in the Thing Description of the Thing in the form of a list of ThingProperty objects. +
++ Returns the list of Actions defined in the Thing Description of the Thing in the form of a list of ThingAction objects. +
++ Returns the list of Events defined in the Thing Description of the Thing in the form of a list of ThingEvent objects. +
++ Returns the list of linked resources in Thing Description of the Thing in the form of a list of TDLink objects. +
++ Contains a hyperlink reference, a relation type and a media type. +
++ dictionary TDLink { + required USVString href; + USVString mediaType; + DOMString rel; + }; ++
The TDLink dictionary contains the following properties: +
@@ -1125,6 +1188,9 @@
+ The terms hyperlink reference and relation type are defined in [[!HTML5]] and RFC8288. +