W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > March 2010

Cool rdfQuery application

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Tue, 16 Mar 2010 11:39:58 -0400
Message-ID: <4B9FA64E.8000005@digitalbazaar.com>
To: RDFa WG <public-rdfa-wg@w3.org>
Toby - this might be useful for the RDF TripleStore API you're
documenting...

This is really cool - the following code processes the RDFa on the radio
BBC programmes site and extracts the data using SPARQL.

$('#segments')
  .rdf()
    .prefix('mo', 'http://purl.org/ontology/mo/')
    .prefix('foaf', 'http://xmlns.com/foaf/0.1/')
    .prefix('dc', 'http://purl.org/dc/terms/')
    .where('?track a mo:Track')
    .where('?track foaf:maker ?artist')
    .where('?track dc:title ?trackTitle')
    .where('?artist a mo:MusicArtist')
    .where('?artist foaf:name ?artistName') // not quite working yet
(rdfQuery bug)
    .each(function(i, bindings, triples) {
       doSomething();
    });

Fairly easy to read and understand, IMHO. It should look pretty familiar
to database folks. The data is then used to do some really cool stuff in
GreaseMonkey... more here:

http://hublog.hubmed.org/archives/001913.html

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: PaySwarming Goes Open Source
http://blog.digitalbazaar.com/2010/02/01/bitmunk-payswarming/
Received on Tuesday, 16 March 2010 15:40:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:06 GMT