Published using Google Docs
Tutorial hands-on sessions

Hands-on Session 1: Following your nose, music for the minority, the 303 dance, and the transient nature of (wiki) fame

It’s important to note that when working with RDF tools and libraries are your friend. For example, most of the simple demo web user-facing tools are written using the Graphite and ARC PHP libraries.

However, to get an understanding of what’s going on “under the hood” we’re going to use some alternative tools. We’ve tried to find web-based interfaces for ease and speed of access during the tutorial, but we’ve also listed some alternatives you may be able to install on your own machine.

Tool 1: Viewing and converting between RDF serializations

Morph

http://morph.talis.com/

Morph retrieves RDF from a URI and converts it into a serialisation of your choice. We’re going to use it to view some RDF/XML (briefly!) and Turtle.

Alternative web tool: http://triplr.org/

Alternative command-line tools: use “wget” to fetch content, and “rapper” (usually park of the “raptor” package) to convert between serialization.

Example 1: Viewing some RDF/XML, Turtle, and following your nose

  1. Use Morph to view the RDF from http://dbtune.org/jamendo/artist/834
  1. Your browser will now either display the XML serialised RDF, or offer to download it - if the latter, save the XML file and open it in your favourite text editor.
  2. You should be looking at some RDF/XML describing the aspirationally-named group “Music for the Minority”
  1. Now use Morph to view the same RDF (http://dbtune.org/jamendo/artist/834), but this time select “Output” as “Turtle”
  1. Try the above again but with a different artist, identified by the following URI: http://dbtune.org/jamendo/artist/3080
  1. Try starting from some alternate sources of artist information:

Tool 2: Modifying HTTP headers to investigate 303 redirects

AskApache HTTP Headers Tool

http://www.askapache.com/online-tools/http-headers-tool/

This tool enables us to send an HTTP request and view the full response the server replies with (essentially this is debug).

Alternative browser tool: Modify Headers extension for Firefox https://addons.mozilla.org/en-US/firefox/addon/modify-headers/

Alternative command line tool: Use “curl” with the “-H” option and “Accept: application/rdf+xml”.

Example 2: Watching the 303 dance

  1. Using the AskApache HTTP Headers Tool, set:
  1. Note the “303 See Also” code returned, and the “Location” this refers to (paste the location into Morph?).
  2. But principally note that, although this was going on in our earlier example, tools can deal with it transparently if that is the desired.

Hands-on Session 2: Content to negoitiate and how to SPARQL

Example 3: More RDF and content negotiation with the Audio File Repository

  1. Use the AskApache HTTP Headers Tool again on with this URI: http://jamendo.legacy.audiofiles.linkedmusic.org/audiofile/98933
  1. Now use Morph to retrieve and view the RDF. Follow your nose to Jamendo. Make a note of the Jamendo recordings the audio files are encodings of (from the RDF).
  2. Also try:

Example 4: A simple SPARQL query to the the Audio File Repository

  1. We’ve put an web interface for the Audio File Repository SPARQL endpoint up at: http://jamendo.legacy.audiofiles.linkedmusic.org/snorql/
  1. open it in your browser
  2. note that non-human client can connect directly to the endpoint using the SPARQL protocol
  1. When the Collection Builder “grounds” a collection it queries the Audio File repository with a simple query to find any audio files which encode the abstract recordings listed in the (ungrounded) collection:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX mo:
<http://purl.org/ontology/mo/>

SELECT ?audiofile WHERE {
    <http://dbtune.org/jamendo/track/98933> mo:available_as ?audiofile .
    ?audiofile a mo:AudioFile .
}

  1. Substituting in the Jamendo recordings you noted above, try out the query on the Audio File Repository.

Example 5: SPARQLing with Jamando at dbtune

  1. The Collection Builder creates its collections using the RDF and SPARQL endpoint available from dtune
  1. There is a similar SPARQL endpoint web interface for the Jamendo data
  1. Enter the query on slide 50 “SPARQL Queries (3)”
  1. Change the SELECT statement to return all variable by replacing “?artistname” with “*”, i.e.
  1. Try changing the graph pattern. Instead of matching against the title of the album find all artists who have made albums that have a 7th track. Some hints:
  1. Verify your results - list and look at the albums that match within the graph pattern
  1. Do some artists have more than one album with 5 tracks? Does this cause them to be matched multiple times?