GithubHelp home page GithubHelp logo

wot's Introduction

Web of Things (WoT) General Repository

Follow on Twitter Stack Exchange questions

General information about the Web of Things can be found on https://www.w3.org/WoT/.


This is a repository for the W3C Web of Things Interest Group.

This repository is mainly for archival and general logistics. For work on a specific topic, one of the other repositories dedicated to that topic may be more relevant:

How to Get Involved

Web-site based Pull-Request

  • Fork the w3c/wot repository into your own account (button in the top right corner)
  • Navigate to a file in your master branch that you want to change (e.g., http://github.com/{your-account}/wot/blob/master/charters/wot-ig-2016.html or http://github.com/{your-account}/wot/blob/master/charters/wot-wg-2016.html)
  • Click the edit icon in the upper right (pen next to Raw/Blame/History)
  • Make your edits (e.g., directly in the online editor or by copying the text to your favorite editor and back)
  • Give a meaningful commit message (i.e., do not leave "Update ...")
  • Choose Create a new branch for this commit and start a pull request and give a proper name (e.g., charters-ig-scope-plugfest)
  • Click Propose file change
  • Skip the form, since you do not want to create a PR to your fork. Instead, go to https://github.com/w3c/wot, where GitHub will have found your new branch and will offer to open a pull-request (base fork: w3c/wot, base: master ... head fork: {your-account}/wot, compare: {your-branch}).
  • If you have a separate change proposal for the same file, go back to your master branch and repeat the process from clicking the edit icon.
  • If the pull-request discussion expects you to update your change proposal, go to your branch corresponding to the PR, click the edit icon, and commit directly to that branch.

Command-line based Pull-Request

  • Fork the w3c/wot repository into your own account
  • Create a branch in your fork for one particular topic (e.g., a single IG scope item) with a proper name (e.g., charter-ig-scope-plugfest)
  • Make your edits and commit
  • Push the new branch to your own repository fork
  • GitHub will automatically offer to open a pull-request to w3c/wot (from your new branch to master)

Github Help

wot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wot's Issues

Web of Things Interest Group Charter

n.b. this is an extension of the issue 67 on the w3c/charter repository and was copied here following the discussion in the WoT IG call on April 27th.

This issue is intended to introduce open questions for discussion in respect to the draft charter for the Web of Things Interest Group. This will replace the old charter which expired on 31 March 2016.

We've asked the W3C Management Committee for a short term extension to the old charter to cover the time needed to draft a new charter, reach consensus and drive it through the Advisory Committee review process. To avoid the risk of having to close the IG until a new charter is approved, we need to stick to schedule of 4 weeks for drafting the new charter.

Here are some initial points to seed discussion. Please add further points.

  • Do we want to update the introduction to reflect the current positioning of the Web of Things as a suite of inter-platform standards? For instance, explaining the analogy behind the statement that the Web of Things is to the IoT what the Internet Protocol is to networking.
  • The introduction should set out short, medium and long term priorities for the Interest Group.
  • We agree to see through the work items started under the first charter.
  • We allow for new work items to be introduced that fit within the charter scope.
  • The Interest Group will collaborate with industry alliances and standards development organisations to achieve its goals.
  • This collaboration will include joint studies, practical demonstrations that show the technical feasibility of approaches to enabling interoperability across platforms, open source projects, open meetings and so forth.
  • The Interest Group will develop materials to assist in outreach in respect to the its goals, and will drive that outreach through a variety of channels.
  • The Interest Group will study the challenge of interoperability testing, along with work on test suites and test frameworks. Note that the proposed Web of Things Working Group will be expected to define normative test suites for its specifications, however, the Interest Group will have a broader scope, and will be expected to work interoperability testing covering this broader scope
  • The goals include building a common understanding around discovery, provisioning, security, resilience, privacy, trust and other requirements for open markets of services.
  • The Interest Group will seek to identify work items where there is sufficient maturity and consensus to transfer to the standards track in one or more W3C Working Groups.
  • The Interest Group will collaborate with other W3C groups where relevant to its goals.
  • The Interest Group will consider initiating new work items at the request of other W3C groups, when these requests fall within the charter scope, and are consistent with Interest Group's priorities.
  • The Interest Group will guide the W3C staff in preparing the initial charter for the proposed Web of Things Working Group
  • The Interest Group will coordinate closely with the proposed Web of Things Working Group, and may propose new work items for the WG to consider. Note that the WG will be expected to seek feedback on its specifications from other groups
  • How long should we ask for the charter duration? My feeling is that 12 months is too short, and a longer period would be helpful, as otherwise we will be back working on updating the charter in 10 months time. We could perhaps ask for a 24 month charter duration, or time it to last through the 2017 or 2018 TPAC meetings. Note that next time around we need to have a new charter ready for AC review 2 months before the end of the existing charter. If we had a 12 month charter, this would mean starting work on the next charter something like month 8. This is why I feel a 12 month charter is too short.

build.sh should include timeouts & check for errors ...

The curl command should include --connect-timeout 5 --max-time 30
and afterward script should check $? with something like

RC=$?
if [ $RC -ne 0 ]; then echo curl failed exit status= $RC ; exit $RC; fi

similarly the unzip should check $?

Thank you for your work.

Position of Scope Summary Box

In "2. Scope" of alpha 3 version of IG charter,

  1. In the figure, there are the words "Plugfest" (in WoT-IG box) and "Interop Tests" (in WoT-WG box). What is the difference of these words?
  2. "Scope Summary" is well summarized and very usuful to understand this section.
    I propose that this summary be moved to the top of this section.

Modeling events related to multiple instances of a sensor

In some use cases, we have found interesting to be able to handle events from multiple instances of the same type of sensor, to be reported together, to facilitate its processing. If the individual sensors are reported as independent events, the event consumer must handle the correlation of them. If the more common use case is to handle them together, then this introduces an additional complexity in most consumers.

For example, suppose a device with two batteries. It would be important to know the charge of each battery at the same moment.

Arguably, the total charge can be reported as one single event by the device (instead of the individual batteries' charged), but this will limit the clients to one way of measuring this aggregation.

We have found this same need in other domains, like traffic management, when we count the intensity of vehicles per lane at a road. This information is most of the time handled as a unity. In this case, each lane is reported as an instance of a traffic monitoring sensor.

Use cases should be structured by Domains/Verticals

To make it clearer to outside folks from specific domains/verticals where to look for their use cases, and also internally to see if we have sufficient coverage of the intended domain/vertical, please structure the use cases in Section 1 by Domain/Vertical (using subheadings)

WG charter being more neutral w.r.t. actual protocols

While the IG charter document (http://w3c.github.io/wot/charters/wot-ig-2016.html) is very neutral/silent w.r.t. which protocols are in scope by just referring to external organizations the WG charter (http://w3c.github.io/wot/charters/wot-wg-2016.html) gives detailed information.

Example #1
The table "Web of Things application layer" in section "1. Introduction" indicates transfer (HTTP, CoAP, MQTT, BLE GATT), transport (UDP, TCP), and network protocols.

Example #2
The second bullet item in section "2.1 Thing Description" refers to OAuth, JSON, CBOR, CoAP, ..

I wonder whether we should be more neutral in the WG charter also to:

a) not confuse people that we limit ourselves to those protocols

b) frighten people/organizations that can't find their protocols

I recall a discussion about this topic and being neutral in our charters in Montreal F2F. That said, I can't find any information in the minutes though (https://lists.w3.org/Archives/Public/public-wot-ig/2016Apr/0024.html)... however there seems to be this related issue, w3c/charter-drafts#59 in the old space

The type system for things

This issue concerns the type system for web of things applications, and is distinct from what takes place at the abstract messaging layer and specific protocol bindings. In addition, this particular issue avoids discussing the choice of representation for thing descriptions.

Based upon the rich experience with event driven programming, the starting point is software objects that are exposed to applications, and which stand for a physical or abstract entity. These objects are the "things" in the web of things and have a URI as part of the W3C Resource Description Framework.

Things can have properties, actions and events:

Properties
Things may have zero or more properties. Each property has a distinct name and a value.

Actions
These correspond to asynchronous methods. Applications can invoke named actions passing a value. Actions are associated with a sequence of zero or more responses which may carry a value. In principle, actions and responses could carry multiple values. Programming languages support positional arguments and named arguments. However, given the ability to provide compound values with named fields, this extra complexity may not be justified. The way in which responses are passed to applications could vary. One approach involves passing a call back to the action when invoking it. Another involves the action synchronously returning a "Promise" upon which the application can declare handlers.

Events
Objects can raise events to notify applications when something has happened, for example, an indicator light has failed. Events have a name and a value. Applications can register call backs for events with the same name. In principle, this could be extended to allow applications can register for a named collection of event names. One way to do that is with compound names and wild cards.

Values
Each value has a type. The core types include:

null: this denotes the absence of a value
boolean: either true or false
number: including integers and floating point
string: a sequence of UTF-8 characters

The following are anonymous compound types which can be nested to arbitrary depths:

object: a set of name/value pairs, possibly empty
array: a sequence of values, possibly empty

In addition, I propose to have things and streams as first class types, i.e. you can assign them to properties, pass them through events, when invoking actions or in responses to actions. Things are as defined above. Streams are an interface to a time sequence of values.

At the minimum, this interface should provide the means to iterate through the sequence. Streams may further provide metadata, e.g. the interval between streamed values or the timestamp for a value when available. Streams are often associated with a buffer, so that you can look back at past values. Streams may provide a means to query the buffer size, and to access a value at a particular time, or to obtain an iterator for a given window of time.

The type system needs to support both early and late binding, where the type is only partially known in advance and has to be fully determined at run time. This is analogous to unions in C++ where a tag value is used to determine which of the variant types applies. It would be useful to be able to declare a value as being on a given class or set of types. For late bound things, the platform will need to dereference the thing's description to construct the corresponding object.

Things may be associated with constraints. This can include constraints on single values, e.g. min and max values for a number, whether the number is a integer, the precision of a floating point number and so forth. String values could be constrained to be members of a given set.

Richer integrity constraints can be modelled as an expression over values that should evaluate to true. Such expressions should be side effect free. It is generally the case, that such expressions can include a range of predefined operators, e.g. boolean operators, numerical comparisons, string operators and so forth. A predefined set of named functions may be provided, e.g. to return the number of items in an array.

Integrity constraints can be used to restrict values and may apply across properties, actions and events. Integrity constraints may be seen as analogous to the use of "assert" statements in programming languages where the developer wants to know when something is wrong, and to avoid the programming continuing when that happens. For the web of things, integrity constraints can be used to increase resilience in the presence of faults and bad data.

Things also have metadata and semantic descriptions that state semantic constraints on given kinds of things. This is beyond the scope of this particular issue.

[TF-AP/Thing API] Thing Observe Property

I believe the idea of the Interface Thing is that to "observe" a property change one needs to add a listener for this property.
Currently the listeners are mainly for events. Moreover, if the plan is to support property changes by the same method (i.e., addListener()) it needs to be specified/explained. Also we may need to take into account name collisions between events and a properties (the thing description currently does not forbid using the same name for both).

Semantics Annotations in Type Systems

Comment for the type system proposal:

One of the goals mentions "enable semantic annotation of type definition". In the comparision table is this missing. It would be great to see also an example including metadate within type definitions. A sample can be a RGB value as complex type representation. Where can you read the value red, green, and blue?

W3M requests for changes to the IG charter

The W3C Management committee (W3M) have requested a few changes which are described below:

Ralph Swick:

Having looked now at the diff, I request one change to align with Process and two minor editorial suggestions. I note that one addition to this charter is to organize and run PlugFests. Where have the resource expectations for that activity been discussed?

Dave: This is a continuation of the current practice during the first charter. The IG holds PlugFests as part of its face to face meetings. Would be sufficient to mention that?

To align with Process, in the last paragraph of the Introduction:

"The short term priority for the Interest Group is to /-launch-/ /+draft a proposed charter for+/ a Working Group /-to initiate standardization-//+that specifies+/ work items…"

Dave: I am not 100% clear of your revision syntax, is is the following what you’re expecting:

The short term priority for the Interest Group is to draft a proposed charter for a Working Group that specifies work items that the Interest Group believes are ready for progression along the W3C Recommendation track.

In "The mission" I suggest the following editorial change:

"... enable open markets of services, and to /-unleash the power of the network effect-//+increase value through broader use of interoperable devices+/.

Dave: Are you suggesting dropping the mention of the network effect? This was put there to remind people of the power of the network effect to stimulate exponential growth, as we have seen for the Internet and the Web. Overcoming the current fragmentation of the IoT to enable the network effect is a key part of the mission. You proposed change would greatly dilute the message.

In "Participation" I suggest the following editorial changes:

"... including representatives from the key implementors /-of this specification-/ and active Editors /-and Test Leads-/ for each /-specification-//+document+/. The Chairs, /-specification-/ /+and document+/ Editors/-, and Test Leads-/ are …"

Dave: Right, the current text is a hangover from the WG template! I am not 100% sure of your revision syntax, so is the following what you're expecting to see?

To be successful, this interest group is expected to have 6 or more active participants for its duration, including representatives from the key implementors and active Editors for each document. The Chairs and document Editors are expected to contribute half of a day per week towards the Interest Group. There is no minimum requirement for other Participants.

Michael Cooper:

The Accessible Platform Architectures Working Group has an active interest in Web of Things. It wishes in particular to expand the use cases to highlight both accessibility benefits and risks, and may need to provide input on specific technologies at times. While much of that would be coordination at the technology level with the Web of Things Working Group, some of the foundational architectural notes proposed for the Interest Group will also need accessibility impact review.

I suggest the liaison statement to APA be "For coordination on impacts of Web of Things technologies on accessibility to users with disabilities."

APA has a wiki page to track its Web of Things thinking, which is sparse right now but on the active radar for expansion: https://www.w3.org/WAI/APA/wiki/Web_of_Things

Dave: okay we will add the APA WG to the of W3C groups in section 4.1 using your suggested text.

[TF-AP/Thing API] ThingFilter server attribute

dictionary ThingFilter {
    attribute DOMString? type;
    attribute ThingProximity? proximity;
    attribute DOMString? id;
    attribute DOMString? server; 
};

So this is the address, URL, of a server containing a directory of "things", e.g. an IETF CoRE Resource Directory?

IG Charter: 3.Deliverables

Regarding the Security and the Semantic parts, seems those are over committed comparing with other sentences the above of the four. So why don't we just remove the following sentence and assume that the current practices document would deals the outcome of those plugfests.

"This document will be developed in conjunction with experimental implementations for the PlugFests."

Gitter.im Support on Repo?

Since a lot of work is happening on this repo regarding various use cases, I think that Gitter would be handy.
It would enable us to discuss a bit more on how to contribute and what is important in each case.

Consistency between scope and deliverables

Currently, WG's scope was defined as "Standards for enabling interoperability across IoT platforms" in WG charter.

Target of this standardization is for IoT platforms ?
Implementation of spec is working on IoT platforms ?
What is the IoT platforms ?

If it is desired scope, why do not define how can test that WG deliverables can do to realize the interoperability across IoT platforms ?

TD mandatory fields vs hint fields

This issue was raised in the TD call on 30 Mar 2016:

Clarify which fields in the TD examples are mandatory to parse the TD and which are hints for semantic interoperability.

IG Collaboration - 3.2 W3C Groups

The IG re-charter needs to list the W3C groups with which we want to collaborate. Is the excessive list in https://www.w3.org/2014/12/wot-ig-charter.html realistic or just expected? Should we simply copy it or look for real liaisons?

  • Browser-related groups would be interesting to assess how we could integrate WoT there.
  • Semantics- and sensor-related groups would help for the TD
  • Automotive is interesting due to the cyber-physical aspect
  • Security and privacy groups could provide good reviews and further input
  • ...

@ashimura due to your involvement, you might be the best source here :)

