1. RESTful Triple Spaces of Things
WoT 2012
´ ˜ ´ ˜
Aitor Gomez-Goiri, Pablo Orduna, Diego Lopez-de-Ipina
DeustoTech - Deusto Institute of Technology, University of Deusto
http://www.morelab.deusto.es
June 19, 2012
4. The Web of Things
Growing connectivity of everyday objects.
How to integrate them? What about using a web compliant
manner?
Scalable interaction, integration with the web world...
But also inherits problems from the web world!
Lack of expressiveness and human orientation ⇒ The
Semantic Web
The SW enables sharing knowledge across different
applications
RESTful Triple Spaces of Things Introduction 4 / 42
5. The Semantic Web
The vision of the Semantic Web is to extend principles of
the Web from documents to data. Data should be
accessed using the general Web architecture using, e.g.,
URI-s; data should be related to one another just as
documents (or portions of documents) are already. This
also means creation of a common framework that allows
data to be shared and reused across application,
enterprise, and community boundaries, to be processed
automatically by tools as well as manually, including
revealing possible new relationships among pieces of
data. [Con11]
RESTful Triple Spaces of Things Introduction 5 / 42
6. Triple Space Computing
Space-based computing
time autonomy
space autonomy
reference autonomy
Uses semantic web to describe knowledge shared between
all the participant nodes
2 applications using standard ontologies can interact among
them automatically enriching one each other.
Requirements: they use the same space and standard and
linked ontologies.
RESTful Triple Spaces of Things Introduction 6 / 42
7. Goal
Adapt TSC to IoT
Fully distributed
The objects or devices manage their own information.
Direct/Route their queries to others.
The participants form a “virtual space”.
Through an HTTP API (a wide range of devices can be part
of TS)
RESTful Triple Spaces of Things Introduction 7 / 42
8. Outline
Introduction
Otsopack
Layers
TS HTTP API
Evaluation
Conclusions
RESTful Triple Spaces of Things Otsopack 8 / 42
9. Our realization of the ideas towards this adaptation are
incarnated on Otsopack Open source project
10. Otsopack Layers
Each Otsopack instance.
RESTful Triple Spaces of Things Otsopack 10 / 42
11. Otsopack TS API
The developers using our
middleware use writing and
reading primitives.
RESTful Triple Spaces of Things Otsopack 11 / 42
12. Data access
To store knowledge and to
reason over it.
RESTful Triple Spaces of Things Otsopack 12 / 42
13. Network layer
Discover new nodes
Consume other nodes’
HTTP API
RESTful Triple Spaces of Things Otsopack 13 / 42
14.
15. About HTTP and TSC
The HTTP verbs retrieve, create, modify or delete web resources
The TS primitives retrieve, create, modify or delete RDF graphs
on a space
(right, to be honest TS also offers a query, which works at space level)
RESTful Triple Spaces of Things Otsopack 15 / 42
16. A RESTful HTTP API
To expose TS querying primitives
HTTP status codes
Using content negotiation
RESTful Triple Spaces of Things Otsopack 16 / 42
17. Outline
Introduction
Otsopack
Evaluation
Case of study 1: XBee
Case of study 2: FoxG20
Case of study 3: Tablet computer
Case of study 4: regular computer
Conclusions
RESTful Triple Spaces of Things Evaluation 17 / 42
18. Goal
Prove the easy adoption of the proposed middleware by different
platforms and its feasibility
⇓
3 different resource-constrained platforms
(and a regular computer is also provided as a baseline for the comparison)
RESTful Triple Spaces of Things Evaluation 18 / 42
19. Reasoning
Which platforms could be able of reasoning over their data?
⇓
RDFS reasoning evaluation
⇓
we used real examples from the SSN ontology
⇓
1. Data structure (TBox)
2. Different measures (ABox)
RESTful Triple Spaces of Things Evaluation 19 / 42
20. XBee gateway platform
ConnectPort R X2 (XBee to IP gateway)
RAM: 8MB
Platform version: Python 2.4
REST libraries: Python Std Lib
Semantic libraries: None
RESTful Triple Spaces of Things Evaluation 20 / 42
21. Case of study 1: XBee
We developed a restricted middleware version using Python
With more than 15 concurrent requests problems were
experienced
RESTful Triple Spaces of Things Evaluation 21 / 42
23. Case of study 2: FoxG20
Python implementation used
Because is lighter
Does not implement all the modules defined
This may be desirable for less powerful devices
Reasoning took a long time
TBox: x17 regular computer, x2 galaxy tab
ABox: x32 - x6 galaxy tab
⇓
should be limited to special occasions
RESTful Triple Spaces of Things Evaluation 23 / 42
25. Case of study 3: Tablet computer
Android implementation used
HTTP request are handled worse than FoxG20
(remember it was a reduced version)
Reasoning was halfway between the FoxG20, but yet far
enough from the regular computer
x6 TBox and x5 ABox
RESTful Triple Spaces of Things Evaluation 25 / 42
26. My Toshiba laptop
Processor: 2.26 GHz Intel Core 2 Duo
RAM: 4GB
Platform version: Java SE 6.0
REST libraries: Restlet
Semantic libraries: Sesame 2.6.4
RESTful Triple Spaces of Things Evaluation 26 / 42
27. Case of study 4: regular computer
The time needed by any reasoning engine to reason requires
much less time than with any other device
⇓
This stresses the open challenge it represents to reason in
resource constrained devices
RESTful Triple Spaces of Things Evaluation 27 / 42
29. Conclusions
We use RESTful interface in our middleware as the key for
building a fully distributed space
Doing so, we ease the adoption of this API in heterogeneous
and constrained devices
Lessons learnt:
For small scenarios using semantic may seem complex
The richer descriptions are beneficial in the long term when
more and more applications share and exploit their knowledge
in spaces
The developer does not have to worry about accessing to
different devices, instead he cares about the data shared in
the conceptual space
Still, each device can be seen as a browsable WoT device
which serves semantic content
RESTful Triple Spaces of Things Conclusions 29 / 42
34. Write
public String write(String spaceURI, Graph ITriples)
throws TSException;
RESTful Triple Spaces of Things Backup slides 34 / 42
35. Read
public Graph read
(String spaceURI, String graphURI, long timeout)
throws TSException;
public Graph read
(String spaceURI, Template template, long timeout)
throws TSException;
RESTful Triple Spaces of Things Backup slides 35 / 42
36. Take
public Graph take
(String spaceURI, String graphURI, long timeout)
throws TSException;
public Graph take
(String spaceURI, Template template, long timeout)
throws TSException;
RESTful Triple Spaces of Things Backup slides 36 / 42
37. Query
public Graph query(String spaceURI, Template template)
throws TSException;
RESTful Triple Spaces of Things Backup slides 37 / 42
38. Dissemination strategies
The technique known as negative broadcasting is implemented
all write operations are executed locally
all read and query operations are propagated to the rest of
the nodes belonging to the same space
(but we are working on other strategies)
RESTful Triple Spaces of Things Backup slides 38 / 42
39. Discovery
Registry based discovery
Multicast based implemented
Easy to adopt new ones: DNS, mDNS, etc.
RESTful Triple Spaces of Things Backup slides 39 / 42
40. TSC API in depth
HTTP request URL
GET /{sp}/query/wildcards/{s}/{p}/{o-uri}
/{sp}/query/wildcards/{s}/{p}/{o-type}/{o-value}
GET /{sp}/graphs/{g}
GET /{sp}/graphs/wildcards/{s}/{p}/{o-uri}
/{sp}/graphs/wildcards/{s}/{p}/{o-type}/{o-value}
DELETE /{sp}/graphs/{g}
DELETE /{sp}/graphs/wildcards/{s}/{p}/{o-uri}
/{sp}/graphs/wildcards/{s}/{p}/{o-type}/{o-value}
RESTful Triple Spaces of Things Backup slides 40 / 42
42. All rights of images are reserved by the
original owners*, the rest of the content is licensed
under a Creative Commons by-sa 3.0 license.
* Michelle Tribe, Oberazzi and Marco Crupi.