To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / henry / henry.html @ 0:1e44d666ced1
History | View | Annotate | Download (6.58 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>
|
| 24 |
This server hosts a <a href="http://www.w3.org/TR/rdf-sparql-query/">SPARQL</a> |
| 25 |
end-point able to perform audio processing tasks to answer a particular query. |
| 26 |
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"> |
| 27 |
Transaction Logic</a>. More details to come.
|
| 28 |
</p>
|
| 29 |
|
| 30 |
<p>
|
| 31 |
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>: |
| 32 |
an agent processing machine-readable web content and audio content |
| 33 |
to publish new data. |
| 34 |
</p>
|
| 35 |
|
| 36 |
<h2><a name="details" id="details"></a>2. Details</h2> |
| 37 |
<p>
|
| 38 |
<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 |
| 39 |
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>, |
| 40 |
interpreting parsed N3 rules as entailment rules within the <a href="http://e-culture.multimedian.nl/software/ClioPatria.shtml">SWI-Prolog |
| 41 |
Semantic Web server</a>.
|
| 42 |
</p>
|
| 43 |
|
| 44 |
<p>
|
| 45 |
Now, Henry provides the ability to easily register new audio processing builtin predicates (which may be discovered at querying time). |
| 46 |
Henry works on top of a quad-store <i>m</i> and a binary store <i>b</i>. |
| 47 |
</p>
|
| 48 |
|
| 49 |
<p>
|
| 50 |
A simplistic version of the |
| 51 |
behavior of Henry is the following. |
| 52 |
When processing a SPARQL query <i>q</i>, Henry gets through the following steps: |
| 53 |
<ol>
|
| 54 |
<li> For every newly appearing web identifier <i>i</i> in <i>q</i>, dereference it, and then:</li> |
| 55 |
<ul>
|
| 56 |
<li>If the representation is RDF, store it in <i>m</i>. If <i>i</i> is a property and its representation |
| 57 |
links to a built-in implementation matching the current platform, get it ;</li>
|
| 58 |
<li>If the representation is N3, store it in <i>m</i> and register the corresponding rules ;</li> |
| 59 |
<li>If the representation is of a known mime-type, cache it in <i>b</i> ;</li> |
| 60 |
</ul>
|
| 61 |
<li> For every triple pattern <i>p</i> in <i>q</i>, the possible solutions are:</li> |
| 62 |
<ul>
|
| 63 |
<li>Instantiations of <i>p</i> in <i>m</i> ;</li> |
| 64 |
<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 |
| 65 |
with equivalency, lists, existentials in the head, etc.) ;</li>
|
| 66 |
<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> |
| 67 |
</ul>
|
| 68 |
</ol>
|
| 69 |
</p>
|
| 70 |
|
| 71 |
<p>
|
| 72 |
This implementation is still in the early stages, and still a bit experimental, it may perfectly die horribly :-) A look at |
| 73 |
the <a href="http://code.google.com/p/km-rdf/issues/list">issue tracker</a> may give insights on what is still buggy. |
| 74 |
Also, the server running this service is quite.... slow :) |
| 75 |
</p>
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
<h2><a name="use" id="use"></a>3. Using this service</h2> |
| 80 |
<p>
|
| 81 |
There is a raw SPARQL end point at <pre>http://dbtune.org/henry/sparql/</pre>. |
| 82 |
</p>
|
| 83 |
<p>
|
| 84 |
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> |
| 85 |
as your query language, and check that the entailment is set to <b>n3</b> (it should be the default, anyway). |
| 86 |
</p>
|
| 87 |
|
| 88 |
<p>
|
| 89 |
A query involving only builtins (no N3 rules) is the following. It computes MFCC models for two tracks and compute |
| 90 |
their Kullback-Leiber divergence: |
| 91 |
</p>
|
| 92 |
<pre>
|
| 93 |
select ?d |
| 94 |
where |
| 95 |
{
|
| 96 |
<http://dbtune.org/audio/Den-Nostalia.ogg> <http://purl.org/ontology/dsp/cache> ?local. |
| 97 |
?local <http://purl.org/ontology/dsp/aspl_decode> ?sig. |
| 98 |
?sig <http://purl.org/ontology/vamp/qm-mfccparameters> (?means1 ?vars1). |
| 99 |
|
| 100 |
<http://dbtune.org/audio/Both-Axel.ogg> <http://purl.org/ontology/dsp/cache> ?local2 . |
| 101 |
?local2 <http://purl.org/ontology/dsp/aspl_decode> ?sig2. |
| 102 |
?sig2 <http://purl.org/ontology/vamp/qm-mfccparameters> (?means2 ?vars2). |
| 103 |
|
| 104 |
((?means1 ?vars1) (?means2 ?vars2)) <http://purl.org/ontology/dsp/mfcc_kldiv> ?d |
| 105 |
} |
| 106 |
</pre>
|
| 107 |
|
| 108 |
<p>
|
| 109 |
This is a pretty huge query! |
| 110 |
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: |
| 111 |
</p>
|
| 112 |
|
| 113 |
<pre>
|
| 114 |
PREFIX sim: <http://purl.org/ontology/similarity/> |
| 115 |
SELECT ?sim |
| 116 |
WHERE |
| 117 |
{
|
| 118 |
(<http://dbtune.org/audio/Den-Nostalia.ogg> <http://dbtune.org/audio/Both-Axel.ogg>) sim:div ?sim |
| 119 |
} |
| 120 |
</pre>
|
| 121 |
|
| 122 |
<p>
|
| 123 |
Another example is the following, computing key change events as specified by the <a href="http://purl.org/ontology/af/">Audio Features |
| 124 |
ontology</a>.
|
| 125 |
using the <a href="http://www.elec.qmul.ac.uk/digitalmusic/downloads/index.html#qm-vamp-plugins">key |
| 126 |
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 |
| 127 |
rule</a>:
|
| 128 |
</p>
|
| 129 |
<pre>
|
| 130 |
select ?start ?key where {
|
| 131 |
<http://dbtune.org/audio/Both-Axel.ogg> mo:encodes ?sig. |
| 132 |
?sig mo:time ?time. |
| 133 |
?time tl:timeline ?tl. |
| 134 |
_:evt a af:KeyChange; |
| 135 |
event:time [tl:at ?start; tl:timeline ?tl] ; |
| 136 |
af:new_key ?key } |
| 137 |
</pre>
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
<h2><a name="code" id="code"></a>4. Code</h2> |
| 142 |
<p>
|
| 143 |
All the code is open source and available in our <a href="http://code.google.com/p/km-rdf">Google code project</a>. |
| 144 |
</p>
|
| 145 |
|
| 146 |
<!--<h2><a name="missing" id="missing"></a>5. Things missing</h2>
|
| 147 |
<p>Linked data access!! We are implementing the mechanism we use in <a href="http://sonictruths.net/dm.html#SBSimilarity">SBSimilarity</a>.</p>
|
| 148 |
-->
|
| 149 |
<!--<h2><a name="ack" id="ack"></a>5. Acknowledgements</h2>
|
| 150 |
<p>
|
| 151 |
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>
|
| 152 |
interface!
|
| 153 |
</p>-->
|
| 154 |
|
| 155 |
<script type="text/javascript"> |
| 156 |
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
| 157 |
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
| 158 |
</script>
|
| 159 |
<script type="text/javascript"> |
| 160 |
var pageTracker = _gat._getTracker("UA-3327144-3");
|
| 161 |
pageTracker._initData();
|
| 162 |
pageTracker._trackPageview();
|
| 163 |
</script>
|
| 164 |
|
| 165 |
|
| 166 |
</body>
|
| 167 |
|
| 168 |
</html>
|
| 169 |
|