W3C home > Mailing lists > Public > public-web-http-desc@w3.org > May 2005

RADL

From: Danny Ayers <danny.ayers@gmail.com>
Date: Wed, 25 May 2005 12:49:17 +0200
Message-ID: <1f2ed5cd050525034967f9d5d6@mail.gmail.com>
To: public-web-http-desc@w3.org

Hi folks,

Good to see the list.

I couldn't help wondering why a Web resource description format like
WADL didn't use the Resource Description Framework. For fun I've
rewritten the WADL syntax example in RDF/XML (below).

I very much like the lightweight design of WADL, though there are
certain aspects I'm not altogether comfortable with. The first is the
way resources are described - a URI identifies a resource, so a URI
'resource' element is rather unnecessary. More useful information is
the nature(s)/role(s) of the resource in the service context. RDF
properties would be an easy, standard way of expressing these (note
that I haven't attempted to refactor this in the RDF/XML below).

The extensive use of XSD typing, especially in the parameters, seems
to run counter to the usual idea of RESTful services being
loosely-coupled. What's there now seems closer to hard-wired RPC. It's
prescriptive rather than descriptive.

An RDF-based alternative could work quite well at this point too,
following the 'missing isn't broken' model [1]. Where parameters were
required, this could be *described* using OWL  cardinality.

I'm also not sure about enumerated representations, especially 'fault'
- again it seems very RPC, rather than allowing for the full range of
HTTP response codes. What I'm trying to say is that 400 isn't a HTTP
fault but is associated with a valid representation of the resource. I
do reckon 'fault' is a desirable piece of information, but would like
(somehow) for it to be pushed up to refer to the application rather
than the transport (or relate one to the other).

[Sorry if you receive another message very like this - mail problems this end]

Cheers,
Danny.

[1] http://rdfweb.org/mt/foaflog/archives/000047.html

--------------------

<?xml version="1.0" standalone="yes"?>
<application
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://research.sun.com/wadl wadl.xsd"
    xmlns:yn="urn:yahoo:yn"
    xmlns:ya="urn:yahoo:api"
    xmlns="http://research.sun.com/wadl"
    xmlns:w="http://research.sun.com/wadl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    xmlns:tns="urn:yahoo:yn">
  
  <types rdf:parseType="Resource">
    <include
	rdf:resource="http://api.search.yahoo.com/NewsSearchService/V1/NewsSearchResponse.xsd"/>
    <include
	rdf:resource="http://api.search.yahoo.com/Api/V1/error.xsd"/>
  </types>
  
  <resources>
    <resource rdf:about="http://api.search.yahoo.com/NewsSearchService/V1/newsSearch">
      <operationRef rdf:resource="#NewsSearch"/>
    </resource>
  </resources>
  
  <operation rdf:parseType="Resource">
    <id>NewsSearch</id>
    <method>get</method>

    <request rdf:parseType="Collection">
      <parameter w:name="appid" w:type="xsd:string" w:required="true"/>
      <parameter w:name="query" w:type="xsd:string" w:required="true"/>
      <parameter w:name="type" w:type="xsd:string"/>
      <parameter w:name="results" w:type="xsd:int"/>
      <parameter w:name="start" w:type="xsd:int"/>
      <parameter w:name="sort" w:type="xsd:string"/>
      <parameter w:name="language" w:type="xsd:string"/>
    </request>

    <response rdf:parseType="Collection">
      <representation w:mediaType="application/xml" w:element="yn:ResultSet"/>
      <fault w:id="SearchError" w:status="400" w:mediaType="application/xml"
	     w:element="ya:Error"/>
    </response>

  </operation>
</application>

(archived at http://dannyayers.com/2005/05/radl.rdf)

-- 

http://dannyayers.com
Received on Wednesday, 25 May 2005 10:49:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 19 December 2010 00:14:50 GMT