Research Collection

Master Thesis

Deployment support for an infrastructure for web-enabled devices

Author(s): Mayer, Simon

Publication Date: 2010

Permanent Link: https://doi.org/10.3929/ethz-a-006088021

Rights / License: In Copyright - Non-Commercial Use Permitted

This page was generated automatically upon download from the ETH Zurich Research Collection. For more information please consult the Terms of use.

ETH Library Deployment Support for an Infrastructure for Web-enabled Devices

Master’s Thesis

Simon Mayer [email protected]

Supervisors : Dominique Guinard, Vlad Trifa Prof. Dr. Friedemann Mattern Institute for Pervasive Computing Department of Computer Science ETH Zurich

April 2010

Abstract

After the age of the mainframe (“many humans per computer”) and the period of the PC (“one computer per human”), we are currently experiencing the dawn of the era of ubiquitous computing (“many computers per human”), a time that is expected to lead to the integration of microprocessing and networking capabilities into all kinds of everyday objects. The idea at the very core of a Web of Things is to integrate such smart devices as first-class citizens into the (WWW) and thus allow users to access physical objects via URLs, to browse them and to compose the data they provide and their functionalities into physical mashups.

This thesis explores approaches to incorporating new devices into the Web of Things as well as to combining their services through the use of a distributed management infrastructure. Within the context of extending the Web of Things, we propose a novel architecture for the web-enabling of smart devices and discuss results from a comparison of that alternative with an existing design. Furthermore, we present a meta-program that enables developers to rapidly integrate devices into the Web of Things by automating the implementation of the web server component responsible for exposing these things on the Web. Regarding the facilitated creation of physical mashups that incorporate the data and/or func- tionality of multiple resources on the Web of Things, we introduce the notion of Smart Hubs and present InfraWOT, a concrete implementation of this concept. As a modular, distributed man- agement infrastructure for the Web of Things that focuses on infrastructure-assisted searching and includes a versatile semantic discovery mechanism, InfraWOT fosters the rapid compo- sition of services provided by devices connected to the Web. Additionally, the nodes of this infrastructure feature a maintenance module that provides structure-level self-stabilization and a messaging component that establishes the link between attached devices and different Web 2.0 applications. To illustrate the benefits of such an infrastructure with respect to the combination of functionalities of different devices, we present multiple prototype applications. Zusammenfassung

Wir erleben gegenw¨artigden Anbruch des Zeitalters des ubiquitous computing, einer Entwick- lung, die den Ausklang der Epoche des PCs als Einzelplatzrechner einl¨autetund, im Vergleich mit dem Zeitalter des Grossrechners, gleichzeitig ein grundlegend gegens¨atzliches und vollkom- men neues Paradigma verk¨orpert: An die Stelle der Vielzahl an notwendigen Operatoren um einen einzelnen Computer zu bedienen tritt nun eine Schar an vernetzten smart things, die als allgegenw¨artige,unsichtbare Hintergrundassistenten f¨ur einzelne Menschen agieren. Die Vision eines Web of Things zielt darauf ab, solche Objekte als gleichwertige Mitglieder in das World Wide Web (WWW) zu integrieren, um die von ihnen angebotenen Daten und Funktionen mit- tels seiner Mechanismen (URLs, HTTP, etc.) in physischen Mashups zu verkn¨upfenund es Benutzern zu erm¨oglichen, die physische Welt mit den Mitteln des Web zu begreifen.