[WG Charter] Deliverable Document Types

In "Deliverables" section of category,
there are three different types of documents to be delivered:
i.e.) "Standard Recommendation document" for API,
"Spec & guidelines" for Bindings and
"Specification document" for Things Description

There are some defined document types of W3C.
Shouldn't we harmonize these according to the existing well-known doc types?

Binding of abstract messages to protocols and communication patterns

The abstract model of the Web of Things is described in Issue120. This issue discusses the binding of abstract messages to protocols and communication patterns. The protocol bindings can be described in terms of a mapping to a set of abstract messages:

  • property update with the thing, the property path and the new value
  • action invocation with the thing, the call id, the action name and the value to be passed
  • action response with the thing, the call id, the action name and the value to be passed
  • event notification with the thing, the event name and the value to be passed
  • (un)register for an event name
  • (un)register local proxy for remote thing
  • (un)register remote proxy for local thing
  • death of a thing or ancestor proxy

Asynchronous Messaging Protocols
This is a class of protocols that allow either party to send asynchronous messages to the other party. One example uses JSON over WebSockets. This is valuable for human machine interfaces using Web browsers, which restrict web page scripts to a very small set of protocols (HTTP, WebSockets and WebRTC). The mapping from an abstract message to a JSON message over WebSockets is straightforward, e.g. one to one, using strings for thing identifiers.

