April 10, 2006

URL Pipes

This post is just a marker to get me thinking in idle time about about using web services and RESTful URLs like Unix pipes. For those of you who have never used Unix, pipes allow you to use the output of one command as the input to another - so for example I could 'pipe' ('|') a directory listing (ls) straight to my printer (lpr using the command line statement: ls | lpr.

In the same way, consider the following:

- in a post on DOI and OpenURL Resolution I showed a neat trick from Tim Wales that took the output of a DOI lookup and use it as the input to the OU's libezproxy service:
http://libezproxy.open.ac.uk/login?url=http://openurl.open.ac.uk/lfp/LinkFinderPlus/Display?&id=doi:10.1016/S0040-1625(03)00072-6
Here, http://openurl.open.ac.uk/lfp/LinkFinderPlus/Display? takes a DOI and returns a URL for it in a service the OU subscribes to; then http://libezproxy.open.ac.uk/login? takes this information and provides the user with an OU authenticated way in to that service (so the user can read the whole paper, for example).

- or how about this:

http://www.optimalbrowser.com/optimal.php?url=http%3A%2F%2Fouseful.open.ac.uk%2Fpagelinks2opml.php%3Furl%3Dhttp%3A%2F%2Fblogs.open.ac.uk%2FMaths%2Fajh59%2F006023.html&submit=Submit which takes an output from a pagelinks2opml service - http://ouseful.open.ac.uk/pagelinks2opml.php? - and uses it as the input to http://www.optimalbrowser.com/optimal.php?.

In the latter case, note that the 'argument' url has been escaped - '/' are replaced by %2F, their ASCII code number in hexadecimal, as have ':', '?' and '=' for example. This in part helps get round the problem of the optimal.php script knowing which arguments belong to it and which belong to the pagelinks2opml service.

So, the question I want to mull over is - to what extent can web services with RESTful APIs including url= terms be viewed as URL pipes equivalent to Unix pipes, and how can long pipelines (with more than two services) be supported without any ambiguity as to which argument(s) relate to which service.

Posted by ajh59 at April 10, 2006 10:53 AM
Comments