In dieser Arbeit untersuchen wir Ans¨atzef¨urdie Integration von vernetzten Ger¨atenund deren Funktionalit¨atin das Web of Things und stellen eine verteilte Managementinfrastruktur vor, die es Benutzern erleichtert, diese zu physischen Mashups zu kombinieren. Um das Web of Things zu erweitern, schlagen wir eine neuartige Architektur f¨urdie Anbindung von vernetzten Dingen an das Web vor und untersuchen deren Vor- und Nachteile im Vergleich mit einer beste- henden Alternative. In diesem Zusammenhang stellen wir ausserdem ein Meta-Programm vor, welches die Implementierung der f¨urdie Web-Darstellung der Ger¨ateeigenschaften zust¨andigen Webserver-Komponente automatisiert und es damit Entwicklern erm¨oglicht, neue Dinge sehr schnell mit dem Web of Things zu verbinden. Um die einfache und schnelle Entwicklung von Mashups zu erm¨oglichen, f¨uhrenwir das Konzept des Smart Hub ein und pr¨asentieren InfraWOT als eine konkrete Implementierung einer In- frastruktur solcher Knoten. Es handelt sich hierbei um eine modulare, verteilte Manage- mentinfrastruktur f¨urdas Web of Things, deren Schwerpunkte auf einem infrastrukturun- terst¨utztenSuchapparat und einem vielseitigen Mechanismus zur semantischen Identifizierung und Eingliederung von schlauen Gegenst¨andenliegen. Damit wird die vereinfachte Kombi- nation der von smart things angebotenen Dienste erm¨oglicht. Die einzelnen Knoten dieser Infrastruktur beinhalten einen Mechanismus zur Selbststabilisierung auf Strukturebene und ein Vermittlungsmodul um die Kooperation zwischen dem Web of Things und verschiedenen Anwendungen des Web 2.0 herzustellen. Anhand einiger implementierter Beispiele – vor allem aus dem Bereich der Mensch-Maschine Interaktion – werden die Vorteile dieser Infrastruktur illustriert. Table of contents

1 Introduction1 1.1 Goals ...... 2 1.2 Contributions ...... 2 1.3 Outline ...... 3

2 Components of the Web of Things5 2.1 Related Work ...... 6

3 Technological Background9 3.1 Representational State Transfer (REST) ...... 9 3.1.1 Restlet ...... 10 3.2 JavaScript Object Notation (JSON) ...... 11 3.3 ...... 11 3.4 OSGi ...... 12

4 Enabling Devices for the Web of Things 15 4.1 Sun Small Programmable Object Technology (SPOT) ...... 16 4.2 Integrating Smart Devices into the Web of Things ...... 16 4.3 A Synchronization-Based Web of Things Driver Architecture ...... 18 4.3.1 The Sun SPOT OnSPOT Software ...... 18 4.3.2 The Sun SPOT Host Software ...... 19 4.4 Evaluation ...... 23 4.4.1 Power Requirements ...... 24 4.4.2 Response Time ...... 24 4.4.3 Age of Retrieved Data ...... 25 4.4.4 Concurrency ...... 25 4.4.5 Protocol Consistency ...... 26 4.5 Summary ...... 26

5 Towards Automatic Enabling of Resources for the Web of Things: AutoWOT 29 5.1 Conceptional Properties of Web-Enabled Resources ...... 30 5.1.1 XML Structure Configuration ...... 30 5.1.2 Push-Based Interaction ...... 32 5.1.3 Semantic Markup of Resources ...... 32 5.2 AutoWOT System Design ...... 33 5.2.1 Interpreter ...... 33 5.2.2 Builder ...... 34 5.3 System Design of AutoWOT-Generated Web Servers ...... 34 5.3.1 Components of a Plain Java AutoWOT Web Server ...... 35 5.3.2 Components of an OSGi-based AutoWOT Web Server ...... 35 5.3.3 Resource Representations and Web Interaction ...... 37 5.4 Examples of Web-enabled Devices ...... 39 5.4.1 Sun SPOT Driver ...... 39 5.4.2 Lego Mindstorms NXT Driver ...... 39 5.4.3 Phidgets RFID Driver ...... 40 5.4.4 Augmented Gaming for the Web of Things: Settlers of Catan ...... 40 5.4.5 Enabling virtual resources for the Web of Things ...... 41 5.5 Summary ...... 41

