Playing with SPARQL and XMPP
By Yves on Monday 25 February 2008, 11:04 - Permalink
Chatting with Dan Brickley at the Semantic Camp last week got me quite curious about mixing SPARQL and XMPP, so I decided to give it a try :-)
I first tried sparqlxmpp by Chris Schmidt, a Python implementation using redland as a back-end. Unfortunately, I did run into some troubles (a weird error attribute being inserted in the XML between the sending and the receiving, which made the whole thing crash).
So I decided to give a try at xOperator, which 0.1 version was announced last week. It is really easy to use and flexible (notably through the fact that you can specify third-party SPARQL end-points as new datasets, and the ability to template SPARQL queries (a bit like SparqlBot)).
Here is the result. You can add jamendo@jabber.org to your
Jabber roster, which provides SPARQL/XMPP on top of the Jamendo SPARQL end-point. Then, here is an
example session (moustaki is me, and jamendo is the
xoperator instance):
<moustaki> list templates
<jamendo> These are the defined templates:
<jamendo> LIST ME * ARTISTS select ?n where {?a rdf:type mo:MusicArtist; foaf:name ?n} LIMIT %%1%%
<jamendo> GIVE ME THE LOCATION OF * select ?l where {?a a mo:MusicArtist;foaf:name '%%1%%'; foaf:based_near ?g. ?g
<http://www.geonames.org/ontology#name> ?l}
<jamendo> GIVE ME ALBUMS MADE BY * select ?l where {?a a mo:MusicArtist; foaf:name '%%1%%'; foaf:made ?r. ?r a mo:Record; dc:title ?l}
<jamendo> WHERE CAN I GET * select ?d where {?a dc:title '%%1%%'; mo:available_as ?d}
<jamendo> GIVE ME THE LOCATION OF * select ?l where {?a a mo:MusicArtist;foaf:name '%%1%%'; foaf:based_near ?g. ?g
<http://www.geonames.org/ontology#name> ?l}
<moustaki> list me 5 artists
<jamendo> Store jamendo answered:
<jamendo> "Cicada"
<jamendo> "Hace Soul"
<jamendo> "vincent j"
<jamendo> "NoU"
<jamendo> "Margin of Safety"
<moustaki> give me the location of Cicada
<jamendo> Store jamendo answered:
<jamendo> "Département des Bouches-du-Rhône"
<moustaki> give me albums made by Cicada
<jamendo> Store jamendo answered:
<jamendo> "Rebirth"
<jamendo> "AuthentiK Yogourt"
<moustaki> where can I get AuthentiK Yogourt
<jamendo> Store jamendo answered:
<jamendo> <http://www.jamendo.com/get/album/id/album/p2p/redirect/8309/?p2pnet=bittorrent&are=mp32>
<jamendo> <http://www.jamendo.com/get/album/id/album/p2p/redirect/8309/?p2pnet=bittorrent&are=ogg3>
<jamendo> <http://www.jamendo.com/get/album/id/album/p2p/redirect/8309/?p2pnet=ed2k&are=mp32>
<jamendo> <http://www.jamendo.com/get/album/id/album/p2p/redirect/8309/?p2pnet=ed2k&are=ogg3>
<jamendo> <http://www.jamendo.com/get/track/id/album/audio/play/8309/?item_o=track_no_asc&aue=ogg2&n=all>
<jamendo> <http://www.jamendo.com/get/track/id/album/audio/xspf/8309/?item_o=track_no_asc&aue=ogg2&n=all>
Now, making it interact with GNAT and GNARQL, two tools able to create a SPARQL end point holding information about your personal music collection, is the next step :)
Comments
For connecting english questions with rdf, see also
http://www.idealliance.org/papers/e... (especially "Creating AIML categories from RDF Triples")
That's great! Thanks for the link, Drew!
y
raw materials, then you may are going to think about getting the product along on your own. Should there be a problem of your classic passenger cars then these trader is going to be required to tell you. Having said that, you will also will need to be happy to see each and every complications with their very old family car for yourself, simply because the ongoing master might aim to gloss over these insanity workout reviews schedule individuals. Timeless motor vehicles offered might possibly.