hackdiary

XML TV Listings in RDF

In preparation for a TiVoBot that I'm planning to write as a wrapper for scheduling digital WinTV recordings, I've been looking at TV listings data produced by tools from the XMLTV project. I started out using the XML directly and storing it using Berkeley DB XML but soon found (like most of my projects) that I'd be happier if the data was expressed as an RDF model.

The current XMLTV DTD turns out to be pretty RDF-friendly in its structure. This XML example looks very similar as RDF (graph). The major changes I made in the translation were in assigning URIs to channels and programme categories, using identifiers such as http://xmlns.com/2003/rdftv/channel#bbc3.bbc.co.uk and http://xmlns.com/2003/rdftv/category/ananova#News/CurrentAffair, and giving the tv data a namespace under http://xmlns.com. The conversion is performed by some XSLT.

Taking a complete TV feed as RDF, I can now write query code using Redland and Python to print out details of all films on TV this week.

bots python xml Posted by Matt Biddulph at September 7, 2003 05:18 PM

→ inkelog: Listados de XML TV en RDF
→ Raw Blog: TV RDF
→ HOLLOBLOG (º°Áֺε¯): TV RDF

Great idea!

I was thinking in a way to express data like this, so I can say in my FOAF profile that I'm a fan of John Doe and then query data looking for people with similar interests.

I'll be posting about this in my spanish weblog, it's a great, great idea.

inkel

Posted by: inkel on September 8, 2003 10:31 PM

Excellent! I was amazed when I stumbled on xmltv that no-one had so far joined it with RSS 1.0 for viewing in aggregators. Jared Krinke had done some work on it, but decided that current aggregators were just too dumb. But I'm sure your XSLT should only need small tweaks to get it ready for next-generation aggregators (it should be ok for IdeaGraph as-is ;-).

Posted by: Danny on September 12, 2003 10:05 AM

Very cool work. If only I hadn't already finished my project that instead uses an SQL database for storing/querying listings...

My only complaint is that as far as I can tell (from your example) the channels are included within the URIs. I was hoping for a more universal URI scheme so that the RDF data would be the same between two people. That way they could both add data about the same program.

Or perhaps I'm really just wanting something else. Listings hold data about program AIRINGS and not necessarily the programs themselves. Perhaps these two concepts could be split into two different resources for such purposes?

Posted by: Deraj on September 12, 2003 04:49 PM

Great work, but I have to agree with Deraj - to properly express tv listings in RDF a way to express airings is definitely needed - given a certain episode of Friends, say, when is it being aired?

This requires that tv:programmes receive an rdf:about unique identifier. I reckon that the best thing to do here might be to use an xsl string manipulation function to generate an id from a concatenation of title and sub-title, although this is fairly hacky. But we have little more to go on in the XMLTV model. Thoughts?

Posted by: Cormac Twomey on September 16, 2003 09:44 PM