Recently I’ve been following Chris Heilmann’s enthusiastic posts about Yahoo! Query Language (YQL). Chris has also written a good introduction to YQL for developers. It’s a SQL-like language for getting data out of open web services. Sort of a single syntax for interacting with a variety of services, such as the APIs for flickr, upcoming or twitter, without needing to know a lot of the detail of those individual services. One of its features is open data tables, which allows you to describe your own web services using a simple XML syntax, not unlike OpenSearch.
Last year we made the National Maritime Museum collections available as OpenSearch RSS feeds. More recently we’ve developed a new manuscripts search which also publishes search results as RSS. After reading Chris’ blog I had a go at writing some YQL table descriptions for those feeds. They’re very simple to write and you can find my examples at
- http://eatyourgreens.org.uk/yql/nmm-search.xml (Collections search)
- http://eatyourgreens.org.uk/yql/nmm-archive-search.xml (Archive catalogue search)
Here are a couple of example queries using those tables. For example, search the NMM art collections for the phrase “tower bridge”:
use 'http://eatyourgreens.org.uk/yql/nmm-search.xml' as nmm.collections.search;
select * from nmm.collections.search where category = 'art' and searchterm = '"tower bridge"'
Or perhaps search the archive catalogue for the phrase “aircraft carrier”:
use 'http://eatyourgreens.org.uk/yql/nmm-archive-search.xml' as nmm.archive.search;
select * from nmm.archive.search where searchterm = '"aircraft carrier"'
The results from YQL queries can be returned as XML or JSON. For an example of using these feeds, have a look at Chris’ Javascript for dynamically retrieving photos from flickr with YQL. I haven’t got any examples using the NMM data at the moment but it’s an interesting way to look at the whole idea of web-based APIs. I particularly like the idea of wrapping these services in a single syntax to simplify writing code to work with them.
Update: Here’s an example using the NMM collection, which I put together for Chris Heilmann’s talk at the museum.
Awesome! Very nice. You’re welcome to add these tables (if you’d like) to the github repository where we are putting up all the open tables.
http://github.com/spullara/yql-tables/tree/master
— Nagesh
[…] a good new overview site out on mobile accessibilityDr.Jim O’Donnell did a good writeup of how he brought the National Maritime Museum data into YQL using Open TablesSam Pullara has two seriously funny kidsApparently Twitter and Google maps can save livesAn […]
[…] The whole thing was initiated by Jim O’Donnell who had spent quite some time with YQL and NMM’s data. […]
Following up on Nagesh’s comment, the Maritime Museum data tables are now part of the YQL community tables on github, under /nmm.
There is also documentation at http://www.nmm.ac.uk/collections/feeds/docs/
[…] Jim wanted to allow people to access data without building an API. All it needed was a simple XML file. […]