=Paper=
{{Paper
|id=Vol-1488/paper-02
|storemode=property
|title=Autonomous Composition and Execution of REST APIs for Smart Sensors
|pdfUrl=https://ceur-ws.org/Vol-1488/paper-02.pdf
|volume=Vol-1488
|dblpUrl=https://dblp.org/rec/conf/semweb/VenturaVCM15
}}
==Autonomous Composition and Execution of REST APIs for Smart Sensors==
Autonomous Composition and Execution
of REST APIs for Smart Sensors
Daniela Ventura1 , Ruben Verborgh2 , Vincenzo Catania1 , and Erik Mannens2
1 University of Catania - Dpt. of Electrical, Electronic and Computer Engineering
Viale A. Doria 6, 95125 Catania, Italy
{daniela.ventura,vincenzo.catania}@dieei.unict.it
2Ghent University - iMinds - Multimedia Lab
Gaston Crommenlaan 8, B-9050 Ledeberg-Ghent, Belgium
{ruben.verborgh,erik.mannens}@ugent.be
Abstract. Autonomous services discovery, composition and execution is an im-
portant problem in the Machine-to-Machine field. Achieving this objective requires
addressing several issues: a) how to describe in a machine-understandable for-
mat which operations and functionalities an object is able to perform; b) how to
represent the interfaces in unambiguous way and allow two or more machines to
understand the data exchanged with each other; c) how to make a machine able to
aggregate services in order to execute a specific task. Narrowing the domain just
to REST APIs, we propose to semantically describe APIs (exposed by objects or
web servers) using RESTdesc descriptions and to use JSON-LD as data exchange
format. In order to illustrate the straightforward services composition and invo-
cation process, we have implemented a smart client able to generate and execute
plans (sequences of HTTP requests) that satisfy the set of operations which should
be done for ensuring ideal environmental conditions to plants in a garden.
Keywords: Machine-to-Machine, Smart Client, Reasoning, Composition, REST
API, Semantic Descriptions, Autonomous Execution
1 Introduction
Machine-to-Machine (M2M) interactions, the ability of devices to exchange data in
order to execute a task not explicitly required by a human being, has become a promising
domain for the next-generation communications, and is undergoing a rapid spread and
development. M2M communications are expected to grow exponentially in the near
future, aided by the large deployment of sensors, actuators, RFID/NFC tags. Ericsson’s
Media Vision 2020 research has predicted that by 2020 there will be 50 billion con-
nected devices [8], and of these, 12 billion will be used only for machine-to-machine
communications [15]. Therefore, M2M represents a huge potential business opportunity
for companies and is expected to advance our lifes in a significant way, covering a broad
range of vertical markets (e.g. smart homes, cars, smart factories).
The first issue is to describe what functionalities a device provides using a machine-
interpretable format. In other words, each machine has to be able to offer semantic
descriptions of its services. As smart objects are commonly equipped with actuators
2 Daniela Ventura, Ruben Verborgh, Vincenzo Catania, and Erik Mannens
that determine their states, semantic descriptions should also contain information about
the behavior an object applies when its services are invoked. The service composition
problem takes as input a set of service descriptions and a goal, and consists in generating
a plan/workflow represented by a ordered sequence of services that have to be invoked
in order to satisfy the goal. Finally, in order for two (or more) systems to communicate
successfully, there has to be a well-defined and universal semantics on the exchanged
data, and a way for knowing at runtime the used interfaces.
In this paper we present a method to enable machines to automatically compose
and use services through standard semantic technologies. Despite the proliferation of
protocols with which two or more machines could communicate (e.g. Bluetooth Low
Energy, Zigbee, Xbee), we are witnessing the emergence of microcontrollers directly
connected to the Internet and which can host small web servers and then provide
REST APIs. According to the Web of Things (WoT), the physical world becomes thus
“integrable” with traditionally Web services. Therefore, in our work, a machine is, first of
all, a Web server that exposes a hypermedia API, which demands that a server supplied
the possible next steps alongside each resource. That way, an agent does not need to
know in advance how to use an API; instead, it can just follow the links at runtime
through these supplied hypermedia controls [21].
To allow cooperation between machines, we propose to describe the functionalities of
APIs through RESTdesc [22] and to use JSON-LD [13] as data exchange format. Entities
with reasoning abilities will be able to produce plans that involve not only services
exposed by physical objects but also Web services, generating what is commonly known
as “physical mashups”. Instead of specific tools or languages for services composition,
this approach only requires generic Semantic Web reasoners.
In our early work [19], we have showed how the description format RESTdesc
enables functionality-based compositions. Our major progress and contribution given in
this paper consists in to: a) demonstrate, implementing really autonomous clients, how
these services’ mashups can be executed by a machine without human involvement; b)
evaluate a complete cycle from the production to the execution of plan(s) in order to
determine how it can impact in term of time spent and number of requests done from
resource-constrained devices.
The present paper is structured as follows. The next Section contains a brief descrip-
tion on the state of art about already existing methods for describing and composing
REST APIs. In Section 3, we explain the technologies we have adopted and the proposed
approach. As proof of concept about the feasibility and flexibility of the method intro-
duced in this work, a use case has been implemented on the field of smart gardens and is
presented in Section 4. Section 5 contains the evaluation of our approach and Section 6
concludes the paper and provides an overview of future work.
2 Related Work
In this section, we discuss some related works about syntactic and semantic descriptions
of REST APIs and present some existing approaches in services composition.
Autonomous Composition and Execution of REST APIs for Smart Sensors 3
2.1 Methods to describe the syntax and semantic of REST APIs
REST-based services are still almost exclusively described by human-readable doc-
umentation, due to a lack of universal formalism. SA-REST [14], hRESTS [11] are
some ways to describe REST APIs. The REST APIs’ interfaces and their corresponding
meaning, are typically documented in HTML pages. SA-REST leverages this common
practice by annotating those pages with RDFa in order to make the information machine-
interpretable. hRESTS is very similar to SA-REST. The main difference is that hRESTS
uses microformats instead of RDFa. However, for a more complete overview about these
and other methods, we refer to [20].
Other types of approaches to describe the functionality of Web APIs are based on the
definition of specific ontologies. This is the case with the Hydra Core Vocabulary [12]
for hypermedia APIs, which describes hypermedia controls (similar to HTML’s ,
and