REST based Protocols

For these protocols, e.g. HTTP and CoAP, abstract messages are mapped into GET, PUT, POST, PATCH and DELETE requests to specific URLs. The servers for these protocols expose a hierarchy of resources as URL paths. In keeping with Roy Fielding's principles for representational state transfer, GET is used to retrieve the full state of the given resource, PUT to update the full state of the given resource. POST can be used to create a new resource, DELETE to delete a resource, and PATCH to update part of the state of a resource.

This leaves the freedom to decide whether a single resource corresponds to a given thing, or to a property of that thing. In the former case GET and PUT transfer the complete set of properties for a thing. In the latter case the mapping from a property path to the URL path for the corresponding resource may involve a simple transformation that is the same for all of the properties. Alternatively, the mapping has to be defined explicitly for each property.

Events and action responses are asynchronous. One way to handle this is to pass a URI for the HTTP server to post the event or response to. Another is for an HTTP server to keep the connection open and send the responses as a stream. The challenge here is what to do when a connection is closed somewhere along the line, e.g. by a firewall or HTTP proxy server. This makes it worthwhile to utilise a call id so that a client can poll the HTTP server in the connection closes prematurely. CoAP can be considered as equivalent to HTTP but running over UDP rather than TCP. CoAP allows clients to request a stream of responses via setting the Observe header.

