Six degrees of Harry Potter – the first steps…

Posted on July 23, 2010

1


Idea:

All researchers cannot resist the charms of J K Rowling’s Harry Potter; any academic book loan is no more than 6 degrees separated from a Harry Potter book loan.

On the surface, this may seem like a frivolous aim, but the fundamental techniques and APIs used will show patterns and possibilities that have a much wider, more useful and potentially less controversial outcomes.

Planned Steps:

1 – Get ISBNs for J K Rowling works:

Used the OpenLibrary API to get title, ISBN (10 and/or 13) for J K Rowling authored works:

http://openlibrary.org/query.json?type=/type/edition&authors=/authors/OL23919A&limit=1000&title=&isbn_10=&isbn_13=

2 – Load all these ISBNs into a set in Redis, and begin to find related items for all of these:

3 – Find related items of those related items found previously, and repeat once more. This gives up the ‘bottom up’ view of Harry Potter related items

4 – Given a reading list of ISBNs, check each one of those for related items, and recurse through two more levels until an the top-down search hits an ISBN already found in the bottom-up.

Code:

http://github.com/benosteen/SixDegreesOfHarryPotter

The code requires a Redis server to be running on the localhost at the normal port.

Dependancies:

  • redis-py
  • simplejson
  • httplib2

Mendeley client (taken from http://github.com/coderholic/MendeleyClient) requires (python) oauth2. To use the ‘client.py’ wrapper, you need to add you consumer_key and consumer_secret to a file called ‘creds.py’

Progress:

Checking the ISBNs for the Harry Potter books through the Talis Aspire Hackday API (http://twitter.com/robotrobot/status/19282383847) is a slightly depressing process – Only a single ‘hit’ found for one of the records… most of the other checking process looks like this:

Advertisements
Posted in: Uncategorized