IOTDB - Semantic Metadata for the Internet of Things

29
IOTDB.org Semantic Metadata for the Internet of Things Tuesday, 13 May, 14

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

Page 1: IOTDB - Semantic Metadata for the Internet of Things

IOTDB.org•

Semantic Metadata for the Internet of Things

Tuesday, 13 May, 14

Page 2: IOTDB - Semantic Metadata for the Internet of Things

David Janes@dpjanes

[email protected]://imadeit.davidjanes.com/

May 2014

Tuesday, 13 May, 14

Page 3: IOTDB - Semantic Metadata for the Internet of Things

Semantic Metadata

Tuesday, 13 May, 14

Page 4: IOTDB - Semantic Metadata for the Internet of Things

What is it?

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

Tuesday, 13 May, 14

Page 5: IOTDB - Semantic Metadata for the Internet of Things

Primary issues

• What does each field mean?

• What does this message represent?

Tuesday, 13 May, 14

Page 6: IOTDB - Semantic Metadata for the Internet of Things

Secondary issues

• Where is it?

• Who can access it?

• Not addressed in this presentation!

Tuesday, 13 May, 14

Page 7: IOTDB - Semantic Metadata for the Internet of Things

What does each field mean?

Tuesday, 13 May, 14

Page 8: IOTDB - Semantic Metadata for the Internet of Things

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

Page 9: IOTDB - Semantic Metadata for the Internet of Things

Units

• What does temperature refer to?

• degrees Celsius, Fahrenheit … or Kelvin?

Tuesday, 13 May, 14

Page 10: IOTDB - Semantic Metadata for the Internet of Things

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

Page 11: IOTDB - Semantic Metadata for the Internet of Things

What does a message represent?

Tuesday, 13 May, 14

Page 12: IOTDB - Semantic Metadata for the Internet of Things

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

Page 13: IOTDB - Semantic Metadata for the Internet of Things

Classes?

• No!

• There is no neat hierarchy of Things

• Things can fall into many messy categories

Tuesday, 13 May, 14

Page 14: IOTDB - Semantic Metadata for the Internet of Things

Facets

• our solution is “Facets”

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

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

Tuesday, 13 May, 14

Page 15: IOTDB - Semantic Metadata for the Internet of Things

@id

• A constant unique identifier for this Thing

• a IRI!

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

Tuesday, 13 May, 14

Page 16: IOTDB - Semantic Metadata for the Internet of Things

Placement

• Where is it?

• Address

• Lat / Lon

• Building, Floor, Room

• Person? Animal?

Tuesday, 13 May, 14

Page 17: IOTDB - Semantic Metadata for the Internet of Things

How to do it

Tuesday, 13 May, 14

Page 18: IOTDB - Semantic Metadata for the Internet of Things

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

Page 19: IOTDB - Semantic Metadata for the Internet of Things

JSON-LD

• describe Linked Data using JSON

• easy-to-use (sorta)

• plenty o’ software and tools

Tuesday, 13 May, 14

Page 20: IOTDB - Semantic Metadata for the Internet of Things

IOTDB Models

• Write in Javascript

• easy to test, easy to understand

• Compiles to JSON-LD

•npm install iotdb

Tuesday, 13 May, 14

Page 21: IOTDB - Semantic Metadata for the Internet of Things

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

Page 22: IOTDB - Semantic Metadata for the Internet of Things

…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

Page 23: IOTDB - Semantic Metadata for the Internet of Things

Putting it all together

Tuesday, 13 May, 14

Page 24: IOTDB - Semantic Metadata for the Internet of Things

Data

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

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

Tuesday, 13 May, 14

Page 25: IOTDB - Semantic Metadata for the Internet of Things

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

Tuesday, 13 May, 14

Page 26: IOTDB - Semantic Metadata for the Internet of Things

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

Page 27: IOTDB - Semantic Metadata for the Internet of Things

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

Page 28: IOTDB - Semantic Metadata for the Internet of Things

#iotdb

Tuesday, 13 May, 14

Page 29: IOTDB - Semantic Metadata for the Internet of Things

Get in touch!

David Janes@dpjanes

[email protected]://imadeit.davidjanes.com/

Tuesday, 13 May, 14