There are a number of existing approaches to formally describing REST based services. One of these uses RAML and JSON Schema. I think of a lot of the complexity can be avoided through the separation of declaring the application data and interaction model, and the bindings to specific protocols. This is something to show practically through demos.

Pub/Sub Protocols

This includes protocols such as MQTT, XMPP and AMQP. MQTT routes messages via brokers to clients who have expressed interest in particular message topics. This works well when there are many clients interested in receiving sensor data. It doesn't work so well for actions where the responses need to be routed to the specific client that invoked the action. This suggests the need for a triple of topic names. One topic for routing messages to the IoT device, the second for routing messages to a specific client, and the third for routing events and property updates to all clients with proxies for the thing created by the IoT device.

Streams

A common case is where readings from one or more sensors need to be buffered and transferred as a block. This block needs to be associated with metadata sufficient to separate out each of the constituent readings. Another case is where a time sequence of values is sent to control an actuator, e.g. the joints in a manufacturing robot's arm. IoT devices may not have real-time clocks with which to provide date stamps for sensor readings. In such cases, a gateway may be able to add these if needed. Gateways may further combine streams from different sources as appropriate.

IG Charter: 3. Deliverables

Regarding the Security and Semantic parts, seems those are over committed comparing with other sentences the above of the four. So why don't we just remove the following sentence and assume that the current practices document would deals the outcome of those plugfests.

"This document will be developed in conjunction with experimental implementations for the PlugFests."

Things as part of the distributed Web of Things

Things represent physical or abstract entities. Things are independent of their location. Things are exposed to application programs/scripts as software objects. A given thing may be exposed to applications running on different devices. The software objects for a thing are synchronised by the platform the application is running on. A server script implements a thing in terms of the sensors and actuators it embodies. The thing has a URI as part of the W3C Resource Description Framework. This URI can be dereferenced to access the thing's description. The server script registers the thing with its URI on the platform it is running on. Client scripts running on another device can now register a proxy for that thing using its URI. The platform for the client script retrieves the thing description and creates the corresponding software object. When either script updates a property of the thing, the platforms pass notifications to keep the software objects synchronised. This is illustrated in the following diagram:

thing concepts

Proxies can be chained as needed. A common scenario is where a thing is created by a battery operated device that is connected via a wireless protocol to a local gateway. This gateway is in turn connected to a cloud based server. That server is used by a web page that provides the human machine interface for the associated service. This scenario involves chained proxies in the gateway, cloud server and web page. Proxy chains are actually trees since a given thing/proxy may have more than one proxy registered for it.

