The Web of Things is the latest emergence of a long-lasting field of research.
Cybernetics: Science related to the automatic control of systems in a broad sense, from industrial systems to living organisms.
Ubiquitous & Pervasive Computing, Ambient intelligence: Methods of computation that aim at making computing transparent to users as well as aware of the user's environment through autonomous perception.
Mobile applications using GPS traces inherit from that field of research.
Wireless Sensor Networks: Network that take advantage of the availability of cheaper and smaller computational devices.
Internet of Things: World-scale network that takes advantage of the availability of Radio-Frequency Identification (RFID) and other sensing technologies.
The term "Internet of Things", introduced by Kevin Ashton, first targeted product tracking in supply chains.
Cyber-Physical (Production) Systems: Systems of arbitrary size combining control components and physical equipment.
A CPS can be defined at the level of an entire supply chain.
What, then, is a Thing in the Web of Things?
Any physical object coupled with a computational device or system of any size can be regarded as a Thing.
See device categories listed in the WoT architecture specification.
The Web of Things addresses the main technical problem that comes with increasing numbers of computational devices: interoperability.
"Every kind of thing can have its own kind of reason for being a thing." — Patrick Hayes (Hayes, 1983)
A single Web client can combine heterogeneous Things to build application mashups.
Build from source code and try it out yourself.
See a similar process with human-machine collaboration in action.
The Web client executes an application mashup as a series of HTTP operations.
PUT /pwr/switch HTTP/1.1
Host: device.local
ON
PUT /ac/mode HTTP/1.1
Host: device.local
AUTO
PUT /ac/vent HTTP/1.1
Host: device.local
12
POST /fahrenheit2celsius HTTP/1.1
Host: converter.com
83
PUT /ac/target HTTP/1.1
Host: device.local
25
POST /pick-and-place HTTP/1.1
Host: ur5-robot.local
Content-Type: application/json
{ "from": [6, 5.4], "to": [2.4, 7] }
POST /jobs HTTP/1.1
Host: fan-heater.local
Content-Type: application/json
{ "duration": 10 }
POST /pick-and-place HTTP/1.1
Host: ur5-robot.local
Content-Type: application/json
{ "from": [2.4, 7], "to": [2.4, 2] }
POST /move-from-to HTTP/1.1
Host: plcbot.local
Content-Type: application/json
[ [2.4, 2], [5.1, 2] ]
POST /turn-on HTTP/1.1
Host: fan.local
Content-Type: text/plain
20
Various organizations have their own Web APIs for Things:
Find more Web APIs for the IoT in one of the OpenAPI catalogs.
A minimal Web Thing API was proposed in 2015, to update a Thing's properties, invoke its actions and subscribe to its notifications.
HTTP Method | Resource |
---|---|
GET | {wt} |
GET | {wt}/model |
GET | {wt}/properties |
GET, PUT | {wt}/properties/{id} |
GET | {wt}/actions |
GET, POST | {wt}/actions/{id} |
GET, PUT, DELETE | {wt}/actions/{id}/{actionId} |
GET, POST | {wt}/subscriptions |
What operations of the Web Thing API are also available in previously defined APIs?
Defining a Web interface to Things does not solve all interoperability problems between Things and clients, though.
Representational State Transfer (REST) is a set of architectural constraints for "network-based software" (Fielding, 2000).
The REST constraints have conditioned much of HTTP/1.1, including:
The uniform interface constraint is specific to REST (and the Web).
What are the main pillars of the architecture of the Web?
These are the main sections of the 2004 reference specification: Architecture of the World Wide Web.
These pillars translate into 4 sub-constraints in REST:
Linked Data interfaces are RESTful by construction.
You can render your own navigation graph with the Web Navigation Window browser extension (available for Chrome and for Firefox).
Try to design a non-RESTful architecture for the production line mash-up (last section).
Web clients can do hypermedia navigation by following links and submitting forms.
Web clients can discover properties exposed by Thing as links.
Web clients can discover actions exposed by Things as forms.
GET / HTTP/1.1
Host: device.local
HTTP/1.1 200 OK
Content-Type: application/json
[{ "@type": "Link", "href": "http://device.local/pwr", "rel": "ssn:hasSubSystem" },
{ "@type": "Link", "href": "http://device.local/ac", "rel": "ssn:hasSubSystem" }]
GET /pwr HTTP/1.1
Host: device.local
HTTP/1.1 200 OK
Content-Type: application/json
[{ "@type": "Link", "href": "http://device.local/pwr/switch", "rel": "ssn:hasProperty" }]
GET /ac HTTP/1.1
Host: device.local
HTTP/1.1 200 OK
Content-Type: application/json
[{ "@type": "Link", "href": "http://device.local/ac/mode", "rel": "ssn:hasProperty" },
{ "@type": "Link", "href": "http://device.local/ac/vent", "rel": "ssn:hasProperty" },
{ "@type": "Link", "href": "http://device.local/ac/target", "rel": "ssn:hasProperty" }]
GET / HTTP/1.1
Host: ur5-robot.local
HTTP/1.1 200 OK
Content-Type: application/json
[{ "@type": "Form", "href": "http://ur5-robot.local/pick-and-place", "op": "td:invokeAction" }]
POST /pick-and-place HTTP/1.1
Host: ur5-robot.local
Content-Type: application/json
{ "from": [6, 5.4], "to": [2.4, 7] }
HTTP/1.1 201 Created
Location: http://ur5-robot.local/pick-and-place/invocation1
[no content]
The dominant protocol on the IoT is MQTT. Could REST principles be applied to MQTT?
What would be needed for MQTT to become RESTful is:
REST over MQTT would allow for large-scale asynchronous communication between clients and servers.
An extension to REST integrates further asynchronous operations to REST: A+REST.
In REST over MQTT, clients can only receive a single response after a request on some resource.
In A+REST, clients can watch the resource, receiving arbitrarily many notifications that the resource representation has changed.
A+REST was first described in (Khare, 2004).
CoAP, the Constrained Application Protocol embraces the A+REST architectural style, with the OBSERVE flag on GET operations.
The Hypermedea agent framework also follows the principles of A+REST.
The World Wide Web Consortium (W3C) has initiated a standardization effort to facilitate automated mashups based on semantic descriptions of Things.
What do existing standards such as OpenAPI lack to describe WoT Things?
A translation from W3C WoT Thing Descriptions to OpenAPI and AsyncAPI exists.
But there is no standard that captures both synchronous and asynchronous operations, as in A+REST.
See playground.thingweb.io for examples with OpenAPI and AsyncAPI.
REST is (theoretically) independent of the communication protocol.
A WoT standard should target as many IoT and industrial protocols as possible.
Two more examples:
The W3C Web of Things working group has thus decided to:
The Open Geospatial Consortium (OGC) first used the Web to publish sensor measurements in a unified manner.
The OGC Simple Observation Service (SOS) offers sensor observations and measurements in a standard XML format (O&M).
<om:OM_Observation gml:id="obsTest1">
<om:phenomemonTime>
<gml:TimeInstant>
<gml:timePosition>2010-03-08T16:22:25.00</gml:timePosition>
</gml:TimeInstant>
</om:phenomemonTime>
<om:observedProperty xlink:href="http://sweet.jpl.nasa.gov/2.0/hydroSurface.owl#WaterHeight"/>
<om:result uom="cm">28</om:result>
</om:OM_Observation>
SOS, O&M and other OGC standards are collectively referred to as the Sensor Web Enablement (SWE) framework.
SWE then combined with Semantic Web technologies has become the Semantic Sensor Web.
The Semantic Sensor Web has led to the standardization of the Semantic Sensor Network (SSN) ontology.
On the Semantic Sensor Web, inference rules are used to enrich sensor observations may.
Such inference rules may be relatively simple.
Observation(?obs) &
described(?obs, ?weather) &
FreezingCondition(?weather) &
HighWindCondition(?weather) &
SnowCondition(?weather) &
=> BlizzardCondition(?weather)
Key is not the complexity of inference but the completeness of the knowledge.
Hence, the idea of ubiquitous computing.
Now, what about
an "Actuator Web Enablement"?
Now, what about
a "Thing Web Enablement"?
There is no standard Web model to specify the effects of an actuation.
It is however possible to provide semantics to Things by publishing Thing Models to online repositories.
See the WoT catalogue for a list of model repositories.