Henry - a DSP-driving SPARQL end-point (original) (raw)

DBTune.org

Henry - a DSP-driving SPARQL end-point

1. Introduction

Note: This service is not currently available. This page is retained for historical interest.

This server hosts a SPARQLend-point able to perform audio processing tasks to answer a particular query. It builds on top of N3 and Transaction Logic. More details to come.

Henry therefore implements a Music-related Semantic Web agent: an agent processing machine-readable web content and audio content to publish new data.

2. Details

Henry was initally intended to be a small application on top of a SWI-Prolog N3 parser, interpreting parsed N3 rules as entailment rules within the SWI-Prolog Semantic Web server.

Now, Henry provides the ability to easily register new audio processing builtin predicates (which may be discovered at querying time). Henry works on top of a quad-store m and a binary store b.

A simplistic version of the behavior of Henry is the following. When processing a SPARQL query q, Henry gets through the following steps:

  1. For every newly appearing web identifier i in q, dereference it, and then:
    • If the representation is RDF, store it in m. If i is a property and its representation links to a built-in implementation matching the current platform, get it ;
    • If the representation is N3, store it in m and register the corresponding rules ;
    • If the representation is of a known mime-type, cache it in b ;
  2. For every triple pattern p in q, the possible solutions are:
    • Instantiations of p in m ;
    • If p is in the head of a rule, solutions of step 2 with the body of the rule as q (plus a few extra things to deal with equivalency, lists, existentials in the head, etc.) ;
    • If p=(s_p,p_p,o_p) where p_p is a built-in predicate, solutions derived using this built-in (update the state of b accordingly)

This implementation is still in the early stages, and still a bit experimental, it may perfectly die horribly :-) A look at the issue tracker may give insights on what is still buggy. Also, the server running this service is quite.... slow :)

3. Using this service

There is a raw SPARQL end point at

http://dbtune.org/henry/sparql/

.

A web interface is also available. Get in the Query database page, make sure you choose SPARQLas your query language, and check that the entailment is set to n3 (it should be the default, anyway).

A query involving only builtins (no N3 rules) is the following. It computes MFCC models for two tracks and compute their Kullback-Leiber divergence:

select ?d where { http://dbtune.org/audio/Den-Nostalia.ogg http://purl.org/ontology/dsp/cache ?local. ?local http://purl.org/ontology/dsp/aspl_decode ?sig. ?sig http://purl.org/ontology/vamp/qm-mfccparameters (?means1 ?vars1).

http://dbtune.org/audio/Both-Axel.ogg http://purl.org/ontology/dsp/cache ?local2 . ?local2 http://purl.org/ontology/dsp/aspl_decode ?sig2. ?sig2 http://purl.org/ontology/vamp/qm-mfccparameters (?means2 ?vars2).

((?means1 ?vars1) (?means2 ?vars2)) http://purl.org/ontology/dsp/mfcc_kldiv ?d }

This is a pretty huge query! But, using a simple N3 rule, we can reduce that to the following query:

PREFIX sim: http://purl.org/ontology/similarity/ SELECT ?sim WHERE { (http://dbtune.org/audio/Den-Nostalia.ogg http://dbtune.org/audio/Both-Axel.ogg) sim:div ?sim }

Another example is the following, computing key change events as specified by the Audio Features ontology. using the key detection Vamp plugin in the Queen Mary plugin set and this N3 rule:

select ?start ?key where { http://dbtune.org/audio/Both-Axel.ogg mo:encodes ?sig. ?sig mo:time ?time. ?time tl:timeline ?tl. _:evt a af:KeyChange; event:time [tl:at ?start; tl:timeline ?tl] ; af:new_key ?key }

4. Code

All the code is open source and available in our Google code project.