Applications are decoupled from the underlying protocols and communication patterns which can be chosen to fulfil the detailed requirements for particular services, and which will vary considerably from one application domain to another. Platform developers are responsible for implementation of the communication patterns and protocol bindings. The application designer can provide metadata to indicate choices. This is needed to enable one platform to know what communication pattern to use with another platform.

This is made possible through rich metadata that describes the data and interaction models exposed to applications and the information needed for platforms to interoperate. This includes the details for how the application data model maps to a particular protocol, the specific security requirements, and the semantic description of things to ensure that platforms are using the same meaning for a thing when they exchange its data. The protocol bindings can be described in terms of a mapping to a set of abstract messages:

  • property update with the thing, the property path and the new value
  • action invocation with the thing, the call id, the action name and the value to be passed
  • action response with the thing, the call id, the action name and the value to be passed
  • event notification with the thing, the event name and the value to be passed
  • (un)register for an event name
  • (un)register local proxy for remote thing
  • (un)register remote proxy for local thing
  • death of a thing or ancestor proxy

As a distributed system the Web of Things is intrinsically asynchronous. When an application updates a thing's property value, this change is propagated to the rest of the software objects for this thing. Property updates form an implicit class of events, enabling applications to listen for changes in addition to reading and writing property values. The abstract message for a property update may involve a path description when the update is for a part of compound value.

Some people are confused by what it means to pass a thing as a value. The answer is that at the abstract messaging layer, this just involves passing the URI for the thing's description. The platform is then responsible for constructing a local object as a proxy for the thing, and for initialising its property values. Things are independent of their location. Applications see things as software objects in the execution space on the device the application is running on. At the abstract messaging layer a stream is a message carrying a single value in the time sequence of values that make up the stream.

Issue 119 is a proposal for the type system for things.

I will cover the mapping from abstract messages to specific protocols in another issue.

[TF-AP/Thing API] Security/privacy and access authorization aspects

Looking at security/privacy and access authorization aspects of this API is the assumption that the web application or server application (e.g. node.js) already has been authorized to access the “thing”?

If not, is it assumed that, after a thing has been discovered, that an authorization session with e.g. OAuth will be executed before the web app is allowed to access the thing?

Introduction text + concept illustration

The introduction text and the concept illustration figure do not reqlly harmomize. E.g., the figure uses words such as "servient" (=service and/or client), "Integration Hubs", "Resource models", etc. which is not used in the text. Some more explaination would be good.

'Things' or 'things'

We should decide about case sensitivity of 'Things'. Currently. 'things' is used in the charta text, however, in literature 'Things' is is communly used.

How to use JSON Schema for complex data type in JsonLD

How to use JSON Schema for complex data type in JsonLD

We use simple and complex data type in thing description for input and output values .
As discussed before in the group , they suggested JSON Schema as a good candidate for complex data type specification. So here i am going to give a proposal how to use JSON Schema for complex data type in Thing description (JSONLD) and i will illustrate that with an example.

So at first this is the JSON Schema example that i want to use it in the JSONLD:


