<?php
require '../include/gnomoradio.inc';

my_header(array('title'=>'Gnomoradio Metafile Specification', 'topdir'=>'../', 'page'=>'artists/metafile.php', 'nosidebar'=>'true'));
?>

<center>

<h2>Gnomoradio Metafile Specification</h2>

<p><i>by Jim Garrison</i><br/>May 28, 2004<br/>Updated October 30, 2004</p>

</center>

<p><i>This document describes the specification for RDF files that describe songs, artists, and albums on Gnomoradio.  This specification is a superset of Creative Commons' specification for RDF metadata.  Knowledge of XML is helpful to those reading this document.</i></p>

<h3>Introduction</h3>

<p><a href="http://gnomoradio.org/">Gnomoradio</a> is a peer to peer music playing system that allows independent bands and musicians to promote themselves.  It is an opt-in service for musicians who wish to allow peer to peer file sharing.</p>

<p>As such, it requires technology that allows bands to publish their music along with details about file sharing permissions.  Creative Commons has already designed licenses that fit this description.  These licenses all fall under the same umbrella, and they are supported and maintained in the same way.  In addition, Creative Commons has designed an RDF specification for describing these licenses.</p>

<h3>Gnomoradio RDF Overview</h3>

<p>Unfortunately, CC's current metadata specification is incomplete when it comes to describing files to be shared.  Therefore, we have created our own superset of CC metadata that derives from their RDF classes.  In particular, we have only modified and expanded the section of RDF that applies to CC resources; we have not modified the RDF sections that describe the licenses themselves.  There are a number of modifications we made.</p>

<p>First of all, Gnomoradio separates the notion of a resource (a song/recording) from its representation (a file).  In this way, it understands when multiple files represent the same recording in different formats (mp3, ogg, even different bitrates).  This is crucial to an abstract user interface.  A user should not need to care about file formats.  It is the song that matters, and the program should take care of finding and obtaining the appropriate file to represent that song.</p>

<p>Secondly, Gnomoradio verifies each file that it downloads against a sha1 checksum, which is described in a the RDF metadata describing the file.  This is useful to combat viruses and hoax files on the network.</p>

<p>Finally, there are many other pieces of metadata that Gnomoradio supports that are not specifically mentioned in CC's RDF spec.  These include a location for the band's web site, a place to purchase an album online, cover art for albums, song lyrics, and other useful features.</p>

<p>Another problem with current CC metadata lies in how people implement it.  Often, authors will use <tt>rdf:about=""</tt>, which makes it difficult to determine exactly what the license applies to.  There is usually a written notice to describe what the CC license applies to, but the machine is often left in the dark.  This act makes it easy to embrace and promote CC licenses, but it is not good enough for Gnomoradio to function properly.</p>

<h3>Rainbow Builder</h3>

<p>Understanding of this document is in no way necessary for an artist to be distributed using Gnomoradio.  The easiest way to prepare an RDF document is to use the Rainbow Builder, a web application that will produce this metafile in a user-friendly way.</p>

<p>Hopefully, online music sites will find it beneficial to produce RDF files for the artists that they host in the near future.  This will further lessen the difficulty of creating RDF files for the artist.  In addition, Gnomoradio itself will drive further traffic to these sites and relieve them of bandwidth for distributing audio files.</p>

<h3>Publishing the metafile</h3>

<p>The metafile as described below, or as produced by Rainbow Builder or a similar system, must be published on the world wide web for Gnomoradio to recognize it.</p>

<p>One way to publish a file is to upload it in its entirety to a web server.  The specific mime type is not essential, but it should be something such as text/plain, or ideally application/rdf+xml.</p>

<p>A second way of publishing the metafile that Gnomoradio supports is the embedding of an RDF document within a comment block of an html file.  If this method is chosen, it is important to consider that only one RDF file should be embedded in a given HTML file for Gnomoradio to find it.  Thus, if an HTML document already contains a different type of RDF, it is best to put the Gnomoradio metadata in a separate file.</p>

<h3>RDF Essentials</h3>

