A simple XSL for transforming the results of the Echonest Analyze API to Music Ontology RDF.
Original file: analyze-example.xml
Transform: echonest.xsl
Results: analyze-example.rdf
The resulting RDF can be queried using SPARQL. For example, the following query selects starts and durations for extracted structural segments (eg. chorus, verse, etc.).
PREFIX af: <http://purl.org/ontology/af/>
PREFIX event: <http://purl.org/NET/c4dm/event.owl#>
PREFIX tl: <http://purl.org/NET/c4dm/timeline.owl#>
SELECT ?start ?duration
FROM <http://dbtune.org/echonest/analyze-example.rdf>
WHERE
{
?e      a af:StructuralSegment;
        event:time ?time.
?time   tl:start ?start;
        tl:duration ?duration.
}
I tested this query with Roqet and ARQ.
The outputted RDF is designed using the Music Ontology, the Audio Features ontology and a small Echonest ontology extending the latter.
RDF could be automatically extracted from the Echonest Analyze results through GRDDL, by adding the following:
<Analysis xmlns:grddl="http://www.w3.org/2003/g/data-view#" grddl:transformation="http://dbtune.org/echonest/echonest.xsl"> ... </Analysis>
Author: Yves Raimond