To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / echonest / index.html
History | View | Annotate | Download (3.27 KB)
| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|---|---|
| 2 |
|
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
|
| 5 |
<head>
|
| 6 |
<title>DBTune - Echonest Analyze XML to Music Ontology RDF</title> |
| 7 |
|
| 8 |
<style type="text/css" media="all"> |
| 9 |
@import url(style.css);
|
| 10 |
</style>
|
| 11 |
|
| 12 |
</head>
|
| 13 |
|
| 14 |
<body>
|
| 15 |
|
| 16 |
|
| 17 |
<a href="http://dbtune.org/"><h1 style="font-size: 250%;">DBTune.org</h1></a> |
| 18 |
|
| 19 |
<br/> |
| 20 |
|
| 21 |
<div id="tagline">Echonest Analyze XML to Music Ontology RDF</div> |
| 22 |
|
| 23 |
|
| 24 |
<p>
|
| 25 |
A simple XSL for transforming the results of the <a href="http://the.echonest.com/analyze.html">Echonest Analyze API</a> to <a href="http://musicontology.com/">Music Ontology</a> RDF. |
| 26 |
</p>
|
| 27 |
|
| 28 |
<p>
|
| 29 |
Original file: <a href="http://dbtune.org/echonest/analyze-example.xml">analyze-example.xml</a><br/> |
| 30 |
Transform: <a href="http://dbtune.org/echonest/echonest.xsl">echonest.xsl</a><br/> |
| 31 |
Results: <a href="http://dbtune.org/echonest/analyze-example.rdf">analyze-example.rdf</a><br/> |
| 32 |
</p>
|
| 33 |
|
| 34 |
<p>
|
| 35 |
<form method="get" action="http://www.w3.org/2005/08/online_xslt/xslt"> |
| 36 |
<label>URI of XSL resource <input type="text" size="50" name="xslfile" value="http://dbtune.org/echonest/echonest.xsl"/></label> |
| 37 |
<br/> |
| 38 |
<label>URI of Echonest Analyze XML resource <input type="text" size="50" name="xmlfile" value="http://dbtune.org/echonest/analyze-example.xml"/></label><br/> |
| 39 |
<input type="submit" value="Transform!" name="transform"> |
| 40 |
</form>
|
| 41 |
</p>
|
| 42 |
|
| 43 |
<p>
|
| 44 |
The resulting RDF can be queried using <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a>. |
| 45 |
For example, the <a href="http://dbtune.org/echonest/structure.rq">following query</a> |
| 46 |
selects starts and durations for extracted structural segments (eg. chorus, verse, etc.). |
| 47 |
<pre>
|
| 48 |
PREFIX af: <http://purl.org/ontology/af/> |
| 49 |
PREFIX event: <http://purl.org/NET/c4dm/event.owl#> |
| 50 |
PREFIX tl: <http://purl.org/NET/c4dm/timeline.owl#> |
| 51 |
|
| 52 |
SELECT ?start ?duration |
| 53 |
FROM <http://dbtune.org/echonest/analyze-example.rdf> |
| 54 |
WHERE |
| 55 |
{
|
| 56 |
?e a af:StructuralSegment; |
| 57 |
event:time ?time. |
| 58 |
?time tl:start ?start; |
| 59 |
tl:duration ?duration. |
| 60 |
} |
| 61 |
</pre>
|
| 62 |
I tested this query with <a href="http://librdf.org/rasqal/roqet.html">Roqet</a> and <a href="http://jena.sourceforge.net">ARQ</a>. |
| 63 |
</p>
|
| 64 |
|
| 65 |
<p>
|
| 66 |
The outputted RDF is designed using the <a href="http://musicontology.com/"> |
| 67 |
Music Ontology</a>, the <a href="http://purl.org/ontology/af/">Audio Features ontology</a> and |
| 68 |
a small <a href="http://purl.org/ontology/echonest/">Echonest ontology</a> extending the latter. |
| 69 |
</p>
|
| 70 |
|
| 71 |
<p>
|
| 72 |
RDF could be automatically extracted from the Echonest Analyze results through <a href="http://www.w3.org/TR/grddl/">GRDDL</a>, |
| 73 |
by adding the following: |
| 74 |
<pre>
|
| 75 |
<Analysis xmlns:grddl="http://www.w3.org/2003/g/data-view#"
|
| 76 |
grddl:transformation="http://dbtune.org/echonest/echonest.xsl">
|
| 77 |
... |
| 78 |
</Analysis> |
| 79 |
</pre>
|
| 80 |
</p>
|
| 81 |
|
| 82 |
<p>
|
| 83 |
Author: <a href="http://moustaki.org/">Yves Raimond</a> |
| 84 |
</p>
|
| 85 |
|
| 86 |
<script type="text/javascript"> |
| 87 |
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
| 88 |
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
| 89 |
</script>
|
| 90 |
<script type="text/javascript"> |
| 91 |
var pageTracker = _gat._getTracker("UA-3327144-3");
|
| 92 |
pageTracker._initData();
|
| 93 |
pageTracker._trackPageview();
|
| 94 |
</script>
|
| 95 |
|
| 96 |
|
| 97 |
</body>
|
| 98 |
|
| 99 |
</html>
|
| 100 |
|