the other hand, services can also register with the
capability resource. In some sense, the capability
resource is a directory service, like a Sitemap
(Sitemap). But its service description does not
contain any information about how to interact with
the services, which is the focus of our approach.
WADL (Web Application Description
Language) (Hadley 2006) is a XML dialect that
describes REST services, as an equivalent of WSDL
for SOAP based web services. The key elements of
WADL include <resources>, which is a collection of
<resource> elements that describe resources of the
web application. Each <resource> element has a
URI path attribute, a list of <params> elements and
may contain other resources. A <resource> is also
associated with a set of <method> elements, each
having a HTTP verb, <request> and <response>
elements. The <request> and <response> elements
are associated with <representation> elements which
define the media type and root XML element of the
representation. In addition, a <response> element
also contains <fault> element that lists the HTTP
status codes. While WADL codifies the basic
concepts of REST services, it only describes the
static aspects of resources within a web service. If a
web service creates new types of resources, as it
often happens when a web site upgrades, the
corresponding WADL has to be updated
accordingly. This paradigm therefore misses the
dynamic and self-describing facility of REST
services.
hRESTS (Kopecky 2008) is an effort to use
microformat to describe REST services in HTML.
The proposed microformat is based on a functional
service model similar to WSDL. The model is
defined as RDF classes such as service, address,
operation, method, input and output. These class
labels are then used to annotate HTML pages,
including links and forms, in the microformat
fashion. Using the GRDDL framework (GRDDL
2007), XSLT transformations are applied to the
HTML with microformat to extract RDF graph
about the services, to be consumed by the clients.
Although the goal of this approach is very similar to
ours, its service model does not have the notion of
resource. Without modelling resource explicitly, it is
difficult to model the representation of resources and
relations between resources, which in our opinion
are the corner stones of REST.
RDFa (RDFa 2008) and eRDF (eRDF 2006),
both derived from RDF, are more powerful
mechanisms to insert semantic information into
HTML pages, in a fashion similar to microformats.
However, since our primary purpose is to interact
with a web service, instead of inferring properties
about the service, we choose microformat over RDF
for this project. But our approach can use semantic
web if necessary, as a microformat can always be
converted to RDF triples.
Realizing that HTML is not suitable to encode
machine-readable data, many web sites create
“parallel” web services where two types of services,
HTML for human users and XML for machine APIs
are developed. While this approach satisfies both
human and machine, as dual web services intend to
do, it has some drawbacks. First, it increases
development and maintenance cost because the two
web services offer different URIs, representation
formats, functionalities and access methods
(Richardson 2007, page 27). Second, parallel web
services tend to drift apart. As pointed out by
(Richardson 2007, page 96), most web service APIs
are not connected through links and forms, as human
web sites do. The loss of connectedness decreases
the self-describing facility and usability of the
service. Third, the machine APIs cannot be learned
and tested in a web browser as easily as surfing a
web site. Developers have to read manuals and write
code to understand the services. Even though we can
create XSLTs to transform XML documents for
machines into HTML pages for humans, writing
XSLT rules is not a trivial amount of work and it
does not put the human needs first. The dual web
service that we promote is centred on human users
and developers. This is one of the principles of
microformat: “human first and machine second.”
(microformat.org wiki)
3 MICRO-RESOURCE
FRAMEWORK
Our goal is to develop a microformat framework to
enable dual web services, such that one service
implementation is used for both human and machine
consumption. The high-level interactions of duality
of a web service are illustrated in Figure 1, where
the arrows indicate the flow of data between
components.
A micro browser is part of an automaton that
interacts with web services through microformats
and forms. The automaton can be a stand-alone
client application or a component within web
services. But in the dual web service, these use cases
are treated the same.
A human user can interact with a well-designed
web application he never visited before without any
problem. This is because 1) the web pages clearly
describes the interactions using a natural language,
WEBIST 2010 - 6th International Conference on Web Information Systems and Technologies
58