{ "valueType": {

                "type": "object",
                "properties": {
                     "red": {
                                      "type": "number",
                                "maximum":255,
                                "minimum":0
                                },

                            "green": {
                                        "type": "number",
                                          "maximum":255,
                                          "minimum":0
                                                          },

                            "blue": {
                                       "type": "number",
                                       "maximum":255,
                                       "minimum":0
                                                         }
                    },

            "required": ["red", "green","blue"]
    }

As we can see here there is some new vocabulary (properties,maximum,minimum)
So that we need to map those terms into URIs and put them in the context .

Syntax Tokens and Keywords:

@id: Used to uniquely identify things that are being described in the document with IRIs or blank node identifiers.
@container: Used to set the default container type for a term.
@Index: Used to specify that a container is used to index information and that processing should continue deeper into a JSON data structure.

Example:

In the example above, the properties term has been marked as an index map. The red, green and blue keys will be ignored semantically, but preserved syntactically, by the JSON-LD Processor. This allows a developer to access for example the red rgb coordinate of the properties using the following code snippet: obj.properties.red.

{
            "@context": ["http://w3c.github.io/wot/w3c-wot-td-context.jsonld"],
        "@type": "Thing",
        "name": "MyTemperatureThing",
        "uris": "coap://www.mytemp.com:5683/",
        "encodings": ["JSON"],
        "properties": [
            {
           "name": "rgbvalue",
                   "valueType": {
            "@context": {    
                                 "properties": {
                     "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#member",
                                     "@container": "@index"
                                }
                                          },
                                 "type": "object",
                             "properties": {
                                    "red": {
                                                "type": "number",
                                        "maximum":255,
                                        "minimum":0
                                        },
                                        "green": {
                                                "type": "number",
                                                          "maximum":255,
                                                           "minimum":0
                                                          },
                                    "blue": {
                                                       "type": "number",
                                                        "maximum":255,
                                                         "minimum":0
                                                            }
                            },
                         "required": ["red", "green","blue"]
                                    },
        "writable": false,
        "hrefs": ["rgb"]
      }
     ]
}

At first , When i put the new context with the old one, there have been a confusion with properties terms (the one of the thing description with the one of json schema).
So the solution was to create a new context for the properties term of Json Schema and put it inside the valueType term.

The interpretation of the data above is expressed as below. Note how the index keys do not appear in the Linked Data below, but would continue to exist if the document were compacted or expanded using a JSON-LD processor:


_:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://json-ld.org/playground/Thing> .
_:b0 <http://www.w3c.org/wot/td#associatedUri> <coap://www.mytemp.com:5683/> .
_:b0 <http://www.w3c.org/wot/td#hasProperty> _:b1 .
_:b0 <http://www.w3c.org/wot/td#name> "MyTemperatureThing" .
_:b0 <http://www.w3c.org/wot/td#supportsEncoding> <http://json-ld.org/playground/JSON> .
_:b1 <http://www.w3c.org/wot/td#associatedUri> <http://json-ld.org/playground/rgb> .
_:b1 <http://www.w3c.org/wot/td#name> "rgbvalue" .
_:b1 <http://www.w3c.org/wot/td#valueType> _:b2 .
_:b1 <http://www.w3c.org/wot/td#writable> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#member> _:b3 .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#member> _:b4 .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#member> _:b5.

WebSocket binding

I have two questions regarding Dave's binding to WebSocket:

  • why maintaining one single web socket per server? In the case where a server hosts several Things, I assume it has no particular hardware constraint and could handle multiple connections. From my point of view, registration is already implicit when a agent connects to the socket, no registration at the message should be required (registration is made at the WS layer, so to say). Is there any use case where an agent wants to connect to the Thing server without registering itself?
  • JSONPath is a great idea. However, here, there are no real object hierarchy yet. Instead of
{
  uri: thing's uri
  event: event name
  data: event data
}

why not having

{
  uri: thing's uri
  "event name": {
    "event id": { 
      data: event data
    }
  }
}

I assumed event name is the name of the event type, as defined in the TD, not the event itself. The Thing server would only have to maintain a single JSON object for the Thing (maybe even the JSON-LD TD). This JSON object should then have the same structure as in Johannes' interaction patterns where resources simply become JSON objects.

Requests could even be plain JSONPath expressions. I am not sure about how to handle action execution requests though. It might look like

{
  uri: thing's uri
  "action name": {
    data: action data /* (or value in the interaction pattern) */
  }
}

with the following response

{
  uri: thing's uri
  "action name": {
    "call id": {
      data: action data /* same as in the request */
      status: current status of the execution
      time: time of invocation
    }
  }
}

Here, the Thing defines the ID of the action being executed. And again, action name is defined in the TD.

This structure is maybe closer to the TD specification and as such, it might be more easily extendable as the complexity of use cases grow.

Fig. 5 says "Proxy"

In the WG charter, we picked the words "cloud mirror" or "device shadow".
Should we align this?

Bug in XML mapping

XML mapping in Section "3.2.4.2.2 JSON Array" (see http://w3c.github.io/wot/current-practices/wot-practices.html#json-array) provides some examples.

The last Example 22 looks as follows

<array>
  <double>208</double>
  <double>32</double>
  <double>144</double>
</array>

while I think it is supposed to be

<array>
  <number>208</number>
  <number>32</number>
  <number>144</number>
</array>

@takuki may I ask you to look into that (I think it was your commit). I can fix that but wasn't sure whether there is anything I miss...

Do we need master branch ?

If we use to gh-page branch as main branch, we can provide browsing page directly via github.io.

How about to change to gh-page branch as main branch ?

As you know well, many w3c project on github already used to gh-page branch as main branch.
(e.g: https://github.com/w3c/manifest)

WebSockets binding

I had an action to come up with a proposal for using WebSockets with the Web of Things. This follows on from the implementation I made with NodeJS in 2015. WebSockets is an asynchronous message exchange protocol related to HTTP. You start off with an HTTP request for a protocol upgrade, along with an exchange that ensures the client that the server implements WebSockets, as specified in [https://tools.ietf.org/html/rfc6455 RFC6455]. WebSockets defines message frames, so that the recipient of a message can deliver a complete message. The protocol bindings can be described in terms of a mapping to a set of abstract messages:

  • property update with the thing, the property path and the new value
  • action invocation with the thing, the call id, the action name and the value to be passed
  • action response with the thing, the call id, the action name and the value to be passed
  • event notification with the thing, the event name and the value to be passed
  • (un)register for an event name
  • (un)register local proxy for remote thing
  • (un)register remote proxy for local thing
  • death of a thing or ancestor proxy

WebSockets is often used together with JSON. The following describes the messages used in a NodeJS implementation.

To register a local proxy for a remote thing, the proxy server sends:

{
  register: thing's uri
}

The server hosting the proxied thing replies with:

{
  uri: thing's uri,
  state: thing's properties as an associative array
}

The proxy server can later unregister with:

{
  unregister: thing's uri
}

If the server hosting the proxied thing unregisters the thing, all proxy servers (or web pages) are notified with:

{
  unregister: thing's uri
}

When a property for the thing is updated, the thing server sends to all proxies:

{
  uri: thing's uri
  patch: property name
  data: property value
}

The same message is sent to the thing server when the proxy updates a property.

Note: the thing should echo this back when the change has taken effect. For IoT devices that spend most of the time asleep, there will be a lag until the device's next receiving window opens. By echoing the property update back to the proxy after the update has actually been sent to the IoT device, user interfaces can indicate that an update is in progress during the lag.

Note: the thing._running is a metaproperty that signals that the thing is running, i.e. it is true between calls to the thing's start and stop methods.

If an event is fired on the thing, the thing server sends a notification to all proxies:

{
  uri: thing's uri
  event: event name
  data: event data
}

If the proxy invokes an action on the thing it sends the following:

{
  uri: thing's uri
  call: call id
  action: action name
  data: action data
}

The Thing server later sends the action's result (if any) with:

{
  uri: thing's uri
  call: call id
  data: result data
}

JSON based thing descriptions

This is a proposal for a JSON based representation of thing data models for the type system proposed in Issue 119. It is a variant of JSON-LD and intended to provide compact descriptions that will be more appealing to web developers than other more verbose alternatives. The Web of Things is expected to be huge so why shouldn't we design a representation that best suites the needs and preference of Web developers?

Some people may ask why not use JSON schema? JSON Schema has the same role as XML Schema for XML, i.e. you can use it to verify that a JSON structure conforms to a given schema. Using JSON Schema to describe the data models for properties, actions and events would constrain them to the type system defined for JSON. Given that the Web of Things is intended to work with wide range of platforms, this assumption is likely to break.

If we were to adopt JSON Schema for applications where the assumption holds, then in principle it could be applied to the values for properties, actions and events. We could perhaps reference JSON schemas from JSON-LD, or we could define a synthesis of JSON-LD and JSON Schema. Both approaches would be considerably more complex that the approach outlined in this note.

The Web of Things is based upon W3C's Resource Description Framework (RDF), which is very general, and provides the extensibility that we need to meet evolving requirements. In particular, it allows us to define the type system independently of the schema language. We need agreed ways to express the data and interaction model exposed to applications, along with other metadata. Moreover, these ways should be acceptable to the developers, and should be usable on resource constrained devices.

Note that JSON Schema is is not yet a formal standard. It is defined on the json-schema.org website and a set of expired IETF Internet Drafts.

Memory considerations for Thing Descriptions

When an application on one device wants to interact with a remote thing, it can request the platform to create a proxy object for that thing based upon its thing description. Retaining the strings for the names of the properties, actions and events is expensive for resource constrained devices. It is therefore appealing to be able to map these names to numeric symbols which can be used in place of the names, both by the application and for the abstract messages exchanged with the platform hosting the thing. These symbols are scoped to the thing, and the algorithm for the mapping needs to be deterministic way so that all parties agree on the mapping.

For devices where RAM is in short supply, it is appealing to be able to store literals in FLASH memory. This implies the desirability of a way to distinguish what is changeable from what is not. This is analogous to the use of "const" in C++. It would be useful with atomic and compound data. Thing Descriptions should also make it possible for platforms to optimise the storage of data types, e.g. can a number be stored in a single byte or does it need more? Can sets be represented as bit vectors? In summary, Thing Descriptions should enable developers to provide information that platforms can use to optimise the storage and representation of data.

An alternative approach

The description starts with a JSON object with properties for the thing's "properties", "actions" and "events". These are in turn JSON objects with the names for the corresponding properties, actions and events. For example:

{
    "@context" : "http://example.com/foo123",
    "properties" : {
    },
    "actions" : {
    },
    "events" : {
    } 
}

Properties

A property is declared with its name and a JSON object with a set of annotations describing it, e.g.

"temp" : {
    "type" : "number",
    "min" : -20,
    "max" : 100,
    "units" : "celsius"
}

Where min and max act as constraints. Other common constraints include whether a given property is required or optional, whether null is allowed for the value, and for numbers a restriction to integer values. Enumerations could be expressed with an array of distinct values, e.g.

"fruit" : {
   "enum" : ["apple", "pear", "banana"]
}

If you don't need the annotations you can just give the type name as a short cut, e.g.

"switch" : "boolean"

For compound types, you can substitute the type name with a JSON object, e.g.

"location" : {
    "type" : {
       "lat": "number",
       "long" : "number"
    }
}

This can be used recursively for arbitrarily nested properties. Note that this can't be used together with the above short cut to avoid ambiguities between property names and annotations.

For situations where you need many properties with the same rich types, there is a means to declare this type once and refer to it, avoiding the need for redundant declarations, e.g.

"types" : {
    "temperature" : {
        "type" :  "number",
        "min" : -20,
        "max" : 100,
        "units" : "celsius"
    }
}

You can then refer to it using the name you just defined, e.g.

"temp1" : "temperature",
"temp2" : "temperature"

Of course you can use a JSON object when you need to use annotations, e.g. for the sensor location.

Note: an alternative would avoid the need for a separate "types" declaration and instead allow a reference to another property, e.g. "temp2" is declared to have the same type as "temp1".

"temp1" : {
        "type" :  "number",
        "min" : -20,
        "max" : 100,
        "units" : "celsius"
    },
"temp2" : "@temp1"

This could be generalised to allow paths for reuse of the types for sub-properties.

Things as Values

If you want to declare a thing as the value for a given property you use "thing" as the type name, and "uri" for its description, e.g.

"door" : {
    "type" : "thing",
    "uri" : "http://example.com/thing/door12"
}

which refers to a specific door. It may be convenient to use a shared thing description for a set of things, e.g. all of the guest room doors in a hotel. In such cases you can use "model" to refer to the shared description as in:

"door" : {
    "type" : "thing",
    "model" : "http://example.com/thing/door"
    "id" : "door12"
}

Note: I am not sure if "model" is the best name for this, perhaps "class"? Note also that "model" and "id" can also be used a the top level for a thing description.

Events

Events are expressed in the same way as properties.

Actions and Responses

Actions are a little more complicated since you need to specify the type for the actions input and output using "in" and "out" respectively, e.g.

"actions" : {
    "fade" : {
        "in" {
            "value" : "number",
            "time" : number
        }
        "out" : {
       }
    }
}

In this example "out" could have been left out since the action doesn't have any responses. A common annotation for "out" is whether it repeats, i.e. "repeats" : true. Values for events, actions and responses can be things as per the earlier example for properties.

Mapping to RDF

The URI for the thing description is taken as the subject for all of the top level names. These names are mapped to URIs via the context and taken as the predicate. The object for these triples is assigned as a new blank node if the value is a JSON object, or a URI if the value is a type name, in which case the type name is mapped to the URI via the context. This process is recursively applied for nested properties. There is a default context which is applies for names that are not given in the explicit context. As per JSON-LD, you can include "@context" in nested objects with the same operational semantics.

Integrity constraints as expressions

To express richer constraints we may want to explore the use of operator expressions analogous to conditional expressions in programming languages. These could cover constraints that apply across properties, actions and events. It could also include cardinality constraints involving, for example, the number if items in array.

Even richer constraints are best expressed as ontologies for semantic models of particular application domains. A simple example would state if a thing is a temperature sensor then it must define its physical units as one of {kelvin, celsius, fahrenheit}. Such ontologies are analogous to schemas for thing descriptions, whereas a thing description is a schema for the data and interaction model exposed to applications.

Definition of Discovery Methods

Currently, there is only a very brief definition of the different discovery approaches in the Terminology section.

It would be good to have a bit more text on local, nearby, and remote discovery in a dedicated section.

@skdatta Did you have some progress on these scenarios and non-functional requirements? This should go into this document. In the Current Practices document, we will need the implementation aspects.

IG re-charter duration

There was no clear consensus on the duration (or I missed it).

@draggett said

My feeling is that 12 months is too short, and a longer period would be helpful, as otherwise we will be back working on updating the charter in 10 months time. We could perhaps ask for a 24 month charter duration, or time it to last through the 2017 or 2018 TPAC meetings. Note that next time around we need to have a new charter ready for AC review 2 months before the end of the existing charter. If we had a 12 month charter, this would mean starting work on the next charter something like month 8. This is why I feel a 12 month charter is too short.

@sebastiankb agreed on 12 months < duration < 24 months (

@takuki proposed it to last till 2017 TPAC

I agree that 12 months is too short. I would have it end together with the WG charter. Due to the relation between the groups it makes sense to re-charter when the WG needs to re-charter or ends.

When is the the WG charter supposed to end?

Beautify entry page

It would be good if someone would get fancy on the entry page (maybe some W3C artwork and links):
http://w3c.github.io/wot/

its the index.html of the gh-pages branch, so anyone volunteering please just send a pull-request there

[Architecture] input from the current practices doc and the relationship with deployed systems

As I mentioned during the TF-AP call on March 9, the Architecture document is a good starting point for our discussion on the WoT architecture.

I just want to suggest the following points as my initial input for the discussion:

  • update with input from the WoT Current Plactices document and our experience from the plugfest demos.
  • add description and diagram(s) on how to include deployed non-servient components, e.g., legacy network-ready devices.
  • also show examples of deployed systems which include only part of the WoT Servient components.

Structure / concretisation of the scripting API

In order to get the discussion more concrete and to get more structure into the API I added a proposal that could be a base for the plugfest and eventually should get merged into current-practices.

basic difference to the current practices is a single entry point WoT (in order to have less global namespace pollution, something that can be leanly required, checked for presence etc.) - that entry object offers several methods that act as factories for objects to interact with the things themselves.

There are two types of objects defined: consumed things and exposed things, meaning if the script defines the behavior of the thing or if it uses the behavior of the thing. With this trick, we can also model the physical API (GPIOs, sensors, relays, ...) as things and have a "narrow waist".

https://github.com/w3c/wot/tree/master/proposals/restructured-scripting-api

This is meant as a first draft - please review and discuss in this issue.

I'd like to explicitly invite @tobie, @rwaldron, @louaybassbouss to have a look and comment

IG Collaboration - 3.1 W3C Groups

The IG re-charter needs to list the W3C groups with which we want to collaborate. Is the excessive list in https://www.w3.org/2014/12/wot-ig-charter.html realistic or just expected? Should we simply copy it or look for real liaisons?

  • Browser-related groups would be interesting to assess how we could integrate WoT there.
  • Semantics- and sensor-related groups would help for the TD
  • Automotive is interesting due to the cyber-physical aspect
  • Security and privacy groups could provide good reviews and further input
  • ...

@ashimura due to your involvement, you might be the best source here :)

[WG Charter] Text in 2.1 of WG Charter

In 2.1 Thing Descriptions of WG Charter,

  1. There is no definition for Thing Descriptions.
    In order for people outside group to understand well,
    it had better to add a sentence in the beginning of the chapter, e.g. "Thing Descriptions are
    Metadata for describing thing".
  2. It had better that 1st, 2nd and 3rd bullet are reconstruct in accordance with 4 elements described in
    the Thing Description chapter of WoT Current Practice document
    (http://w3c.github.io/wot/current-practices/wot-practices.html#sec-td)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.