SlideShare a Scribd company logo
1 of 28
Hypermedia Design
for
Machine APIs
Web Scale Architecture for the Web of Things
Michael J Koster
14 September 2015
Fielding 4.3 [Fielding2000]
• Hypothesis I: The design rationale behind the WWW
architecture can be described by an architectural style
consisting of the set of constraints applied to the elements
within the Web architecture.
• Hypothesis II: Constraints can be added to the WWW
architectural style to derive a new hybrid style that better
reflects the desired properties of a modern Web
architecture.
• Hypothesis III: Proposals to modify the Web architecture
can be compared to the updated WWW architectural style
and analyzed for conflicts prior to deployment.
What is REST?
• Exchange of state information
between applications and
resources
• Resource State is part of the
application state
• State is exchanged through
representations of the resource
• Application state is updated by
application obtaining a current
representation of the resource
• Resource state is updated by
application transmitting a new
representation of the resource
Application
Resource
Representations of
State Information
What is HATEOAS?
• Hypermedia As The Engine Of Application
State
• Hypermedia is the descriptive metadata about
how to exchange state information between
applications and resources
• An application can read the hypermedia and
automatically consume resources
• Such an interface is machine-understandable
• Hypermedia defines REST [Fielding 2008]
Hypermedia Controls for HTML
• Links and Forms embedded in the resource
representations of web pages constitute a
hypermedia interaction model for HTML
• Links describe how and where to obtain a
resource state representation and how to use
it to update application state
• Forms describe how and where to transmit a
representation of the resource to update the
resource state
How Links Work
• Applications update their state by consuming
resources indicated by links and incorporating
the resource state into the application state
• The semantics of a link are “{Current Context}
has a {Relation Type} Resource at {Target URI}
which has {Target Attributes}” [Hartke2015]
• Relation Type indicates how the Target
Resource is related to the Current Context
• Target Attributes may include media type
Embedding Links
• There are outbound links, described above,
and embedding links
• Embedding links enable the embedding of
resources within the Current Context
• Examples are <img> and <script> tags in HTML
• Linked embedded resources are processed as
part of the Current Context
How Forms Work
• Applications update the state of resources by
submitting representations according to the meta
data instructions provided by the form
• The semantics of a form are “To {Relation Type}
{Current Context}, perform a {Request
Description} to {Target URI} [Hartke2015]
• Relation Type indicates the desired action on the
Current Context, e.g. Add an article to a blog
• A form can also be used with GET to create a
typed outbound link according to a URL template
The Collection Pattern
• Very common design pattern [WEBAPIS]
• Good example of the use of HATEOAS
• Collection is a resource that contains links to resources,
which are items in the collection
• Application uses links to list items and obtain links to
resources in the collection
• Application uses forms to add items to, or remove
items from the collection
• Adding an item to the collection adds a link to a
resource to the collection
• Removing an item from the collection removes the link
to the resource from the collection
Hypermedia Languages
• HTML – Links and Forms embedded in web pages
• Microdata – Schema.org; RDFa metadata
embedded in web pages
• CoRE Link Format (RFC 6690)
• JSON-LD – WoT Thing Description Language
• (Many others)
• How is the hypermedia control exposed in the
API?
• How does it drive application state?
Thing Description Language
• What are Events, Actions, and Properties?
– Elements of the WoT Interaction Model
– Resource Classes with hypermedia controls
• Re-use the semantics of HTML Links and
Forms but for machine interactions
• HATEOAS for machine APIs
The Action Pattern
• Used to invoke Actions on a target resource
• Parameters are controls on the execution of the action
• The Action is invoked with a binding to a particular set of
parameters
• Parameters may be mapped to defined resources or
properties
• Invoking an action creates a reference to a representation
of a new instance of the action scheduled to be executed
on the target resource
• Action instances are reference-able entities that may be
used to modify or cancel the execution of an action which
is currently executing or pending execution
• Actions may be removed from the system after the
completion of execution of the action has been handled
• Actions may use the collection pattern
The Event Pattern - Subscriptions
• Events are emitted from a target resource to
transmit state information asynchronously
• An event may contain a representation of
resource state
• A resource has associated with it a collection of
event types it can emit
• The Subscription pattern is used to associate a
particular event type and condition set with the
invocation of a protocol handler
• Each event type may have an associated
collection of Subscription resources
The Event Pattern – Notifications
• Each event occurrence creates a new resource,
which is added to a collection of event
occurrences for each Subscription
• Each event occurrence may have associated with
it a notification
• A notification is a protocol handler which sends
an event message to a target resource or handler
location defined by a URL
• Sending of event messages may be abstracted by
hypermedia controls embedded in the
Subscription resource
HATEOAS Design for the WoT Interaction Model
Resource
Class
Hypermedia Controls
Actions - Form-like constructs use POST to execute actions based on
parameters mapped to resources
- POST creates a new Action resource and schedules the
action for execution
- Action resources are used to track and control ongoing
execution of actions
Events - Form-like constructs use POST to create and subscribe to
Events
- Events use the Subscription Resource pattern
- Events and Subscriptions are managed in collections
Properties - Links and attributes provide a simple hypermedia control
for getting and setting property values using GET and PUT
- Properties may be of any media type
Hypermedia Controls for Machine APIs
• Some common attributes and semantic
features could be useful for machine APIs
• Describe media types in Actions and Events
• Add parameters to Actions and Events
• Describe Data Types and Data Templates
• Provide for additional methods, PUT, PATCH
• Provide a way to process response codes and
response metadata from the resource
Lighting Domain Example
• Professional lighting controls based on a popular
control model
• Actions for on-off control, dimming, and color
control for various colorspaces are encapsulated
in optional capability modules
• Various control modes are optionally supported:
Change, Step, Move, Toggle
• Control abstractions allow for controllable timed
and smooth transitions between resource states
Control Model for Lighting
light
onOff
level
color
change
toggle
newState:
{enum:off,on}
HS
XY
temperature
change
step
move
targetValue:{units:%}
transitionTime
rate:{units:%/s}
stepSize
stop
transitionTime:{units:s}
change
step
move
targetValue:{units:K,
range:2700-5500}
transitionTime
rate:{units:K/s}
stepSize
transitionTime:{units:s}
stop
light.onOff.change
{newState:on}
light.color.temperature.change
{targetValue:3400,
transitionTime:10}
light.level.change
{targetValue:45,
transitionTime:10}
thing actuators actions parameters application actions {parameters}
(colorspace)
Example Hypertext Links to Properties
hypertext links at resource context = /light
[{
“rel”: “property”,
“href”: “ColorTemp/currentValue”,
“type”: “observable”,
“name”: “ColorTemperature”
},{
“rel”: “property”,
“href”: “ColorTemp/remTime”,
“type”: “observable”,
“name”: “TransitionTimeRemaining”
}]
/light has observable property resources:
“ColorTemperature” at the URI /light/ColorTemp/currentValue
“TransitionTimeRemaining” at the URI /light/ColorTemp/remTime
Hypertext Link to Actuator
hypertext link at resource context = /light
{
“rel”: “action”,
“href”: “ColorTemp”,
“type”: “actuator”,
“name”: “ColorTemperature”
}
“/light has an actuator type action resource named ColorTemperature at
the URI /light/ColorTemp”
Hypertext Form for Change Action
hypertext form at resource context = /light/ColorTemp:
{
“rel”: “action”, “type”: “action”, “name”: “Change”,
“method”: “POST”, “href”: “Actions”
“content-format”: “application/tdlactions+json”,
“parameters”:[ {“name”: “targetValue”, “dataType”: “float”},
{“name”: “transitionTime”,
“dataType”:”float”, “units”: “s”}]
“template”: “{ “changeTemp”: “$targetValue”,
“transTime”: “$transitionTime” }”,
“returns”: [{“responseCode”: “201”,
“responseAction”: “success”
“parameters”: [{“type”: “header”,
“name”: “Location”,
“type”: “href”
“rel”: “actionInstance” }],
]}
To Change the ColorTemperature of /light, POST a template containing targetValue and
transition Time parameters to the resource at /light/ColorTemp/Actions. Expect a
responseCode of 201 if success and expect to find an actionInstance resource pointed to by the
header parameter named “Location”.
Hypertext Form for Step Action
hypertext form at resource context = /light/ColorTemp:
{
“rel”: “action”, “type”: “action”, “name”: “Step”,
“method”: “POST”, “href”: “Actions”
“content-format”: “application/tdlactions+json”,
“parameters”:[ {“name”: “stepSize”, “dataType”: “float”},
{“name”: “transitionTime”,
“dataType”:”float”, “units”: “s”}]
“template”: “{ “stepSize”: “$stepSize”,
“transTime”: “$transitionTime” }”,
“returns”: [{“responseCode”: “201”,
“responseAction”: “success”
“parameters”: [{“type”: “header”,
“name”: “Location”,
“type”: “href”
“rel”: “actionInstance” }],
]}
To Step the ColorTemperature of /light, POST a template containing stepSize and transition
Time parameters to the resource at /light/ColorTemp/Actions. Expect a responseCode of 201 if
success and expect to find an actionInstance resource pointed to by the header parameter
named “Location”.
Hypertext Form for Move Action
hypertext form at resource context = /light/ColorTemp:
{
“rel”: “action”, “type”: “action”, “name”: “Move”,
“method”: “POST”, “href”: “Actions”
“content-format”: “application/tdlactions+json”,
“parameters”:[ {“name”: “moveRate”, “dataType”: “float”,
“units”: “K/s”}]
“template”: “{“rate”: “$moveRate”}”,
“returns”: [{“responseCode”: “201”,
“responseAction”: “success”
“parameters”: [{“type”: “header”,
“name”: “Location”,
“type”: “href”
“rel”: “actionInstance” }],
]}
To Move the ColorTemperature of /light, POST a template containing the moveRate parameter
to the resource at /light/ColorTemp/Actions. Expect a responseCode of 201 if success and
expect to find an actionInstance resource pointed to by the header parameter named
“Location”.
• Can be discovered by the application as the result of a gradual reveal
process guided by an ontology, e.g. ColorTemperature control with
ChangeValue control semantics
• The name can be rendered to the application based on discovered names
populated from well known namespaces e.g. Schema.org
• Actions can be invoked by reusable handlers for well known data and
control models
• Example serialization of an action and invocation using discovered names
with values supplied from a scene controller: action=
my_light.ColorTemperature.Change(targetValue=2900,
TransitionTime=10)
• The hypermedia control generates this transaction: POST
uri=/light/ColorTemp/Actions pl={“changeTemp”: “2900”,
“transTime”: “10”}
• A success response contains the URI of the Action resource in the location
header: 201 Created Location: ac3f5774
• Execution of the action can be controlled through the Action resource:
action.cancel() DELETE uri=/light/ColorTemp/Actions/ac3f5774
Application Interface Mapping
Hypertext Link – CoAP + IPSO Binding
hypertext link at resource context = /light
{
“rel”: “action”,
“href”: “3004/0”,
“type”: “actuator”,
“name”: “ColorTemperature”
}
“/light has an action resource at the URI /light/3004/0 of type actuator
named ColorTemperature”
Hypertext Form – CoAP + IPSO Binding
hypertext form for CoAP binding, resource context = /light/3004/0:
{
“rel”: “action”, “type”: “action”, “name”: “Change”,
“method”: “POST”, “href”: “5052”
“content-format”: “application/ipso+senml+json”,
“parameters”:[ {“name”: “targetValue”, “dataType”: “float”},
{“name”: “transitionTime”,
“dataType”:”float”, “units”: “s”}]
“template”: “[{“n”: “5059”, “v”: “$targetValue”}
{“n”: “5002”, “v”: “$transitionTime”}]”,
“returns”: [{“responseCode”: “2.01”,
“responseAction”: “success”
“parameters”: [{“type”: “header”,
“name”: “Location”,
“type”: “href”
“rel”: “actionInstance” }],
]}
To Change the ColorTemperature of /light, POST a template containing targetValue and
transition Time parameters to the resource at /light/3004/0/5052. Expect a responseCode of
2.01 if success and expect to find an actionInstance resource pointed to by the header
parameter named “Location”
• Example serialization of an action and invocation using
discovered names with values supplied from a scene
controller: action=
my_light.ColorTemperature.Change(targetValue=2900,
TransitionTime=10)
• The IPSO + CoAP hypermedia control generates this request:
POST uri=/light/3004/0/5052
pl=[{“n”:“5059”,“v”:“2900”},{“n”:“5002”,“v”:“10”}]
• A success response contains the URI of the Action resource in
the location header: 2.01 Created Location: 17
• Execution of the action can be controlled through the Action
resource: action.cancel() DELETE
uri=/light/3004/0/5052/17
Uniform Application Interface,
Hypermedia Controls for IPSO + CoAP
References
• [Fielding2000]
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
• [Fielding2008] http://roy.gbiv.com/untangled/2008/rest-apis-
must-be-hypertext-driven
• [WEBAPIS] Richardson, L. and M. Amundsen, "RESTful Web
APIs”, O'Reilly, September 2013.
• [Hartke2015] https://tools.ietf.org/html/draft-hartke-core-
apps-01 https://tools.ietf.org/html/draft-hartke-core-lighting-
00

More Related Content

What's hot

REST APIs for the Internet of Things
REST APIs for the Internet of ThingsREST APIs for the Internet of Things
REST APIs for the Internet of ThingsMichael Koster
 
Object models for interoperability
Object models for interoperabilityObject models for interoperability
Object models for interoperabilityMichael Koster
 
Ipso smart object seminar
Ipso smart object seminarIpso smart object seminar
Ipso smart object seminarMichael Koster
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsMichael Koster
 
CCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTCCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTMichael Koster
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoTMichael Koster
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine HypermediaMichael Koster
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityMichael Koster
 
Restful Asynchronous Notification
Restful Asynchronous NotificationRestful Asynchronous Notification
Restful Asynchronous NotificationMichael Koster
 
Ipso application templates
Ipso application templatesIpso application templates
Ipso application templatesMichael Koster
 
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOpen Mobile Alliance
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming VisualizationGuido Schmutz
 
Building event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemGuido Schmutz
 
Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?Guido Schmutz
 

What's hot (16)

Iottoolkit osiot
Iottoolkit osiotIottoolkit osiot
Iottoolkit osiot
 
REST APIs for the Internet of Things
REST APIs for the Internet of ThingsREST APIs for the Internet of Things
REST APIs for the Internet of Things
 
Object models for interoperability
Object models for interoperabilityObject models for interoperability
Object models for interoperability
 
Ipso smart object seminar
Ipso smart object seminarIpso smart object seminar
Ipso smart object seminar
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for Interoperability
 
Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of Things
 
CCNA-Open-Platform-IoT
CCNA-Open-Platform-IoTCCNA-Open-Platform-IoT
CCNA-Open-Platform-IoT
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT Interoperability
 
Restful Asynchronous Notification
Restful Asynchronous NotificationRestful Asynchronous Notification
Restful Asynchronous Notification
 
Ipso application templates
Ipso application templatesIpso application templates
Ipso application templates
 
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance ObjectsOMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
OMA LwM2M Workshop - Michael Koster, IPSO Alliance Objects
 
Streaming Visualization
Streaming VisualizationStreaming Visualization
Streaming Visualization
 
Building event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka Ecosystem
 
Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?
 

Similar to Hypermedia design for machine apis

API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend IntegrationElewayte
 
Moulding your enterprise with ROA
Moulding your enterprise with ROAMoulding your enterprise with ROA
Moulding your enterprise with ROAshirok
 
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...WSO2
 
Semantic Technologies for Enterprise Cloud Management
Semantic Technologies for Enterprise Cloud ManagementSemantic Technologies for Enterprise Cloud Management
Semantic Technologies for Enterprise Cloud ManagementPeter Haase
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianAPI Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianVahid Rahimian
 
COLLECTION METHODS
COLLECTION METHODSCOLLECTION METHODS
COLLECTION METHODSEssam Obaid
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
Asp introduction
Asp introductionAsp introduction
Asp introductionSireesh K
 
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...Jonathan Ralton
 
REST APIs for an Internet of Things
REST APIs for an Internet of ThingsREST APIs for an Internet of Things
REST APIs for an Internet of ThingsMichael Koster
 
#ImpactSalesforceSaturday:360 degree view of salesforce integrations
#ImpactSalesforceSaturday:360 degree view of salesforce integrations#ImpactSalesforceSaturday:360 degree view of salesforce integrations
#ImpactSalesforceSaturday:360 degree view of salesforce integrationsNew Delhi Salesforce Developer Group
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable linksStephen Richard
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Serverswebhostingguy
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
J2EE Patterns
J2EE PatternsJ2EE Patterns
J2EE PatternsEmprovise
 

Similar to Hypermedia design for machine apis (20)

API & Backend Integration
API & Backend IntegrationAPI & Backend Integration
API & Backend Integration
 
Design patternsforiot
Design patternsforiotDesign patternsforiot
Design patternsforiot
 
Moulding your enterprise with ROA
Moulding your enterprise with ROAMoulding your enterprise with ROA
Moulding your enterprise with ROA
 
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
 
Semantic Technologies for Enterprise Cloud Management
Semantic Technologies for Enterprise Cloud ManagementSemantic Technologies for Enterprise Cloud Management
Semantic Technologies for Enterprise Cloud Management
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid RahimianAPI Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
 
COLLECTION METHODS
COLLECTION METHODSCOLLECTION METHODS
COLLECTION METHODS
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
Asp introduction
Asp introductionAsp introduction
Asp introduction
 
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
SPSNYC14 - Must Love Term Sets: The New and Improved Managed Metadata Service...
 
REST APIs for an Internet of Things
REST APIs for an Internet of ThingsREST APIs for an Internet of Things
REST APIs for an Internet of Things
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
 
#ImpactSalesforceSaturday:360 degree view of salesforce integrations
#ImpactSalesforceSaturday:360 degree view of salesforce integrations#ImpactSalesforceSaturday:360 degree view of salesforce integrations
#ImpactSalesforceSaturday:360 degree view of salesforce integrations
 
Approaches to machine actionable links
Approaches to machine actionable linksApproaches to machine actionable links
Approaches to machine actionable links
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for Interoperability
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for Interoperability
 
J2EE Patterns
J2EE PatternsJ2EE Patterns
J2EE Patterns
 

More from Michael Koster

Ipso smart objects for iot
Ipso smart objects for iotIpso smart objects for iot
Ipso smart objects for iotMichael Koster
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 
MQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMichael Koster
 
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteThe Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteMichael Koster
 
Tools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsTools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsMichael Koster
 
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Michael Koster
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoTMichael Koster
 
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Michael Koster
 
Friend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTFriend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTMichael Koster
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMichael Koster
 

More from Michael Koster (12)

Osiot14 buildout
Osiot14 buildoutOsiot14 buildout
Osiot14 buildout
 
Osiot13 IoT buildout
Osiot13 IoT buildoutOsiot13 IoT buildout
Osiot13 IoT buildout
 
Ipso smart objects for iot
Ipso smart objects for iotIpso smart objects for iot
Ipso smart objects for iot
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
MQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object APIMQTT REST Bridge using the Smart Object API
MQTT REST Bridge using the Smart Object API
 
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki KeynoteThe Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
The Network Effect - Open Source and the Internet Of Things - Helsinki Keynote
 
Tools for the Open Source Internet of Things
Tools for the Open Source Internet of ThingsTools for the Open Source Internet of Things
Tools for the Open Source Internet of Things
 
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
Open Standards for IoT - GSM Workshop on IoT Standards Atlanta 2013
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoT
 
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
Open Horizontal Platform - Web Scale Interoperability for the Internet of Thi...
 
Friend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOTFriend Of A Thing and IoT Resource access control #OSIOT
Friend Of A Thing and IoT Resource access control #OSIOT
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object API
 

Recently uploaded

Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...
Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...
Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...MOHANI PANDEY
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样ayvbos
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiMonica Sydney
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsrahman018755
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsPriya Reddy
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxi191686
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理F
 

Recently uploaded (20)

Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...
Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...
Call girls Service Canacona - 8250092165 Our call girls are sure to provide y...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 

Hypermedia design for machine apis

  • 1. Hypermedia Design for Machine APIs Web Scale Architecture for the Web of Things Michael J Koster 14 September 2015
  • 2. Fielding 4.3 [Fielding2000] • Hypothesis I: The design rationale behind the WWW architecture can be described by an architectural style consisting of the set of constraints applied to the elements within the Web architecture. • Hypothesis II: Constraints can be added to the WWW architectural style to derive a new hybrid style that better reflects the desired properties of a modern Web architecture. • Hypothesis III: Proposals to modify the Web architecture can be compared to the updated WWW architectural style and analyzed for conflicts prior to deployment.
  • 3. What is REST? • Exchange of state information between applications and resources • Resource State is part of the application state • State is exchanged through representations of the resource • Application state is updated by application obtaining a current representation of the resource • Resource state is updated by application transmitting a new representation of the resource Application Resource Representations of State Information
  • 4. What is HATEOAS? • Hypermedia As The Engine Of Application State • Hypermedia is the descriptive metadata about how to exchange state information between applications and resources • An application can read the hypermedia and automatically consume resources • Such an interface is machine-understandable • Hypermedia defines REST [Fielding 2008]
  • 5. Hypermedia Controls for HTML • Links and Forms embedded in the resource representations of web pages constitute a hypermedia interaction model for HTML • Links describe how and where to obtain a resource state representation and how to use it to update application state • Forms describe how and where to transmit a representation of the resource to update the resource state
  • 6. How Links Work • Applications update their state by consuming resources indicated by links and incorporating the resource state into the application state • The semantics of a link are “{Current Context} has a {Relation Type} Resource at {Target URI} which has {Target Attributes}” [Hartke2015] • Relation Type indicates how the Target Resource is related to the Current Context • Target Attributes may include media type
  • 7. Embedding Links • There are outbound links, described above, and embedding links • Embedding links enable the embedding of resources within the Current Context • Examples are <img> and <script> tags in HTML • Linked embedded resources are processed as part of the Current Context
  • 8. How Forms Work • Applications update the state of resources by submitting representations according to the meta data instructions provided by the form • The semantics of a form are “To {Relation Type} {Current Context}, perform a {Request Description} to {Target URI} [Hartke2015] • Relation Type indicates the desired action on the Current Context, e.g. Add an article to a blog • A form can also be used with GET to create a typed outbound link according to a URL template
  • 9. The Collection Pattern • Very common design pattern [WEBAPIS] • Good example of the use of HATEOAS • Collection is a resource that contains links to resources, which are items in the collection • Application uses links to list items and obtain links to resources in the collection • Application uses forms to add items to, or remove items from the collection • Adding an item to the collection adds a link to a resource to the collection • Removing an item from the collection removes the link to the resource from the collection
  • 10. Hypermedia Languages • HTML – Links and Forms embedded in web pages • Microdata – Schema.org; RDFa metadata embedded in web pages • CoRE Link Format (RFC 6690) • JSON-LD – WoT Thing Description Language • (Many others) • How is the hypermedia control exposed in the API? • How does it drive application state?
  • 11. Thing Description Language • What are Events, Actions, and Properties? – Elements of the WoT Interaction Model – Resource Classes with hypermedia controls • Re-use the semantics of HTML Links and Forms but for machine interactions • HATEOAS for machine APIs
  • 12. The Action Pattern • Used to invoke Actions on a target resource • Parameters are controls on the execution of the action • The Action is invoked with a binding to a particular set of parameters • Parameters may be mapped to defined resources or properties • Invoking an action creates a reference to a representation of a new instance of the action scheduled to be executed on the target resource • Action instances are reference-able entities that may be used to modify or cancel the execution of an action which is currently executing or pending execution • Actions may be removed from the system after the completion of execution of the action has been handled • Actions may use the collection pattern
  • 13. The Event Pattern - Subscriptions • Events are emitted from a target resource to transmit state information asynchronously • An event may contain a representation of resource state • A resource has associated with it a collection of event types it can emit • The Subscription pattern is used to associate a particular event type and condition set with the invocation of a protocol handler • Each event type may have an associated collection of Subscription resources
  • 14. The Event Pattern – Notifications • Each event occurrence creates a new resource, which is added to a collection of event occurrences for each Subscription • Each event occurrence may have associated with it a notification • A notification is a protocol handler which sends an event message to a target resource or handler location defined by a URL • Sending of event messages may be abstracted by hypermedia controls embedded in the Subscription resource
  • 15. HATEOAS Design for the WoT Interaction Model Resource Class Hypermedia Controls Actions - Form-like constructs use POST to execute actions based on parameters mapped to resources - POST creates a new Action resource and schedules the action for execution - Action resources are used to track and control ongoing execution of actions Events - Form-like constructs use POST to create and subscribe to Events - Events use the Subscription Resource pattern - Events and Subscriptions are managed in collections Properties - Links and attributes provide a simple hypermedia control for getting and setting property values using GET and PUT - Properties may be of any media type
  • 16. Hypermedia Controls for Machine APIs • Some common attributes and semantic features could be useful for machine APIs • Describe media types in Actions and Events • Add parameters to Actions and Events • Describe Data Types and Data Templates • Provide for additional methods, PUT, PATCH • Provide a way to process response codes and response metadata from the resource
  • 17. Lighting Domain Example • Professional lighting controls based on a popular control model • Actions for on-off control, dimming, and color control for various colorspaces are encapsulated in optional capability modules • Various control modes are optionally supported: Change, Step, Move, Toggle • Control abstractions allow for controllable timed and smooth transitions between resource states
  • 18. Control Model for Lighting light onOff level color change toggle newState: {enum:off,on} HS XY temperature change step move targetValue:{units:%} transitionTime rate:{units:%/s} stepSize stop transitionTime:{units:s} change step move targetValue:{units:K, range:2700-5500} transitionTime rate:{units:K/s} stepSize transitionTime:{units:s} stop light.onOff.change {newState:on} light.color.temperature.change {targetValue:3400, transitionTime:10} light.level.change {targetValue:45, transitionTime:10} thing actuators actions parameters application actions {parameters} (colorspace)
  • 19. Example Hypertext Links to Properties hypertext links at resource context = /light [{ “rel”: “property”, “href”: “ColorTemp/currentValue”, “type”: “observable”, “name”: “ColorTemperature” },{ “rel”: “property”, “href”: “ColorTemp/remTime”, “type”: “observable”, “name”: “TransitionTimeRemaining” }] /light has observable property resources: “ColorTemperature” at the URI /light/ColorTemp/currentValue “TransitionTimeRemaining” at the URI /light/ColorTemp/remTime
  • 20. Hypertext Link to Actuator hypertext link at resource context = /light { “rel”: “action”, “href”: “ColorTemp”, “type”: “actuator”, “name”: “ColorTemperature” } “/light has an actuator type action resource named ColorTemperature at the URI /light/ColorTemp”
  • 21. Hypertext Form for Change Action hypertext form at resource context = /light/ColorTemp: { “rel”: “action”, “type”: “action”, “name”: “Change”, “method”: “POST”, “href”: “Actions” “content-format”: “application/tdlactions+json”, “parameters”:[ {“name”: “targetValue”, “dataType”: “float”}, {“name”: “transitionTime”, “dataType”:”float”, “units”: “s”}] “template”: “{ “changeTemp”: “$targetValue”, “transTime”: “$transitionTime” }”, “returns”: [{“responseCode”: “201”, “responseAction”: “success” “parameters”: [{“type”: “header”, “name”: “Location”, “type”: “href” “rel”: “actionInstance” }], ]} To Change the ColorTemperature of /light, POST a template containing targetValue and transition Time parameters to the resource at /light/ColorTemp/Actions. Expect a responseCode of 201 if success and expect to find an actionInstance resource pointed to by the header parameter named “Location”.
  • 22. Hypertext Form for Step Action hypertext form at resource context = /light/ColorTemp: { “rel”: “action”, “type”: “action”, “name”: “Step”, “method”: “POST”, “href”: “Actions” “content-format”: “application/tdlactions+json”, “parameters”:[ {“name”: “stepSize”, “dataType”: “float”}, {“name”: “transitionTime”, “dataType”:”float”, “units”: “s”}] “template”: “{ “stepSize”: “$stepSize”, “transTime”: “$transitionTime” }”, “returns”: [{“responseCode”: “201”, “responseAction”: “success” “parameters”: [{“type”: “header”, “name”: “Location”, “type”: “href” “rel”: “actionInstance” }], ]} To Step the ColorTemperature of /light, POST a template containing stepSize and transition Time parameters to the resource at /light/ColorTemp/Actions. Expect a responseCode of 201 if success and expect to find an actionInstance resource pointed to by the header parameter named “Location”.
  • 23. Hypertext Form for Move Action hypertext form at resource context = /light/ColorTemp: { “rel”: “action”, “type”: “action”, “name”: “Move”, “method”: “POST”, “href”: “Actions” “content-format”: “application/tdlactions+json”, “parameters”:[ {“name”: “moveRate”, “dataType”: “float”, “units”: “K/s”}] “template”: “{“rate”: “$moveRate”}”, “returns”: [{“responseCode”: “201”, “responseAction”: “success” “parameters”: [{“type”: “header”, “name”: “Location”, “type”: “href” “rel”: “actionInstance” }], ]} To Move the ColorTemperature of /light, POST a template containing the moveRate parameter to the resource at /light/ColorTemp/Actions. Expect a responseCode of 201 if success and expect to find an actionInstance resource pointed to by the header parameter named “Location”.
  • 24. • Can be discovered by the application as the result of a gradual reveal process guided by an ontology, e.g. ColorTemperature control with ChangeValue control semantics • The name can be rendered to the application based on discovered names populated from well known namespaces e.g. Schema.org • Actions can be invoked by reusable handlers for well known data and control models • Example serialization of an action and invocation using discovered names with values supplied from a scene controller: action= my_light.ColorTemperature.Change(targetValue=2900, TransitionTime=10) • The hypermedia control generates this transaction: POST uri=/light/ColorTemp/Actions pl={“changeTemp”: “2900”, “transTime”: “10”} • A success response contains the URI of the Action resource in the location header: 201 Created Location: ac3f5774 • Execution of the action can be controlled through the Action resource: action.cancel() DELETE uri=/light/ColorTemp/Actions/ac3f5774 Application Interface Mapping
  • 25. Hypertext Link – CoAP + IPSO Binding hypertext link at resource context = /light { “rel”: “action”, “href”: “3004/0”, “type”: “actuator”, “name”: “ColorTemperature” } “/light has an action resource at the URI /light/3004/0 of type actuator named ColorTemperature”
  • 26. Hypertext Form – CoAP + IPSO Binding hypertext form for CoAP binding, resource context = /light/3004/0: { “rel”: “action”, “type”: “action”, “name”: “Change”, “method”: “POST”, “href”: “5052” “content-format”: “application/ipso+senml+json”, “parameters”:[ {“name”: “targetValue”, “dataType”: “float”}, {“name”: “transitionTime”, “dataType”:”float”, “units”: “s”}] “template”: “[{“n”: “5059”, “v”: “$targetValue”} {“n”: “5002”, “v”: “$transitionTime”}]”, “returns”: [{“responseCode”: “2.01”, “responseAction”: “success” “parameters”: [{“type”: “header”, “name”: “Location”, “type”: “href” “rel”: “actionInstance” }], ]} To Change the ColorTemperature of /light, POST a template containing targetValue and transition Time parameters to the resource at /light/3004/0/5052. Expect a responseCode of 2.01 if success and expect to find an actionInstance resource pointed to by the header parameter named “Location”
  • 27. • Example serialization of an action and invocation using discovered names with values supplied from a scene controller: action= my_light.ColorTemperature.Change(targetValue=2900, TransitionTime=10) • The IPSO + CoAP hypermedia control generates this request: POST uri=/light/3004/0/5052 pl=[{“n”:“5059”,“v”:“2900”},{“n”:“5002”,“v”:“10”}] • A success response contains the URI of the Action resource in the location header: 2.01 Created Location: 17 • Execution of the action can be controlled through the Action resource: action.cancel() DELETE uri=/light/3004/0/5052/17 Uniform Application Interface, Hypermedia Controls for IPSO + CoAP
  • 28. References • [Fielding2000] http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm • [Fielding2008] http://roy.gbiv.com/untangled/2008/rest-apis- must-be-hypertext-driven • [WEBAPIS] Richardson, L. and M. Amundsen, "RESTful Web APIs”, O'Reilly, September 2013. • [Hartke2015] https://tools.ietf.org/html/draft-hartke-core- apps-01 https://tools.ietf.org/html/draft-hartke-core-lighting- 00