6 A Distributed Modular Infrastructure for the Web of Things: InfraWOT 43 6.1 Structuring the Web of Things ...... 44 6.2 Technical Design Choices ...... 45 6.3 System Design ...... 45 6.3.1 Modules Overview ...... 46 6.3.2 Discovery Service ...... 47 6.3.3 Querying Service ...... 49 6.3.4 Infrastructure Service ...... 56 6.3.5 Messaging Service ...... 59 6.3.6 Registry Service ...... 62 6.3.7 Aggregation Service ...... 66 6.3.8 Web Interface Service ...... 67 6.4 Summary ...... 69

7 Applications and Prototypes 71 7.1 Miniature Mashups ...... 71 7.1.1 WOTStocks ...... 72 7.1.2 LED Control Mashup ...... 73 7.1.3 Shadow Mashup ...... 73 7.2 WOTic Music Player ...... 73 7.2.1 Technical Details ...... 74 7.2.2 Summary ...... 75 7.3 WOTpong ...... 75 7.4 Summary ...... 76

8 Conclusion and Future Work 77 8.1 Future Work ...... 77 8.2 Conclusion ...... 78 8.3 Acknowledgements ...... 79

Appendices 79

A Hints and How To-s 81 A.1 OSGi Setup ...... 81 A.1.1 Running OSGi Frameworks with DS-support within Eclipse ...... 82 A.2 Sun SPOT Driver Manual ...... 82 A.3 AutoWOT Manual ...... 82 A.4 InfraWOT Manual ...... 85 B InfraWOT REST API 87 B.1 Messaging Service REST API ...... 87 B.2 Discovery Service REST API ...... 90 B.3 Others ...... 91

C Class Diagrams 93 C.1 Class Diagram - Sun SPOT onSPOT Software ...... 93 C.2 Class Diagrams - Sun SPOT Host Software ...... 94 C.2.1 Sun SPOT Host Driver Core Bundle ...... 94 C.2.2 Sun SPOT Host Web Server Bundle ...... 95 C.3 Class Diagram - AutoWOT Deployment Toolkit ...... 96 C.4 Class Diagrams - InfraWOT ...... 97 C.4.1 InfraWOT Discovery Service Bundle ...... 97 C.4.2 InfraWOT Messaging Service Bundle ...... 98

Bibliography 98

Chapter 1 Introduction

The Web of Things (WoT) paradigm [22] is a vision of a World Wide Web that reaches into the physical world by providing a seamless integration of smart devices and considering them as being first-class citizens of the Web. The aim of this approach is that interacting with devices as well as creating new applications by composing their services with existing ones becomes almost as easy as browsing the Web [21] because commonly known Web tools, interaction tech- niques and languages can be directly applied to the real world [22]. Although inspired by the of Things [13], this concept is different in that it aims at us- ing widely deployed and highly accepted protocols and standards known from the “traditional” Web like the Transfer Protocol (HTTP) or Uniform Resource Identifiers (URIs). The Web of Things distinguishes itself from WS-* Web Services in that it does not use HTTP only as a transport protocol to convey specification-conform data but rather directly exposes the functionalities of smart things by adopting a Representational State Transfer (REST)-driven [11], Resource-Oriented Architecture (ROA) [38]. As any information exchange within the Web of Things takes place using one of the four basic HTTP verbs (GET, POST, PUT and DELETE), the entire interaction with smart things can happen via browsers and browser side-kicks thereby virtually eliminating compatibility issues due to vendor-specific protocols and greatly lowering the barrier of entry [37]. Additionally, the Web of Things inherits all the mechanisms that made the Web scalable and successful like caching, load-balancing, indexing and searching [22] and the stateless nature of the HTTP protocol. For making a RESTful service discoverable, it is not necessary to register it to a specific repository [37] – rather, such services can be indexed by “traditional” web search engines and may even provide standardized semantic markup to convey their functionalities and interaction possibilities. Finally, enabling devices to communi- cate via HTTP requires only a fraction of the resources that would be needed for having them support “big” web services based on the Simple Object Access Protocol (SOAP) or similar architectures [21].1

