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