annotate henry/henry.html @ 19:1e79ce3ff5f5 tip

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