You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constraints are experimental feature, implementations are not required to support them.
313
+
</p>
309
314
<pclass="ednote">
310
315
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 <a>TD</a>.
<code>ConsumedThing</code> represents a local proxy object of the remote <a>Thing</a>.
522
-
<ul>
523
-
<li>
524
-
The <dfn>name</dfn> read-only attribute represents the user given name of the <a>Thing</a>.
525
-
</li>
526
-
</ul>
527
526
</p>
528
527
529
-
<section><h3>The <dfn>setName()</dfn>method</h3>
528
+
<section><h3>The <dfn>name</dfn>property</h3>
530
529
<p>
531
-
Takes a <code>name</code> parameter and sets the name of the <a>Thing</a>, 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 <code>name</code> throws `TypeError` on other invalid (not string) input.
530
+
The `name` property represents the name of the <a>Thing</a> as specified in the <a>TD</a>. In this version it is read only.
The <a>DataSchema</a> type represents a type name specified in the <a>Thing Description</a> in a serialized form, for instance JSON Schema.
684
+
The <a>DataSchema</a> type represents a data type <ahref="https://w3c.github.io/wot-thing-description/#dataschema">specified</a> in the <a>Thing Description</a> in a serialized form.
686
685
</p>
687
686
<pclass="ednote">
688
-
<a>DataSchema</a> is under development, currently it can denote any type supported by the <a>Thing Description</a> and the <a>WoT Runtime</a>, such as simple type like <code>"boolean"</code>, <code>"number"</code>, <code>"string"</code>, or <code>"array"</code>, or <code>"object"</code> that may specify value range etc.
687
+
<a>DataSchema</a> is under development, currently it can denote any type supported by the <a>Thing Description</a> and the <a>WoT Runtime</a>.
Adds a <a>Property</a> defined by the argument and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
Adds an <a>Action</a> to the <a>Thing</a> object as defined by the <code>action</code> argument of type <a>ThingActionInit</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
733
+
Adds an <a>Action</a> to the <a>Thing</a> object as defined by the <code>action</code> argument of type <a>ThingAction</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
The <a>ThingActionInit</a> dictionary describes the arguments and the return value.
745
+
The <a>ThingAction</a> dictionary describes the arguments and the return value.
747
746
<ul>
748
747
<li>The <dfn>name</dfn> attribute provides the <a>Action</a> name.</li>
749
-
<li>The <dfn>inputDataDescription</dfn> attribute provides the description of the input arguments (argument list is represented by an object). If missing, it means the action does not accept arguments.</li>
750
-
<li>The <dfn>outputDataDescription</dfn> attribute provides the description of the returned data. If missing, it means the action does not return data.</li>
748
+
<li>The <dfn>inputSchema</dfn> attribute provides the description of the input arguments (argument list is represented by an object). If missing, it means the action does not accept arguments.</li>
749
+
<li>The <dfn>outputSchema</dfn> attribute provides the description of the returned data. If missing, it means the action does not return data.</li>
Adds an event to the <a>Thing</a> object as defined by the <code>event</code> argument of type <a>ThingEventInit</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
763
+
Adds an event to the <a>Thing</a> object as defined by the <code>event</code> argument of type <a>ThingEvent</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
765
764
</p>
766
-
<sectiondata-dfn-for="ThingEventInit">
767
-
<h4>The <dfn>ThingEventInit</dfn> dictionary</h4>
765
+
<sectiondata-dfn-for="ThingEvent">
766
+
<h4>The <dfn>ThingEvent</dfn> dictionary</h4>
768
767
<preclass="idl">
769
-
dictionary ThingEventInit: SemanticAnnotations {
768
+
dictionary ThingEvent: SemanticAnnotations {
770
769
required DOMString name;
771
-
DataSchema dataDescription;
770
+
DataSchema schema;
772
771
};
773
772
</pre>
774
773
<ul>
775
774
<li>The <dfn>name</dfn> attribute represents the event name.</li>
776
-
<li>The <dfn>dataDescription</dfn> attribute represents the type of the data that is attached to the event. If missing, it means the event does not carry data.</li>
775
+
<li>The <dfn>schema</dfn> attribute represents the type of the data that is attached to the event. If missing, it means the event does not carry data.</li>
<h2>Experimental extensions to the <strong>ConsumedThing</strong> interface</h2>
940
+
<p>
941
+
The <a>ThingDescription</a> related functionality, such as enumerating <a>Properties</a>, <a>Action</a>s, <a>Event</a>s 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.
Returns the list of <a>Properties</a> defined in the <a>Thing Description</a> of the <a>Thing</a> in the form of a list of <a>ThingProperty</a> objects.
Returns the list of linked resources in <a>Thing Description</a> of the <a>Thing</a> in the form of a list of <a>TDLink</a> objects.
973
+
</p>
974
+
<sectiondata-dfn-for="TDLink" >
975
+
<h4>The <dfn>TDLink</dfn> dictionary</h4>
976
+
<p>
977
+
Contains a hyperlink reference, a relation type and a media type.
978
+
</p>
979
+
<preclass="idl">
980
+
dictionary TDLink {
981
+
required USVString href;
982
+
USVString mediaType;
983
+
DOMString rel;
984
+
};
985
+
</pre>
986
+
<p>The <a>TDLink</a> dictionary contains the following properties:
987
+
<ul>
988
+
<li>
989
+
The <dfn>href</dfn> attribute represents a <a>hyperlink reference</a>.
990
+
</li>
991
+
<li>
992
+
The <dfn>rel</dfn> attribute represents a <a>relation type</a>.
993
+
</li>
994
+
<li>
995
+
The <dfn>mediaType</dfn> attribute represents a <a>IANA media type</a>. For <a>TD</a>s there will be registered media types, so applications will be able to check whether an `href` link points to a <a>TD</a>, i.e. whether the link is fetcheable with this API.
The terms <dfn>hyperlink reference</dfn> and <dfn>relation type</dfn> are defined in [[!HTML5]] and <ahref="https://tools.ietf.org/html/rfc8288">RFC8288</a>.
0 commit comments