1For a thorough comparison of REST and WS-*, refer to [37] 2 Introduction

However, using HTTP as the basic primitive for building the Web of Things also introduces problems, most prominently the pull-based interaction model of the web that is not suitable for modeling the communication with smart devices with respect to monitoring [22] – we would like devices that are equipped with sensors and monitor their environment to provide their data using an event-based, publish/subscribe mechanism. Another limitation of RESTful services is that the inherent simplicity of REST paradoxically complicates the creation of complex services [21]. To counteract this effect, an infrastructure for the Web of Things is required that provides services on top of resources connected to the WoT, including a mechanism that facilitates the rapid combination of multiple resources for creating advanced mashups. Within the context of web-enabling smart devices, the current way of how we integrate resources that are not HTTP- enabled by themselves seems to have several drawbacks [21] and alternative architectures should be proposed and evaluated. Finally, to support efforts of populating the Web of Things with more devices, it would be very interesting to have a standardized approach to integrating smart things into the WoT.

1.1 Goals

With respect to the limitations mentioned above, several components of the Web of Things should be proposed and implemented in this thesis, most prominently an auxiliary management infrastructure and software tools providing rapid integration of real-world devices into the WoT while building upon and relating to previous projects. In particular, the goals of this thesis are:

Web-Enabling Devices Evaluate, implement and compare approaches to the RESTful in- tegration of devices into the Web of Things. The evaluation should also include REST- enabling several real-world devices.

Infrastructure for the Web of Things Develop, implement and evaluate a modular, dis- tributed infrastructure for the Web of Things that provides additional functionality on top of the integration of devices into the WoT, in particular the ability to efficiently search for services provided by web-enabled devices.

Web 2.0 Integration Propose a method to integrate smart things with different Web 2.0 applications and platforms (e.g. Twitter) via the Web of Things infrastructure to foster interactivity and information sharing and, in particular, enabling physical mashups that involve real-world devices.

1.2 Contributions

In this thesis, we propose an architecture for web-enabling smart things and use it to attach multiple devices (Sun SPOTs, RFID readers, augmented playing fields) to the Web of Things. To foster the rapid integration of further devices, a generic resource model was developed and integrated into a meta-program that semi-automatically builds web server components which expose these smart things as prime citizens of the Web. Furthermore, we designed and implemented a distributed, modular management infrastructure for the Web of Things where the main focus was to enable clients to search for smart devices and their respective functionalities/services thereby facilitating the creation of composite ap- plications. Additionally, the nodes of this infrastructure feature a maintenance module that 1.3. Outline 3 provides structure-level self-stabilization and a messaging component that establishes the con- nection between attached devices and “Information Consumers” like, for instance, Web 2.0 applications such as Twitter or Google Talk.

1.3 Outline

This thesis is structured into the following parts: After an introduction to different com- ponents of the Web of Things and a discussion of related work in Chapter2, we will present some of the major technologies used throughout this work in Chapter3. Chapter4 focuses on driver architectures for the Web of Things and presents a synchronization-based driver design for smart devices. The discussion on ways to web-enable devices is taken one step further in Chapter5, where AutoWOT, a toolkit for the rapid web-enabling of devices, is described. In Chapter6, a management infrastructure for the Web of Things is introduced and its modules, in particular those responsible for querying, infrastructure maintenance and messaging, are de- scribed thoroughly. Chapter7 presents several application prototypes that largely benefit from the proposed driver architecture and infrastructure and in Chapter8, an overall conclusion is given and further steps are motivated. 4 Introduction Chapter 2 Components of the Web of Things

Several terms are used to identify the different components of the Web of Things that will often be referred to in the rest of this thesis. In this section, these and the associated concepts will be introduced and clarified, thereby also describing some more aspects of the WoT. Where appropriate, we will refer to related work that has been done within the context of the Web of Things.

