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 / henry / henry.html @ 11:d95267afa12a

History | View | Annotate | Download (6.68 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>Henry - a DSP-driving SPARQL end-point</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
<div id="tagline">Henry - a DSP-driving SPARQL end-point<!-- - yves _at_ dbtune _dot_ org--></div>
20

    
21
<h2><a name="intro" id="intro"></a>1. Introduction</h2>
22

    
23
<p><b>Note:</b> This service is not currently available. This page is
24
retained for historical interest.</p>
25

    
26
<p>
27
This server hosts a <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> 
28
end-point able to perform audio processing tasks to answer a particular query.
29
It builds on top of <a href="http://www.w3.org/TeamSubmission/n3/">N3</a> and <a href="http://www.cs.sunysb.edu/~kifer/dood/tr-tutorial.html">
30
Transaction Logic</a>. More details to come.
31
</p>
32

    
33
<p>
34
Henry therefore implements a Music-related <a href="http://www-personal.si.umich.edu/~rfrost/courses/SI110/readings/In_Out_and_Beyond/Semantic_Web.pdf">Semantic Web agent</a>:
35
an agent processing machine-readable web content and audio content
36
to publish new data.
37
</p>
38

    
39
<h2><a name="details" id="details"></a>2. Details</h2>
40
<p>
41
<a href="http://blog.dbtune.org/post/2007/12/12/HENRY%3A-A-small-N3-parser/reasoner-for-SWI-Prolog">Henry</a> was initally intended to be a small application
42
on top of a <a href="http://www.swi-prolog.org/">SWI-Prolog</a> <a href="http://code.google.com/p/km-rdf/source/browse/trunk/n3/n3_dcg.pl">N3 parser</a>, 
43
interpreting parsed N3 rules as entailment rules within the <a href="http://e-culture.multimedian.nl/software/ClioPatria.shtml">SWI-Prolog
44
Semantic Web server</a>. 
45
</p>
46

    
47
<p>
48
Now, Henry provides the ability to easily register new audio processing builtin predicates (which may be discovered at querying time).
49
Henry works on top of a quad-store <i>m</i> and a binary store <i>b</i>. 
50
</p>
51

    
52
<p>
53
A simplistic version of the 
54
behavior of Henry is the following.
55
When processing a SPARQL query <i>q</i>, Henry gets through the following steps:
56
<ol>
57
<li> For every newly appearing web identifier <i>i</i> in <i>q</i>, dereference it, and then:</li>
58
<ul>
59
<li>If the representation is RDF, store it in <i>m</i>. If <i>i</i> is a property and its representation 
60
links to a built-in implementation matching the current platform, get it ;</li>
61
<li>If the representation is N3, store it in <i>m</i> and register the corresponding rules ;</li>
62
<li>If the representation is of a known mime-type, cache it in <i>b</i> ;</li>
63
</ul>
64
<li> For every triple pattern <i>p</i> in <i>q</i>, the possible solutions are:</li>
65
<ul>
66
<li>Instantiations of <i>p</i> in <i>m</i> ;</li>
67
<li>If <i>p</i> is in the head of a rule, solutions of step <i>2</i> with the body of the rule as <i>q</i> (plus a few extra things to deal
68
with equivalency, lists, existentials in the head, etc.) ;</li>
69
<li>If <i>p=(s_p,p_p,o_p)</i> where <i>p_p</i> is a built-in predicate, solutions derived using this built-in (update the state of <i>b</i> accordingly)</li>
70
</ul>
71
</ol>
72
</p>
73

    
74
<p>
75
This implementation is still in the early stages, and still a bit experimental, it may perfectly die horribly :-) A look at
76
the <a href="http://code.google.com/p/km-rdf/issues/list">issue tracker</a> may give insights on what is still buggy.
77
Also, the server running this service is quite.... slow :)
78
</p>
79

    
80

    
81

    
82
<h2><a name="use" id="use"></a>3. Using this service</h2>
83
<p>
84
There is a raw SPARQL end point at <pre>http://dbtune.org/henry/sparql/</pre>.
85
</p>
86
<p>
87
A <a href="http://dbtune.org/henry/store/">web interface</a> is also available. Get in the <b>Query database</b> page, make sure you choose <b>SPARQL</b>
88
as your query language, and check that the entailment is set to <b>n3</b> (it should be the default, anyway).
89
</p>
90

    
91
<p>
92
A query involving only builtins (no N3 rules) is the following. It computes MFCC models for two tracks and compute
93
their Kullback-Leiber divergence:
94
</p>
95
<pre>
96
select ?d
97
where
98
{
99
&lt;http://dbtune.org/audio/Den-Nostalia.ogg&gt; &lt;http://purl.org/ontology/dsp/cache&gt; ?local.
100
?local &lt;http://purl.org/ontology/dsp/aspl_decode&gt; ?sig.
101
?sig &lt;http://purl.org/ontology/vamp/qm-mfccparameters&gt; (?means1 ?vars1).
102

    
103
&lt;http://dbtune.org/audio/Both-Axel.ogg&gt; &lt;http://purl.org/ontology/dsp/cache&gt; ?local2 .
104
?local2 &lt;http://purl.org/ontology/dsp/aspl_decode&gt; ?sig2.
105
?sig2 &lt;http://purl.org/ontology/vamp/qm-mfccparameters&gt; (?means2 ?vars2).
106

    
107
((?means1 ?vars1) (?means2 ?vars2)) &lt;http://purl.org/ontology/dsp/mfcc_kldiv&gt; ?d
108
}
109
</pre>
110

    
111
<p>
112
This is a pretty huge query! 
113
But, using a simple <a href="http://code.google.com/p/km-rdf/source/browse/trunk/henry/dsp-n3/similarity.n3">N3 rule</a>, we can reduce that to the following query:
114
</p>
115

    
116
<pre>
117
PREFIX sim: &lt;http://purl.org/ontology/similarity/&gt;
118
SELECT ?sim
119
WHERE
120
{
121
(&lt;http://dbtune.org/audio/Den-Nostalia.ogg&gt; &lt;http://dbtune.org/audio/Both-Axel.ogg&gt;) sim:div ?sim
122
}
123
</pre>
124

    
125
<p>
126
Another example is the following, computing key change events as specified by the <a href="http://purl.org/ontology/af/">Audio Features
127
ontology</a>.
128
using the <a href="http://www.elec.qmul.ac.uk/digitalmusic/downloads/index.html#qm-vamp-plugins">key
129
detection Vamp plugin in the Queen Mary plugin set</a> and <a href="http://code.google.com/p/km-rdf/source/browse/trunk/henry/dsp-n3/vamp.n3">this N3
130
rule</a>:
131
</p>
132
<pre>
133
select ?start ?key where {
134
&lt;http://dbtune.org/audio/Both-Axel.ogg&gt; mo:encodes ?sig.
135
?sig mo:time ?time.
136
?time tl:timeline ?tl.
137
_:evt a af:KeyChange; 
138
        event:time [tl:at ?start; tl:timeline ?tl] ;
139
        af:new_key ?key }
140
</pre>
141

    
142

    
143

    
144
<h2><a name="code" id="code"></a>4. Code</h2>
145
<p>
146
All the code is open source and available in our <a href="http://code.google.com/p/km-rdf">Google code project</a>.
147
</p>
148

    
149
<!--<h2><a name="missing" id="missing"></a>5. Things missing</h2>
150
<p>Linked data access!! We are implementing the mechanism we use in <a href="http://sonictruths.net/dm.html#SBSimilarity">SBSimilarity</a>.</p>
151
-->
152
<!--<h2><a name="ack" id="ack"></a>5. Acknowledgements</h2>
153
<p>
154
Thanks to David Pastor who wrote the <a href="http://www.vamp-plugins.org/">Vamp</a> to <a href="http://www.swi-prolog.org/">SWI-Prolog</a>
155
interface!
156
</p>-->
157

    
158
<script type="text/javascript">
159
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
160
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
161
</script>
162
<script type="text/javascript">
163
var pageTracker = _gat._getTracker("UA-3327144-3");
164
pageTracker._initData();
165
pageTracker._trackPageview();
166
</script>
167

    
168

    
169
</body>
170

    
171
</html>
172