sentational State Transfer and has been introduced by
Roy Thomas Fielding (Fielding, 2000). It is based on
the assumption that with a few simple operations to
read and write data and a system changing its state
depending on the operations issued, any use cases
in communication can be represented. Variations of
this concept are a basic thread present in information
technology history up to now. The Turing machine
(Turing, 1936) already relied on this simple principle.
The SQL language common in database systems with
its INSERT, SELECT, UPDATE and DELETE oper-
ations is built on this pattern. One of the principles in
early UNIX system development was ”everything is
a file”, thus allowing for manipulation of devices and
compute resources using simple file operations like
open, close, create, read and write. Later on, Kilov
coined the term Create-Read-Update-Delete-pattern
(CRUD, (Kilov, 1990)). The currently widespread
Hypertext Transfer Protocol (HTTP, (Fielding et al.,
1999)) is built around this assumption as well.
Developing a ReSTful web service involves dis-
tributing state and functionalities of a service across
a set of network objects. Objects are manipulated us-
ing only the small set of basic operations provided by
HTTP. This is in contrast to services using an RPC-
paradigm, where a single network object offers a large
number of method invocations.
For demonstration purposes, a prototype around
the following use case has been developed:
• For a group of animals the fattening process is
over.
• The farmer puts together a batch for transport to
the slaughterhouse.
• Data about the animals is readily available.
• Data about the location, where the batch is built,
is readily available.
• The task is to summarize the information about
this batch and present it in a machine-readable
form on the network.
The modules available in agroXML allowed for
building small, self-contained documents able to rep-
resent single objects involved as resources on the web.
For pigs, data concerning sex, eartag and events
related to the animal like weighing or feeding were
laid out in XML instances.
For the prototype, we could rely on unique iden-
tification of single animals. Nevertheless, it is also
possible to address groups of animals, if there are no
unique identifiers available. As a drawback, in the
latter case no data concerning a single animal can be
given.
It is also possible to represent basic information
about the farm in agroXML instances. The objects
Farm and Pig become resources on the web by as-
signing URLs to them. To be able to build a batch,
the objects of which it is comprised must be linked in.
This is achieved by allowing XLinks from the batch
XML instance to point to the single animals contained
within and to the farm. The modelling is generic, so
that other objects might be batched as well by just
linking to them.
In total, the following URL-structure is used for
the service:
farm data: http://example.com/farms/*
animal data: http://example.com/animals/*
batch data: http://example.com/charges/*
While in the example, all network objects in the
service are available on a single domain, the Xlinks
can in principle point anywhere. It is possible to in-
tegrate data offered on other servers of external infor-
mation providers into local applications.
The application shown could also have been built
using message-oriented remote procedure calls using
e. g. SOAP. For this to work, methods for adding pigs
to a batch and for retrieving batch data would have
to have been defined. However, as SOAP messages
are short-lived and as there is no standardized way to
reference objects it is very difficult to add further lay-
ers like e. g. a set of RDF (Ressource Description
Framework, (Klyne and Carroll, 2004)) statements to
relate resources to each other. In contrast, resources
in a ReSTful webservice are persistent from a clients
point of view. This can be the basis to build e. g.
a RDF triple store annotating resources with further
metadata or describing relationships between objects.
As URLs are the principle of identifying objects in
RDF as well as in ReSTful web services, the tech-
nologies play together quite well.
A further disadvantage of the message-oriented
approach using technologies like SOAP is, that the
method calls offered by the server and their parame-
ters have to be known to the client in advance. While
this is no problem as long as there is only a lim-
ited, strictly controlled set of services available (like
e. g. internal to an organisation), it leads to severe
difficulties if an unlimited set of applications is to be
added. While technologies like UDDI theoretically
could provide the necessary object and method publi-
cation functionality, in networks with a large diversity
of system environments dynamic binding of clients
during runtime is currently practically infeasible. In
contrast, in a ReSTful service network, a client can
navigate through an infinitely large set of resources
without requiring detailed knowledge of the complete
set.
Tools to implement services like the one shown
KEOD 2009 - International Conference on Knowledge Engineering and Ontology Development
290