hRESTS — a Microformat for RESTful Services
Our work on hRESTS, a microformat to describe RESTful services (co-authored by Jacek Kopecky, Karthik Gomadam and me) has been accepted to a Web Intelligence conference to be held in Sydney, Australia this year in December (the acceptance rate was around 18%). You can download the full paper here.
The value of today’s Web applications is no longer only in providing content to consumers but also in exposing functionality through public APIs designed for machine consumption. Typically, both Web applications and APIs today follow the Web architecture style called REST, and public APIs on the Web are often called “RESTful Web services”. The major problem with today’s RESTful APIs is that they are usually only described in a plain, unstructured HTML documentation useful only to a human developer. From this reason, finding suitable services, composing them (“mashing them up”), mediating between different data formats etc. are currently completely manual tasks.
hRESTS is a microformat for machine-readable descriptions of Web APIs, backed by a simple service model. In general, a microformat is an approach for annotating human-oriented Web pages so that key information is machine-readable. On top of microformats, GRDDL is a mechanism for extracting RDF information from Web pages, particularly suitable for processing microformats. There are already microformats for contact information, geographic coordinates, calendar events, etc.

Figure above depicts the model that the hRESTS uses for HTML annotation. It is derived from the fact that every web application using hyperlinks for linking application’s pages can be seen as a service. Obviously, not every web application can be considered as a RESTful service as it does not necessarily follow the REST architecture style. There are a lot of examples of badly designed RESTful architectures, such as here. We use RDF to represent the model that can be further extended with additional information such as WSMO-Lite service ontology (see my previous post and our paper about WSMO-Lite). In its basic form, the hRESTS annotation for a hotel service is shown below.

In order to extract the meta-data from the annotated HTML document using hRESTS, one needs to know the hRESTS annotation mechanism. For this purpose and in accordance with GRDDL we also provide a XSLT stylesheet that extracts the meta-data in RDF from XHTML pages. You can download the XSLT stylesheet here.
Once the hRESTS is used by RESTful service providers, one can easily build a focused search engine for RESTful services, for example by using Yahoo! BOSS web search in analogical way like BOSS web search can be used for e.g. searching LinkedIn public profiles annotated with hResume microformat. We further plan to submit the hRESTS microformat to microformats.org as well as build extenisions towards semantic annotations which we call MicroWSMO.
RESTful Services and Semantic Descriptions
Today, we had a WSMO phone conference where we discussed the semantic annotations for RESTful services. I have presented the work done by Amit Sheth and his group on SA-REST (see the presentation below and my previous post).
SA-REST, however, does not define any forms of semantic descriptions but assumes that such descriptions will be reused. In this respect, SA-REST is an analogous approach to semantic annotations of WSDL using SAWSDL. In the WSMO WG, we have recently done the work on WSMO-Lite (see our paper in ECOWS 2007 conference) which defines a minimal lightweight service ontology and which can be used for annotations of WSDL services by means of SAWSDL. This is the new approach to augmenting existing service descriptions already available (within or outside of enterprises) in a bottom-up fashion. However, it is important to note that WSMO-Lite is independent on WSDL (and SAWSDL). In this respect, we plan to use WSMO-Lite as a concrete service ontology for annotation of RESTful services, and possibly build on top of SA-REST. This will introduce the second annotation mechanism for WSMO-Lite allowing to use both, WSDL and RESTful services as mechanisms for invocation and communication. We call this annotation mechanism MicroWSMO.
The MicroWSMO together with WSMO-Lite are the core specifications of the upcoming EU funded project SOA4ALL.The goal of this project is to enable SOA architectures in the large-scale Web environment where semantics will play the central role in service provisioning, automation, and scalability.
SA-REST: Semantic Annotations for RESTFul Services
IEEE Internet Computing magazine in its November/December issue published the article authored by Amit Sheth et al. entitled SA-REST: Semantically Interoperable and Easier-to-Use Services and Mashups. They discuss how to enable semantic annotations for RESTful services in an analogical way as SAWSDL does (see my previous post and article on SAWSDL). They define a very simple mechanism to mark input, output, lifting, lowering and fault in the REST specification usually available through some XHTML page and by using RDFa and GRDDL. The main point is that since REST providers usually define the services in a textual form on the web there is no explicit and formal form for definition of input, output or fault schema for messages. SA-REST introduces a micro-format style to their semantic description as part of the REST service specification embedded in a XHTML page.
I only wonder why authors define input and output keywords for SA-REST and do not adopt SAWSDL modelReference. SAWSDL modelReference is more generic annotation you can use for any kind of service description including information model (like they do with input and output) as well as functional (capability such as preconditions and effects) or non-functional descriptions. In my opinion, it would also be handy that the annotation framework is the same as the one introduced by SAWSDL as it would allow to work with independent semantic layer on the top of technologies like WSDL and REST.
What I like in this work is the way how semantic annotations for services can be done using micro-format style to definition of meta-data about resources (in this case XHTML describing a RESTful service). They use RDFa and GRDDL for that purpose. This approach very much complements our work on WSMO-Lite and it is inline with what we plan to further introduce in our conceptual models for services around WSMO. This will all happen in the EU FP7 project SOA4ALL and W3C Incubator Group called SWS-Testbed (Amit contributes to this group with semantic annotations for REST too).
