IOTDB - Semantic Metadata for the Internet of Things

Post on 22-Apr-2015

743 views 1 download

description

What is it? You have a simple data record { "on": true, "temperature": 250 } but without metadata there's no easy way to know what this data really is. This short presentation shows how JSON-LD can be used to describe this data, the IOTDB vocabulary for the Internet of Things (https://iotdb.org/pub/), and how the IOTDB software can quickly and easily create "Models" of your data.

Transcript of IOTDB - Semantic Metadata for the Internet of Things

IOTDB.org•

Semantic Metadata for the Internet of Things

Tuesday, 13 May, 14

David Janes@dpjanes

davidjanes@iotdb.orghttp://imadeit.davidjanes.com/

May 2014

Tuesday, 13 May, 14

Semantic Metadata

Tuesday, 13 May, 14

What is it?

{ "on" : true, "temperature" : 225}

Tuesday, 13 May, 14

Primary issues

• What does each field mean?

• What does this message represent?

Tuesday, 13 May, 14

Secondary issues

• Where is it?

• Who can access it?

• Not addressed in this presentation!

Tuesday, 13 May, 14

What does each field mean?

Tuesday, 13 May, 14

Control or Measurement?

• Does on mean:

• Turn it on? or

• Is it on?

• Does temperature mean:

• Set the temperature? or

• What is the temperature?

Tuesday, 13 May, 14

Units

• What does temperature refer to?

• degrees Celsius, Fahrenheit … or Kelvin?

Tuesday, 13 May, 14

And also...

• Is it measuring a specific substance, say O2 or CO concentration?

• we don’t want to mix these up!

• Axis (X / Y / Z)

• Related attributes, say the temperature you are setting vs. the temperature it is

Tuesday, 13 May, 14

What does a message represent?

Tuesday, 13 May, 14

What are we talking about … or with?

• An oven?

• A toaster?

• A sensor in the Large Hadron Collider?

• This is a hard problem

Tuesday, 13 May, 14

Classes?

• No!

• There is no neat hierarchy of Things

• Things can fall into many messy categories

Tuesday, 13 May, 14

Facets

• our solution is “Facets”

• a Thing may have many Facets, e.g.

• appliance, toaster, oven, sensor, a Wikipedia page…

Tuesday, 13 May, 14

@id

• A constant unique identifier for this Thing

• a IRI!

• It does not “evolve” as new readings are made

Tuesday, 13 May, 14

Placement

• Where is it?

• Address

• Lat / Lon

• Building, Floor, Room

• Person? Animal?

Tuesday, 13 May, 14

How to do it

Tuesday, 13 May, 14

Linked Data

• The core of the Semantic Web

• Describe data using triples:

• two objects and their relationship

• Use IRIs to represent all those things

• IRIs go to web pages that “make sense”

Tuesday, 13 May, 14

JSON-LD

• describe Linked Data using JSON

• easy-to-use (sorta)

• plenty o’ software and tools

Tuesday, 13 May, 14

IOTDB Models

• Write in Javascript

• easy to test, easy to understand

• Compiles to JSON-LD

•npm install iotdb

Tuesday, 13 May, 14

Write IOTDB Model…

iotdb.make_model('oven') .attribute( iotdb.control_boolean(":on") ) .attribute( iotdb.control_number(":temperature") .unit(":temperature.si.celsius") )

Tuesday, 13 May, 14

…Get JSON-LD…{ "@id": "#on", "@type": "iot:attribute", "iot:purpose": [ "iot-attribute:on", "iot-attribute:control" ], "iot-js:type": "iot-js:boolean"}…

Tuesday, 13 May, 14

Putting it all together

Tuesday, 13 May, 14

Data

{ "@context": "./meta-iri.jsonld", "on": true, "temperature": 225}

Note: @context is just one way of doing this!

Tuesday, 13 May, 14

Metadata…{ "@id": "#on", "@type": "iot:attribute", "iot:purpose": [ "iot-attribute:on", "iot-attribute:control" ], "iot-js:type": "iot-js:boolean"}…

Tuesday, 13 May, 14

N.B.

• The data does not have to be JSON!

• You don’t need to have IOTDB!

• You don’t need to use IOTDB IRIs (but you should)

• https://iotdb.org/pub/

Tuesday, 13 May, 14

Take aways

• describe the IoT using Linked Data

• Linked Data is IRIs

• IRIs for the IoT are defined by IOTDB

• but unlimited extensibility!

Tuesday, 13 May, 14

#iotdb

Tuesday, 13 May, 14

Get in touch!

David Janes@dpjanes

davidjanes@iotdb.orghttp://imadeit.davidjanes.com/

Tuesday, 13 May, 14