Web of Things Drivers A Web of Things Driver is a piece of software that bridges the gap between the physical world and the World Wide Web by exposing smart things as web resources. Such a driver typically consists of a device driver module that makes a physical device accessible from a computer and a web server component whose task it is to expose a subset of a device’s functionality via the Web and thereby establish the link between HTTP clients and the physical device. However, specific implementations of Web of Things Drivers may differ in how exactly the device is accessed by the software: A driver may either act as a reverse-proxy that relays HTTP requests to devices that themselves contain a web server component [20] or it may decouple the processes of client-driver and driver-device communication. Chapter4 provides detailed information on Web of Things Drivers as well as a description of a concrete implementation of a driver developed in the course of this thesis. In Chapter5, we propose a way of automatically creating the web server component of Web of Things Drivers and thereby enable rapid deployment of smart devices into the WoT.

Smart Things / Smart Devices We refer to all kinds of physical objects that are networked and can therefore be web-enabled using a Web of Things Driver as smart things or smart devices. Examples of such devices are web-enabled sensors, actuators, embedded computers or even complete augmented gaming environments.

Smart Hubs A Smart Hub is a component of the Web of Things that provides advanced services on top of devices that are connected to the Web, in particular services that enable physical mashups i.e. that offer the possibility of having devices interact with each other to 6 Components of the Web of Things provide functionality that goes beyond what each device could present by itself. Every Smart Hub requires modules that discover smart devices and store information on them, a process that is referred to as attaching a resource (i.e. the smart device) to the hub. Additionally, it may provide querying and publishing services on top of the discovered devices and, as one will typically go for a distributed implementation rather than having a central portal that every smart device is attached to, a way of maintaining the structural relationships between hubs within an infrastructure. More detailed information on this concept and its components can be found in Chapter6, where a Smart Hub-based infrastructure for the Web of Things is proposed.

Smart Gateways A Smart Gateway is a software component that enables web-based interac- tion with different kinds of embedded devices. Furthermore, such gateways can be connected to form hierarchical trees [44] and thus represent a concept very similar to the combination of a Smart Hub and Web of Things Drivers for several smart devices within a single software package. Smart Gateways were designed such that users can easily integrate drivers for any em- bedded device or sensor network to expose the device’s functionality as URI-identified resources that are directly accessible on the Web and thus can be manipulated using HTTP [44].

Physical Mashups Web 2.0 Mashups are applications that use information or functionalities provided by external sources to generate more sophisticated services on top of these. One of the pre-eminent examples for such an application is the HousingMaps mashup1 which combines Google Maps2 with Craigslist3 apartment rental/purchase data to create an interactive housing search tool [36]. Physical Mashups are an extension of that paradigm in that they combine real-time data and services provided by smart things to create advanced virtual or physical services [21]. A. Aguilar [1] explores an approach to enable end users to create physical mashup applications by the use of a mobile device – an example of a physical mashup that users are able to generate within that project is an energy-saving application that would start a user’s home heating as soon as he approaches his home by combining information from the user’s mobile phone (i.e. the GPS sensor data) with the functionality of a RESTful plug.

2.1 Related Work

Here we provide an overview of some related work, starting with systems that have been proposed for the web-integrated processing of sensor data and the HTTP-integration of hetero- geneous devices in general.

SenseWeb SenseWeb [28] is a platform that allows people to collect, share and query sensor data. It aims on providing a means to enable the easy registration of sensors and the facilitated development of sensing applications that use these. To interact with the Coordinator module (a centralized server that holds the main ), a SOAP-based API is provided.

Pachube Pachube [24] offers similar services as SenseWeb, i.e. sharing and searching for sensor data, while focusing on sensor environments that provide a contextual reference for sensor data. However, it is based on a centralized repository and devices need to be individually registered before they can publish data which poses problems regarding scalability [44].

1http://www.housingmaps.com 2http://maps.google.com 3http://www.craigslist.org 2.1. Related Work 7

