Category Archives: SPARQL

Linky Icons

Thanks to Alexandre Passant’s work with the OpenID plugin and SPARQLing online accounts, SparqlPress now shows pretty little icons next to comments by users that were logged in with OpenID when writing the comment — lots of icons!

Linky Icons

This is what a source snippet looks like as Turtle:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#me> foaf:holdsAccount [
  foaf:accountServiceHomepage <http://en.wikipedia.org/wiki/Main_Page> ;
  foaf:accountName "Mortenf" ;
  foaf:accountProfilePage <http://en.wikipedia.org/wiki/User:Mortenf> ] ,
    <http://del.icio.us/mortenf> .
<http://del.icio.us/mortenf> foaf:accountName "mortenf" ;
  foaf:accountServiceHomepage <http://del.icio.us/> .

Here it is as SPARQL:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?account ?service ?accountname ?profile
WHERE {
  ?person foaf:holdsAccount ?account .
  ?account foaf:accountServiceHomepage ?service .
  OPTIONAL { ?account foaf:accountName ?accountname }
  OPTIONAL { ?account foaf:accountProfilePage ?profile }
  FILTER (isIri(?account) || bound(?profile))
} GROUP BY ?account

Everything is still work in progress, of course, but you can try it out if you wish — just get it from my Bazaar repository in the sidebar.

Don’t forget to leave a comment here too — and come back in a while to see what the Semantic Web has digged up about you…

FOAFNaut Widget

Currently in test’n'tweak mode here is a WordPress widget with HTMLNaut, powered by SPARQL via RDF Tools. Try it out in the sidebar…

It’s not quite perfect yet (and the database currently only contains the FOAF profiles of danbri, CaptSolo and myself), but it does work.

Current issues:

  • Some page content is still visible when maximized (possibly only a problem with themes like Moo-Point that show two sidebars as one)
  • The SPARQL query returns more results than necessary (e.g. when someone has more than one IFP) — fixed, using GROUP BY (from SPARQL+)
  • Selecting/dragging blubs is hard, must bug JibberJim for solution…
  • SVG sproings not always updated correctly on drag
  • More than one blub representing a single person can be displayed due to improper identification