Semantic Metastandards will Unlock IoT Interoperability

Post on 12-Apr-2017

714 views 1 download

transcript

Semantic Metastandards Will

Unlock IoT Interoperability

David Janes@dpjanes

davidjanes@iotdb.orghttp://iotdb.org/social/imadeit/

October 2015

Introduction

Scope

• Semantics

• The “highest” levels of the stack / APIs

• Not about

• IPv6 v. Thread v BLE

• Weave v. HomeKit

Actuators

• How do I tell something “turn on”

• I don’t care how it does it, just that that it does it

• the concept of "turn on" is basically universal / standard independent

Sensors

• What does { t: 24.0 } mean?

Learning from the Web

• The Web works

• Use URIs

• Use REST

• Use JSON (-like data)

The World TodayParty Like It’s 199[0-9]

All Teh Standardz! • Open Interconnect Consortium

• Thread Group

• AllSeen Alliance

• HyperCat Consortium

• Industrial Internet Consortium

• IoT-GSI

• oneM2M

• Open Mobile Alliance

• Internet of Things (IEE)

• IETF

• IPSO Alliance

• W3C Web of Things Community Group

• W3C Semantic Sensor Network

• ITU Joint Coordination Activity on IoT

Commonalities

• Prescriptive - “Here’s how you do this”

• Roach Motel - “Once you go in you can never go out”

• Complicated - Can a N00b pick it up and use it?

XKCD was wrong

Antistandards

• The industry is actively trying to create more standards

• Malice (IMO)

• “Win the stack”

We’ve Been Here

• Internet Video

• XML

• RPC

• SOAP

• Power!

What’s wrong now?

• Most IoT Standardization efforts are an attempt to recreate the SOAP mistake

• SOAP is not the way to do things

• But how do we do things?…

Proposed Model

Summary

• A Thing has an id and dictionaries

• Dictionaries

• ostate

• istate

• model

• meta

Assertion

• Everything we need to create Interoperability can be done well with this model

• Based on URIs / API / REST / JSON - i.e. how we program the Internet today

Thing ID

• "Globally" Unique ID for all Things

• e.g. Many (but not all) Things provide UUIDs

Dictionaries

• JSON-like dictionaries

• Referenced by URIs

• Manipulate in a “web standard” way

• URI (from id and band)

• PUT / PATCH / GET

istate

• The “input” (toward me) state

• The actual state of the Thing

ostate

• The “output” state

• What we want the state to become

model

• describes terms used in istate and ostate

• "secret sauce"

• JSON-LD

meta

• slow moving data

• e.g.

• name

• facet (what it does)

• zone (where it is)

• reachability

Complete ExampleOn / Off Light

Initial State

Thing

GET /api/lights/1 { "istate": "/api/things/1/istate", "ostate": "/api/things/1/ostate", "model: "https://…/light.jsonld", "meta": "https://…/xxx.json" }

istate

GET /api/lights/1/istate { "o": true }

ostate

GET /api/lights/1/ostate { "o": null }

model

GET https://…/light.jsonld { "iot:attribute": [ { "@id": "#o", "iot:purpose": "iot-purpose:on", "schema:name": "Turn On / Off" } ] }

meta

GET https://…/xxx.json { "schema:name": "On-Off Lamp", "iot:facet": "iot-facet:lighting", "iot:zone": "Living Room" }

"Turn off the light"Phase I - look at model (semantics)

iot-purpose:on

• This means "turn something on / off"

Look it up in model

GET https://…/light.jsonld { "iot:attribute": [ { "@id": "#o", "iot:purpose": "iot-purpose:on", "schema:name": "Turn On / Off", "iot:type": "iot-type:boolean" } ] }

#o is the term

• This is what we will look for in istate and ostate

N.B.

• This is the new thing!

• We can leave the semantics world and manipulate objects "as per usual"

• A more complicated example would have

• units of measure (Fahrenheit sensor)

• what is being measured / controlled, &c

Change StatePhase II - Action with #o

Initial State

GET /api/lights/1/ostate { "o": null }

GET /api/lights/1/istate { "o": true }

The light is off

Send Command

PATCH /api/lights/1/ostate { "o": false }

GET /api/lights/1/istate { "o": true }

The light is off

Interstitial State

GET /api/lights/1/ostate { "o": false }

GET /api/lights/1/istate { "o": true }

Waiting for light to turn on

Final State

GET /api/lights/1/ostate { "o": null }

GET /api/lights/1/istate { "o": false }

The light is on

Reference Implementation

Semantics

• https://iotdb.org/pub

• iot: core definitions

• iot-purpose: sensor and actuators

• iot-unit: units of measure

• iot-facet: facets (what does it do)

HomeStar

• https://homestar.io/about

• https://github.com/dpjanes/iotdb-homestar

• complete reference implementation

HomeStar Modules• homestar-ble

• homestar-denon-avr

• homestar-feed

• homestar-firmata

• homestar-hue

• homestar-lg-smart-tv

• homestar-lifx

• homestar-littlebits

• homestar-rest

• homestar-smart-things

• homestar-sonos

• homestar-template

• homestar-tcp

• homestar-wemo

IoTQL

SET ostate:on = true WHERE iot:facet = "iot:lighting"

HomeStar App

Get in touch! David Janes

@dpjanesdavidjanes@iotdb.org

http://iotdb.org/social/imadeit/