Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Hypermedia System Architecture for a Web of Things

654 views

Published on

System Architecture and Reference Implementation

Published in: Internet
  • Be the first to comment

Hypermedia System Architecture for a Web of Things

  1. 1. Hypermedia Design for Machine Interfaces Part 2 – Hypermedia Architecture and Demonstrator for a Web of Things
  2. 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. 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. 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)
  5. 5. Base Schema Resource Model Application Logic Thing Object Model (Deferred Interface) HATEOAS Driven Discovery Domain Schema Resources Hypermedia Controls Discovery Domain Model Hypermedia Client Resource Logic (Physical I/O)
  6. 6. Base Schema Resource Model Application Logic Thing Object Model (Deferred Interface) HATEOAS Driven Interaction Domain Schema Resources Hypermedia Controls Discovery Domain Model Hypermedia Client Resource Logic (Physical I/O)
  7. 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. 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. 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
  10. 10. Dictionary Mapping of Common REST Transaction Layer { "uriPath": ["/","a", "b"], "uriQuery": {"rt": "test", "obs": "", "if": "core.b"} "contentFormat": "application/link-format+json", "options": {} "method": "GET", "payload": null, "response": { "status": "Success", "code": "204", "reason": "No Content", "contentFormat": "application/link-format+json", "payload": "[{"href":"","rel":"self","rt":"index"}]" } }
  11. 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. 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. 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. 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. 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. 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. 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. 18. Interaction Model Classes WoT Interaction Model Index PropertyEvent Action Capability Subscription Notification Actuation Thing subClassOf
  19. 19. Interaction Model Relationships PropertyEvent Action (Capability) Subscription Notification Actuation Thing Index Capability Notification Capability Index has pointsTo
  20. 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. 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. 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. 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. 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. 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. 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
  27. 27. HATEOAS Response Request Application Logic Resource
  28. 28. State Machine - Discovery App logic Start Error Query Build TOM Capture Link Request Response
  29. 29. State Machine - Interaction App logic Start Error Request Wait Process Resp Retry Request Response
  30. 30. State Machine – Subscribe/Invoke App logic Start Error Select Form Update State Submit Form Request Response Track State more update

×