To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / echonest / echonest.xsl @ 0:1e44d666ced1

History | View | Annotate | Download (4.78 KB)

1
<xsl:transform 
2
    xmlns:xsl  ="http://www.w3.org/1999/XSL/Transform" version="1.0"
3
    xmlns:rdf  ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4
    xmlns:rdfs ="http://www.w3.org/2000/02/rdfschema#"
5
    xmlns:mo   ="http://purl.org/ontology/mo/"
6
    xmlns:af   ="http://purl.org/ontology/af/"
7
    xmlns:dc   ="http://purl.org/dc/elements/1.1/"
8
    xmlns:tl   ="http://purl.org/NET/c4dm/timeline.owl#"
9
    xmlns:en   = "http://purl.org/ontology/echonest/"
10
    xmlns:event="http://purl.org/NET/c4dm/event.owl#"
11
    xmlns ="http://dbtune.org/echonest/" 
12
    >
13

    
14
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
15

    
16
<div xmlns="http://www.w3.org/1999/xhtml">
17
<p>testing GRDDL for the Echonest Analyze API
18
</p>
19
<p>Copyright (c) <a href="http://moustaki.org/">Yves Raimond</a>, 2008</p>
20

    
21
<a rel="license"
22
href="http://creativecommons.org/licenses/by-sa/2.0/"><img alt="Creative
23
Commons License" border="0"
24
src="http://creativecommons.org/images/public/somerights20.gif"
25
/></a><br />
26
This work is licensed under a <a rel="license"
27
href="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons
28
License</a>.
29
</div>
30

    
31
<!-- /Creative Commons License -->
32

    
33
<!--
34

    
35
<rdf:RDF xmlns="http://web.resource.org/cc/"
36
    xmlns:dc="http://purl.org/dc/elements/1.1/"
37
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
38
<Work rdf:about="">
39
   <license
40
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
41
</Work>
42

    
43
<License rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
44
   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
45
   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
46
   <requires rdf:resource="http://web.resource.org/cc/Notice" />
47
   <requires rdf:resource="http://web.resource.org/cc/Attribution" />
48
   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
49
   <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
50
</License>
51

    
52
</rdf:RDF>
53

    
54
-->
55

    
56
<xsl:template match='Analysis'>
57
<rdf:RDF>
58
<xsl:for-each select='Track'>
59

    
60
<!-- Describing the signal resource and track-wide features -->
61
<mo:Signal 
62
	rdf:about="#signal" 
63
	en:loudnessDynamicsVariance='{Tags/@loudnessDynamicsVariance}'
64
	en:timbreMean='{Tags/@timbreMean}'
65
	en:endOfFadeIn='{Tags/@endOfFadeIn}'
66
	en:loudnessBeginVariance='{Tags/@loudnessBeginVariance}'
67
	en:loudnessBeginMean='{Tags/@loudnessBeginMean}'
68
	en:beatVariance='{Tags/@beatVariance}'
69
	en:timeSignature_Stability='{Tags/@timeSignatureStability}'
70
	en:loudnessDynamicsMean='{Tags/@loudnessDynamicsMean}'
71
	en:timbreVariance='{Tags/@timbreVariance}'
72
	en:loudnessMaxVariance='{Tags/@loudnessMaxVariance}'
73
	en:loudnessMaxMean='{Tags/@loudnessMaxMean}'
74
	en:segmentDurationVariance='{Tags/@segmentDurationVariance}'
75
	en:sizeTimbre='{Tags/@sizeTimbre}'
76
	en:pitchMean='{Tags/@pitchMean}'
77
	en:startOfFadeOut='{Tags/@startOfFadeOut}'
78
	en:tatum='{Tags/@tatum}'
79
	en:timeLoudnessMaxMean='{Tags/@timeLoudnessMaxMean}'
80
	en:numTatums='{Tags/@numTatums}'
81
	en:tempoConfidence='{Tags/@tempoConfidence}'
82
	en:loudness='{Tags/@loudness}'
83
	en:tempo='{Tags/@tempo}'
84
	en:segmentDurationMean='{Tags/@segmentDurationMean}'
85
	en:numSections='{Tags/@numSections}'
86
	en:tatumConfidence='{Tags/@tatumConfidence}'
87
	en:timeSignature='{Tags/@timeSignature}'
88
	en:numBeats='{Tags/@numBeats}'
89
	en:sizePitches='{Tags/@sizePitches}'
90
	en:pitchVariance='{Tags/@pitchVariance}'
91
	en:numSegments='{Tags/@numSegments}'
92
	en:numTatumsPerBeat='{Tags/@numTatumsPerBeat}'
93
	en:tatums='{Tatums}'
94
	> 
95
<mo:time>
96
<tl:Interval>
97
<tl:duration><xsl:value-of select='@duration'/></tl:duration>
98
<tl:onTimeLine> <!-- Should be unique -->
99
<tl:TimeLine rdf:about="#timeline"/>
100
</tl:onTimeLine>
101
</tl:Interval>
102
</mo:time>
103
</mo:Signal>
104

    
105
<!-- Describing local features -->
106

    
107
<!--- Sadly XSLT 2.0 -->
108
<!--<xsl:variable name="tantumID" select="tokenize('@Tatums',' ')"/>
109
<xsl:for-each select="$tantumID">
110
<en:Tantum>
111
<event:time>
112
<tl:at><xsl:value-of select='.'/></tl:at>
113
<tl:onTimeLine rdf:resource="#timeline"/>
114
</event:time>
115
</en:Tantum>
116
</xsl:for-each>
117
-->
118

    
119
<xsl:for-each select='Section'>
120
<af:StructuralSegment>
121
<event:time>
122
<tl:Interval>
123
<tl:start><xsl:value-of select='@start'/></tl:start>
124
<tl:duration><xsl:value-of select='@duration'/></tl:duration>
125
<tl:onTimeLine rdf:resource="#timeline"/>
126
</tl:Interval>
127
</event:time>
128
</af:StructuralSegment>
129
</xsl:for-each>
130

    
131
<xsl:for-each select='Segment'>
132
<en:Segment
133
	en:loundnessBegin='{Tags/@loudnessBegin}'
134
	en:loudnessMax='{Tags/@loudnessMax}'
135
	en:loudnessEnd='{Tags/@loudnessEnd}'
136
	en:timeLoudnessMax='{Tags/@timeLoudnessMax}'
137
	en:pitches='{Tags/@pitches}'
138
	en:timbreCoeff='{Tags/@timbreCoeff}'
139
	>
140
<event:time>
141
<tl:Interval>
142
<tl:start><xsl:value-of select='@start'/></tl:start>
143
<tl:duration><xsl:value-of select='@duration'/></tl:duration>
144
<tl:onTimeLine rdf:resource="#timeline"/>
145
</tl:Interval>
146
</event:time>
147
</en:Segment>
148
</xsl:for-each>
149

    
150
</xsl:for-each>
151
</rdf:RDF>
152
</xsl:template>
153

    
154
</xsl:transform>