<p>People who are unfamiliar with RDF may find it helpful to read an introduction, such as the <a href="http://www.w3.org/TR/rdf-primer/">RDF Primer</a>.</p>

<!--If you are already familiar with XML, there are only a few things that you need to know to begin working with RDF.  Loosely speaking, RDF provides structure to describe "web resources" in general.  

a resource can describe and object - in person or real life

rdf:ID, rdf:about, rdf:resource-->

<h3>Summary of namespaces</h3>

<p>"rdf" is the namespace that describes rdf itself.  "dc" and "dcterms" are built on top of rdf to describe general features of an object.  The "cc" namespace further builds upon this work, describing details of licenses for resources.</p>

<p>Gnomoradio's RDF adds two more namespaces onto this.  The first is rainbow ("rbow"), which is used to describe file resources in a reliable way for file transfers.  The second namespace is gnomoradio, which describes songs, artists, albums, and how they relate to files described by rainbow resources.</p>

<p>Before publishing or describing a song through RDF, it is necessary to describe an actual file that represents that song.  Rainbow resources represent files of any type--audio, images, etc, that can be transferred via peer to peer.  They are most often licensed under a Creative Commons license, so that file sharing can take place legally.</p>

<p>Songs and albums are then described in the gnomoradio namespace with links to the rainbow resources that represent them.  This may seem more straightforward after looking at an example.</p>