Flexeo Flexeo [45] is an architecture for implementing monitoring solutions based on wireless sensor networks and connecting these to the Internet. By adopting a multi-layer decision- making approach, Flexeo tries to enable hetergeneous application scenarios while minimizing the required amount of redesign and recoding. On its top Supervision layer, it provides a web interface for end users to access and manage the sensor data.

Our approach differs from these architectures with respect to its purely REST-based, dis- tributed architecture where HTTP is used not only for transport but as an application layer protocol to web-enable and mashup devices. The approach taken by TinyREST [31] is similar to ours with respect to the integration of sensors and actuators into the web but introduces the SUBSCRIBE operation as a new HTTP method and thereby violates the REST uniform interface principle in its fundamentals. With respect to the RESTful interaction paradigm, the pico-REST (pREST) [10] system is very similar system to ours. pREST distinguishes between Complex Resources that are represented by static XML documents and may contain context and semantical information using the Resource Description Framework (RDF), Primitive Resources that act as data sinks or sources and Services where HTTP POST requests are interpreted as invocations of the service. Next, we present some interesting projects that build upon the REST principles to create and support physical mashups.

EnergieVisible The EnergieVisible [23] software can be used to easily monitor the power consumption of devices connected to Bluetooth-enabled smart plugs (Ploggs4). The software retrieves all Ploggs in the environment and exposes their functionality (i.e. power consumption data and an on/off switch) via a dynamic, Google Web Toolkit (GWT)-driven web page.

RESTful EPCIS This project [34] focused on exposing the heavy-weight web services of the Electronic Product Code Information Service (EPCIS) standard as a light-weight RESTbased interface that allows to access the service by also using web languages like JavaScript. A mashup was created that contains widgets to visualize the tracked business events and to expose relationships and aggregations of EPCIS data thereby allowing multiple scenarios with respect to supply chain management (goods tracking) or logistics (inventory level history tracking).

Friends and Things The Friends and Things (FaT) project [19] proposes a way of sharing web-enabled devices that relies on existing social networks. As such Web 2.0 applications (such as Facebook and Twitter) increasingly reflect our social relationships, one can simply select friends or groups of friends to share with instead of creating abstract resource access lists or username/password-pairs. This adds to the vision of the Web of Things as a composable ecosystem that fosters the re-using and combining of devices to create physical mashups.

4http://www.plogginternational.com/ 8 Components of the Web of Things Chapter 3 Technological Background

In this chapter, we will introduce some of the major technologies and architectural concepts that were applied during this thesis and motivate the reasons for favoring them. After an introduction to the REST architectural style, the ROA and Restlet that almost every web server component of our software is dependent on in Section 3.1, we will present the JavaScript Object Notation (JSON) as the main data interchange format used throughout this thesis (Section 3.2). We will then introduce Microformats as a way of providing semantic markup for (X)HTML pages in Section 3.3 and describe the OSGi framework as an environment to develop modular applications in Section 3.4.

3.1 Representational State Transfer (REST)

The REST architectural style introduced in Roy Fielding’s doctoral thesis [11] and the Resource-Oriented Architecture (ROA) [38] as a concrete implementation of this style revolve around the central concept of resources and the principles of addressability, the uniform inter- face, statelessness and hypermedia as the engine of application state [12]:

Resources A resource is any component of an application that is important enough to be addressed and has (at least) one URI [38]. Resources can be web sites, weblog entries or lists of open bugs [38] but also physical objects like light sensors, motors or RFID-tagged items. We distinguish between the abstract concept of resources and the representation of a resource which is the data that is actually delivered to an HTTP client and contains any useful information about the current state of a resource. As there can be multiple representations of a single resource (e.g. in different data formats or several languages), the server also has to have a way of selecting the most appropriate representation to return. To support this kind of interaction, HTTP features a mechanism called content negotiation that allows the client to specify the expected response type (or even a preference list of multiple types) within the request, for instance using the Accept or Accept-Language headers [16]. 10 Technological Background

