kafsemo.org

Mivvi REST on AppEngine

2010-04-24

One thing Mivvi (previously: Mivvi is about television, Larry Sanders and Dr. Katz (SPARQL and Mivvi), The IT Crowd (URIs, Resources and Mivvi)) always lacked was an instant demo. It’s a Java app which means I’ve already lost that part of the audience who have time to click but not to install anything today.

Two parts seemed like natural fits for the web: recognising titles and providing information about things. Wrap them in a servlet, pop it on the web and we’re done.

Demos

The data’s not necessarily current. It’s a tech demo!

(The service provides RDF/XML, but I’m using different notation here. You’re more likely to have an RDF/XML parser; this is easier to read.)

Recognise

Suppose we have a TV listing for some old Simpsons reruns. “Lisa’s Substitute”, say. Let’s ask:

http://mivviweb.appspot.com/recognise/The%20Simpsons%20-%20Lisa%27s%20Substitute

and we get back RDF/XML that tells us:

@prefix mvi: <http://mivvi.net/rdf#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<http://mivviweb.appspot.com/recognise/The%20Simpsons%20-%20Lisa%27s%20Substitute>
mvi:episode
<http://www.tv.com/episode/1317/summary.html#> ;
 rdfs:seeAlso <http://mivviweb.appspot.com/about?subject=http%3A%2F%2Fwww.tv.com%2Fepisode%2F1317%2Fsummary.html%23> .

So, we have an identifier: the thing we asked about is probably <http://www.tv.com/episode/1317/summary.html#>. What is that? We also have a link to ask for more information: <http://mivviweb.appspot.com/about?subject=http%3A%2F%2Fwww.tv.com%2Fepisode%2F1317%2Fsummary.html%23>.

About

Let’s ask!

http://mivviweb.appspot.com/about?subject=http%3A%2F%2Fwww.tv.com%2Fepisode%2F1317%2Fsummary.html%23

Following the suggested link tells us, amongst other things:

@prefix dc: <http://purl.org/dc/elements/1.1/> .

<http://www.tv.com/episode/1317/summary.html#>
dc:title "Lisa's Substitute" ;
dc:date "1991-04-25" ;
mvi:series <http://www.snpp.com/#> .

<http://www.snpp.com/#> dc:title "The Simpsons" ;
 <tag:kafsemo.org,2004:mivvi#category> "Animated".

The full title, original broadcast date (has it really been nineteen years?), the series and its title and category.

Things to try

There are a few other series in there at the moment. Any extra information depends on where the data came from. Of course, RDF is perfect for combining data from multiple sources, and there are very few constraints.

recognise “the larry sanders show 6x11”, about <http://www.startrek.com/startrek/view/series/ANI/episode/22004.html#>, recognise “Dr. Katz - 5x12”.

(Gathering the data is a whole other story.)

(Music: PJ Harvey, “This Mess We’re In”)
(More from this year, or the front page? [K])