<p>Here is a sample RDF file, which in its totality represents four songs off the album <a href="http://www.tommymagik.com/discography/">Science in the Hand of an Angry God</a> by <a href="http://www.tommymagik.com/">Tommy Magik and the Wonderfulls</a> (the author's band).  Only part of the file is shown below, describing the album itself and one of the four songs.  The full file is available at <a href="http://www.tommymagik.com/discography/science.rdf">http://www.tommymagik.com/discography/science.rdf</a>.</p>

<table border="0">
<tr><td><pre>&lt;?xml version="1.0"?&gt;</pre></td><td>The standard XML 1.0 header</td></tr>
<tr><td><pre>&lt;rdf:RDF xmlns="http://gnomoradio.org/gnomoradio/1.0.rdf#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:dcterms="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:cc="http://web.resource.org/cc/"
    xmlns:rbow="http://gnomoradio.org/rainbow/1.0.rdf#"</pre></td><td>This begins the RDF block, and declares the XML namespaces that will be used.  From the ground up, this includes rdf, dc, dcterms, cc, rbow, and gnomoradio.  Notice that the default (implicit) namespace is gnomoradio for the rest of the file.</td></tr>
<tr><td><pre>    xml:base="http://www.tommymagik.com/discography/science.rdf"&gt;</pre></td><td>This tag is optional.  If it exists, it is very important that this point to the actual URL where the file (itself) can be retrieved.  Every <tt>#something</tt> URL will be fetched relative to what this URL is set to (which should be the current file)</td></tr>
<tr><td><pre>
&lt;Album rdf:ID="science"&gt;</pre></td><td>This begins the description of an album, which is not necessary for a song to be on Gnomoradio.  Given this ID, the album can now be referred to with the URL <tt>http://www.tommymagik.com/discography/science.rdf#science</tt>.</td></tr>
<tr><td><pre>  &lt;dc:title&gt;Science in the Hands of an Angry God&lt;/dc:title&gt;</pre></td><td>The title of the album</td></tr>
<tr><td><pre>  &lt;dc:creator rdf:resource="http://www.tommymagik.com/tmatw.rdf#tmatw"/&gt;
  &lt;dc:rights rdf:resource="http://www.tommymagik.com/tmatw.rdf#tmatw"/&gt;</pre></td><td>Links to the creator and holder of the rights to the album.  This should link to the RDF description of an artist, which is described later in this document.</td></tr>
<tr><td><pre>  &lt;dc:date&gt;2002-6-27&lt;/dc:date&gt;</pre></td><td>Date the album was/will be released (optional)</td></tr>
<tr><td><pre>  &lt;retail rdf:resource="http://www.tommymagik.com/discography/"/&gt;</pre><td>a link to a site with information about purchasing the album (optional)</td></tr>
<tr><td><pre>  &lt;img src="http://www.tommymagik.com/images/dinosaur-opening.jpg"/&gt;</pre></td><td>An image that can be used to described the album (optional)</td></tr>
<tr><td><pre>  &lt;tracks&gt;
    &lt;rdf:Seq&gt;
      &lt;rdf:li&gt;We Can Turn to Ronnie James Dio&lt;/rdf:li&gt;
      &lt;rdf:li rdf:resource="#glassheart"/&gt;
      &lt;rdf:li&gt;Hide and Seek&lt;/rdf:li&gt;
      &lt;rdf:li rdf:resource="#grundel"/&gt;
      &lt;rdf:li&gt;Darwinian Love Song&lt;/rdf:li&gt;
      &lt;rdf:li&gt;Raging Asexual Disaster&lt;/rdf:li&gt;
      &lt;rdf:li&gt;Malachi Alladbay&lt;/rdf:li&gt;
      &lt;rdf:li rdf:resource="#firefly"/&gt;
      &lt;rdf:li&gt;Sweet Ginger&lt;/rdf:li&gt;
      &lt;rdf:li rdf:resource="#robot"/&gt;
      &lt;rdf:li&gt;David Bowie was an Open Door&lt;/rdf:li&gt;
    &lt;/rdf:Seq&gt;
  &lt;/tracks&gt;</pre></td><td>This describes the tracks on an albums, in order.  Songs that are available to Gnomoradio are referenced by the URL of the Recording that describes them (Recording syntax is below).  Songs that are not available to Gnomoradio are referenced by their title only.  (Note that the RDF of only one song is displayed below.  In the actual file, all four are described.)</td></tr>
<tr><td><pre><&lt;/Album&gt;</pre></td><td>End of album block</td></tr>
<tr><td><pre>
&lt;Recording rdf:ID="glassheart"&gt;</pre></td><td>This begins the description of a recording which is featured on Gnomoradio under a CC license.  The URL for this recording is now <tt>http://www.tommymagik.com/discography/science.rdf#glassheart</tt>.</td></tr>
<tr><td><pre>  &lt;dc:title&gt;Glass Heart, Stars, Moons and Clovers in the Midst of Eternity&lt;/dc:title&gt;</pre></td><td>Song title</td></tr>
<tr><td><pre>  &lt;dc:creator rdf:resource="http://www.tommymagik.com/tmatw.rdf#tmatw"/&gt;</pre></td><td>Link to the RDF of artist that recorded the song (as described below)</td></tr>
<tr><td><pre>  &lt;dcterms:isPartOf rdf:resource="#science"/&gt;</pre></td><td>Link to the RDF describing an album that the recording is featured on.  There can be zero, one, or more albums in this section of the RDF (with a separate tag for each).</td></tr>
<tr><td><pre>  &lt;cc:license rdf:resource="http://creativecommons.org/licenses/by-nd-nc/1.0"/&gt;</pre></td><td>Link to the RDF that describes what license the song can be distributed under</td></tr>
<tr><td><pre>  &lt;audiofile rdf:resource="#glassheart_mp3"/&gt;</pre></td><td>This is a link to an rbow:Resource block, which in turn describes a file.  There can be multiple files that represent a given recording (different formats like mp3/ogg, different bitrates, etc), and each representation of the file is given its own rbow:Resource block and refernenced here.  In this case, there is only one available representation of the recording online.</td></tr>
<tr><td><pre>  &lt;lyrics&gt;
    Trapped in your eyes.&lt;br/&gt;
    Break this medusa gaze.&lt;br/&gt;
    Another fabricated smile&lt;br/&gt;
    wasted on me.&lt;br/&gt;
  &lt;/lyrics&gt;</pre></td><td>Lyrics to the song, with line breaks in xhtml as shown (optional)</td></tr>
<tr><td><pre>&lt;/Recording&gt;</pre></td><td>End of recording block</td></tr>
<tr><td><pre>
&lt;rbow:Resource rdf:ID="glassheart_mp3"&gt;</pre></td><td>This begins the description of the resource/file which represents the Recording <tt>#glassheart</tt>.  The URL for this resource is now <tt>http://www.tommymagik.com/discography/science.rdf#glassheart_mp3</tt>.</td></tr>
<tr><td><pre>  &lt;rbow:available rdf:resource="http://www.tommymagik.com/~garrison/tmatw/Glass%20Heart.mp3"/&gt;</pre></td><td>This is a standard URL where the file can be downloaded.  Once the file is widely available on the file sharing system, this is no longer necessary to have, but it is still useful.</td></tr>
<tr><td><pre>  &lt;representationOf rdf:resource="#glassheart"/&gt;</pre></td><td>Link back to the Recording that this Resource represents, as described above</td></tr>
<tr><td><pre>  &lt;cc:license rdf:resource="http://creativecommons.org/licenses/by-nd-nc/1.0"/&gt;</pre></td><td>License that the resource can be distributed under.  This should be consistent with the license given for the Recording above.</td></tr>
<tr><td><pre>  &lt;dc:format&gt;audio/mpeg&lt;/dc:format&gt;</pre></td><td>Mime type of the audio file, which is usually audio/mpeg or audio/ogg</td></tr>
<tr><td><pre>  &lt;rbow:checksum&gt;a53260f2624d9d15a6b7c6e3cfd1f86b87f32229&lt;/rbow:checksum&gt;</pre></td><td><a href="http://www.faqs.org/rfcs/rfc3174.html">sha1</a> checksum of the resource</td></tr>
<tr><td><pre>&lt;/rbow:Resource&gt;</pre></td><td>End of resource block</td></tr>
<tr><td><pre>
&lt;cc:Agent rdf:about="http://www.tommymagik.com/tmatw.rdf#tmatw"&gt;</pre></td><td>This block describes the artist.  In this case, the RDF that describes the band is actually located in another file, so that many different RDF files can reference it easily.  Still, we have included a summary of its contents in this file, and that is why <tt>rdf:about</tt> has been used.  Otherwise, we could have used rdf:ID as before.</td></tr>
<tr><td><pre>  &lt;dc:title&gt;Tommy Magik and the Wonderfulls&lt;/dc:title&gt;</pre></td><td>Artist or band name</td></tr>
<tr><td><pre>  &lt;website rdf:resource="http://www.tommymagik.com/"/&gt;</pre></td><td>Link to the web site of the artist (optional)</td></tr>
<tr><td><pre>  &lt;img src="http://www.tommymagik.com/images/tmatw.png"/&gt;</pre></td><td>An image that can be used to describe the artist (optional, and not yet implemented or used in Gnomoradio)</td></tr>
<tr><td><pre>&lt;/cc:Agent&gt;</pre></td><td>End of artist block</td></tr>
<tr><td><pre>
&lt;cc:License rdf:about="http://creativecommons.org/licenses/by-nd-nc/1.0"&gt;
  &lt;cc:requires rdf:resource="http://web.resource.org/cc/Attribution"/&gt;
  &lt;cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/&gt;
  &lt;cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/&gt;
  &lt;cc:prohibits rdf:resource="http://web.resource.org/cc/CommercialUse"/&gt;
  &lt;cc:requires rdf:resource="http://web.resource.org/cc/Notice"/&gt;
&lt;/cc:License&gt;</pre></td><td>It is very useful, but not necessary, to describe any licenses that were referenced in the file.  This way, Gnomoradio does not have to fetch the licenses separately to determine the exact terms of them.</td></tr>
<tr><td><pre>
&lt;/rdf:RDF&gt;</pre></td><td>Ends the RDF document block</td></tr>
</table>

<p>Please feel free to contact me if you still have any questions.</p>

<p>Jim Garrison &lt;<a href="mailto:garrison@gnomoradio.org">garrison@gnomoradio.org</a>&gt;

<?php
my_footer(array());
?>
