Hypermedia System Architecture for a Web of Things
1. Hypermedia Design for Machine
Interfaces
Part 2 – Hypermedia Architecture
and Demonstrator for a Web of
Things
2. Hypermedia Architecture
• Web of Things system architecture and demonstrator
using the Hypermedia Collection with resource type
semantics
• HATEOAS discovery and client-server state machine
• Implements the W3C Web of Things interaction model
• Scripted applications based on a consistent Thing
Object Model
• Public resource like schema.org for common semantics
• Uses IETF CoRE RD, Link-Format, SenML
• Pluggable protocols; Common CRUD interface allows
CoAP, HTTP, MQTT, Websockets, etc.
3. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Hypermedia System Architecture
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
Networks
Client
Server
Public
Resource
Tools
4. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Model Driven Resource Construction
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
7. Modular Architecture
Application Logic
Common CRUD Requests
MQTT
Common CRUD Responses
Resource Model
Resources
Resource Model
Thing Object Model
HTTP
CoA
P
Common Server
Common Client
Pluggable
Protocols
Resource Logic
WS
8. Common CRUD
REST Layer Abstraction
• Transport independent REST abstraction layer
• Does not use REST for message transport
• Instead, create a common abstraction layer
• Map abstraction to HTTP and CoAP request
and response fields
• Encapsulate the abstraction in WS and MQTT
payloads
9. Common CRUD
(IP)
Send/Rcv
(PHY)
Send/Rcv
URI Topic, URI
(IP)
Send/Rcv
(PHY)
(IP)
Pub/Sub
(PHY)
(IP)
Trx
(PHY)
URIURI
REST REST REST
CoAP HTTP MQTT WS CCML
URI
RESTREST
• Map abstraction to HTTP and CoAP request and responses
• Encapsulate the abstraction in WS and MQTT payloads
11. Consistent Resource Identifiers:
Cross-Protocol Hyperlinking
http://example.com:8000/b31/env/light/onoff
coap://example.com:5683/b31/env/light/onoff
ws://example.com:80/b31/env/light/onoff
mqtt://example.com:1883/b31/env/light/onoff
Mapped to URI
Mapped to URI
Part Topic --- Part Payload
Encapsulated in Payload
12. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Resource Model
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
Networks
Client
Server
Public
Resource
Tools
13. Resource Model
• Hypermedia Collections use Content Format
to select resource interaction
• Uses “sub” link relation to create a resource
tree, collections of collections
• Properties, forms, items, and collection
subresources may be mixed in a collection
• Resource Type (the “rt” link attribute) is used
to select domain functionality for resources
14. Resource Model
Link Item
Link Item
Link
Link
Link (self)
(sub)
Link
Collection
Link Item
Link
Link
Link
Item
Link Item
Sub Resource Collection
Collection
Link
Link
Collection
Link
15. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Thing Object Model
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
Networks
Client
Server
Public
Resource
Tools
16. Thing Object Model
• Thing Object Model (TOM) is a container for a
set of resource references
• Application may use the domain schema to
understand terms describing TOM resources
• Provides discovery and interaction model
abstractions in the form of a scripting API
• Client State Machines, Discovery, and Form
Logic
17. Interaction Model
• Interaction model is a set of functional
abstractions that enable application state
machines to be standardized
• The W3C Interaction model consists of
Properties, Events, and Actions
• Properties are resource elements
• Actions and Events are behaviors
• The TOM maps actions and events to
hypermedia forms and POST operations
18. Interaction Model Classes
WoT Interaction Model
Index PropertyEvent Action
Capability
Subscription Notification Actuation
Thing
subClassOf
20. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Domain Schema
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
Networks
Client
Server
Public
Resource
Tools
21. Domain Schema
• Domain Schema is based on a simple
information model and schema
• Logical entities are constrained by range and
domain terms
• Domain specific terms are mapped to the
information model to prodice a domain
schema
• Domain schema is used in resource
construction and discovery
22. Base
Schema
Resource
Model
Application Logic
Thing Object Model
(Deferred Interface)
Information Model
Domain
Schema
Resources
Hypermedia Controls
Discovery
Domain
Model
Hypermedia Client
Resource Logic
(Physical I/O)
Networks
Client
Server
Public
Resource
Tools
23. Information Model
• Descriptions and explanations, not tags; learning
not matching
• Incremental reveal discovery
– light => brightness => change => (targetBrightness,
transitionTime)
• Index search
– GET /index/?rt=“light+brightness+change”
• Schema based on W3C Interaction Model
– Events, Actions, Properties
24. Domain Schema and Model
• Reusable terms with mayHave and usedBy definitions
– “brightness” is used by “light” but not “motion sensor”
– “brightness” may have “change” action but not “reverse”
{
class: brightness,
type: capability,
usedBy: [ light ],
mayHave: [ currentBrightness, targetBrightness,
stepBrightness, moveBrightness,
change, step, move, stop,
propertyValueChange ],
v._params: {_targetValue: _targetBrightness,
_stepSize: _stepBrightness,
_moveRate: _moveBrightness},
description: “brightness control”
}
25. Resource Model Construction
• The Resource Model is made of Collections,
Links, and Forms
• Resource Model Instances are constructed
from Domain Model instances
• A Domain Model applies structural constraints
to a Domain Schems and informs the
constructor which resources to instantiate and
how
26. HATEOAS State Machines
• Describe the coupling between the application
and resources for Discovery and Interaction
Model operations
• Application state machine is coupled with
resource state machine through requests and
responses
• State diagrams show a sequence of operations
from request to response