Addressability The principle of addressability states that scoping information (i.e. informa- tion on the resource to interact with) is kept within the URI rather than being transmitted in the body of HTTP requests. Furthermore, when relying on URIs to identify resources, links to resources can be established using a well-known identification scheme [22].

Uniform Interface This principle defines that the server has to be able to determine what to do when a request is received at a specific URI by just looking at the request’s HTTP method. The four basic operations encoded in this header are GET, POST, PUT and DELETE. To give an example, a server at example.com that receives a request the first line of which reads

1 DELETE /users/testuser immediately knows what the client expects it to do: Delete the resource testuser that is a sub- resource of a users-resource attached to example.com. Such a request and the corresponding server action are thus an example of a RESTful service that conforms to the principles of addressability and the uniform interface.

Hypermedia As The Engine Of Application State (HATEOAS) This principle states that resources should provide links to other resources that should be followed by clients to explore the resource structure. The ability of clients to able to discover offered services by simply following links eliminates the need for specific discovery formats [33].

Statelessness The principle of statelessness is automatically followed by HTTP as it provides no interaction possibilities other than request/response. While a common method for introduc- ing state to a user’s session is keeping a server-side state (for instance using session ID that is included in a request), the protocol is still stateless in that the interaction is fully self-contained and does not depend on the context for interpretation [38].

According to [37], REST is the architecture of choice for “tactical, ad hoc integration over the Web (`ala Mashup)” and previous work on integrating sensor networks on the Internet [31, 32] has shown that the lightweight aspect of REST makes it an “ideal candidate for resource- constrained embedded devices to offer services to the world” [20].

3.1.1 Restlet Restlet [35] is a lightweight, open-source REST framework for the Java platform that provides the architectural basis for the web servers within most software developed during this thesis. In our implementations, we use the Noelios Restlet Framework (NRF)1 that is developed in the context of the Restlet project itself. Restlet was preferred over other frameworks because of its full dedication to the REST architectural principles where core REST concepts like resources have equivalent Java artifacts. This, together with provided, specialized components like Ap- plications or Routers greatly simplifies the combination of different resources into REST-based web services.

For more information on the REST architectural style, the ROA and Restlet, we refer to the book “RESTful Web Services” by L. Richardson and S. Ruby [38].

1http://www.noelios.com/products/restlet-framework 3.2. JavaScript Object Notation (JSON) 11

3.2 JavaScript Object Notation (JSON)

The JavaScript Object Notation is a very lightweight information interchange format that has been used by software produced in the course of this thesis as the preferred way of transmitting data. JSON-encoded data is human-readable while at the same time being easily parseable by machines (cf. 3.1). As JSON was first designed as a format to serialize JavaScript objects, its structure is legal JavaScript syntax based upon associative arrays (dictionaries) and any JSON string can be directly evaluated in JavaScript while lightweight libraries exist that enable using it in lots of other languages2. JSON is specified within HTTP content negotiation, its Internet media type (originally MIME type) is application/json.

1 { 2 "tags":["Web of Things", "Resource", "Temperature"], 3 "dtreviewed":"2010-04-07", 4 "description":"This device measures the current temperature.", 5 "reviewer":"testuser", 6 "rating":4.3, 7 "type":"service" 8 }

Listing 3.1: An example of a JSON object that represents a review of a temperature sensor.

3.3 Microformats

Microformats [4] present a very natural and expressive means of adding semantic informa- tion to (X)HTML markup by re-using existing syntax of this language, most prominently the

- and -tags together with their class-attributes. -based is woven transparently into the fabric of (X)HTML pages and has no direct impact on how a site is presented by browsers. As the augmentation of a web page using Microformats provides semantics without having side-effects on how the same site is perceived by humans (Figure 3.3), this technology is especially useful within the Web of Things context, where we strive to offer man-machine as well as machine-machine interfaces. “Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.” [4]

���Wikimedia�Foundation�Inc.

Wikimedia Foundation Inc. ��� �����200�2nd�Ave.�South�#358