Why REST Matters

Try this:

  1. Go to digg.com.
  2. Open a story from the front page in a new window or tab (via the More… link).
  3. Open another story in yet another new window or tab.
  4. Switch to the window or tab from step 2.
  5. Login (using the Ajax widget in the left column).

Notice how your window or tab opened in step 2 now contains the article that was opened in step 3?

Clearly, digg doesn’t use or understand web architecture. Somewhere on their server they try to store session information, under the assumption that one user equals one browser, one window, and one tab.

If instead of using session information (through cookies), they actually used the principles of the web and Representational State Transfer (REST), I would end up with the story I was actually reading, not some other story I happened to have opened at a later point.

Planet Timeline

Following up on the other day’s post on SPARQL and the Simile Timeline, here is another way of putting items on a timeline.

I’ve created a SPARQL template for Planet Planet, you can see it in action on my personal planet.

The template makes (optional) use of identifying icons for each feed, which are configured in the Planet config.ini (don’t forget to add the SPARQL template to the template_files configuration option as well):

[http://www.wasab.dk/morten/blog/feed/rdf]
name = Binary Relations
timeline_icon = dull-red-circle.png 

Once set up, the generated SPARQL results (example) can be run through the SPARQL Timeline Service (example).

Integrating the timeline into the default Planet HTML isn’t hard, I’ve created a tweaked version of examples/basic/index.html.tmpl from the latest nightly — see it in action.

Getting this running on a working Planet installation should be as simple as downloading the two templates to the right location, and updating the Planet configuration file (default dull-blue icons will be used if not specificed per feed).

Update: Note that the planet-sparql.srx file needs to be returned by the web server with an XML mime type, preferably application/sparql-results+xml. If you’re unable to configure your server to make it do that, try renaming the template and file to use .xml instead of .srx as the file extension — that should make it return with application/xml. Thanks to Edward Summers for pointing this out on the Planet developer list.

SPARQL and SIMILE Timeline

Danny Ayers has been working on getting the SIMILE Timeline to eat SPARQL through the use of its JSON interface and some XSLT, he has notes on the ESW wiki.

While trying to get his work running here, I realized that the trip through XSLT to create JSON output really wasn’t necessary.

Instead, I’ve created a custom SPARQL event source parser, to load SPARQL results directly into the timeline. This way, the SPARQL results format generated by running the query doesn’t need a round trip into either JSON or the custom Timeline XML format.

The SPARQL Timeline demo works with any RSS 1.0 feed (try it with the one from Planet RDF) .

Update: Now also works with “raw” SPARQL results, try it with photos of laptops from The Gargonza Experiment (scroll to April of 2005). Expected variable bindings are date, title, description, and link, although the latter is optional and the first can be replaced by start.

Update: Now really works with “raw” SPARQL results. Due to javascript’s security model, only files on this server worked — until now. Also, a buglet regarding empty literal elements have been fixed.

(Almost) No More Comments

I haven’t been writing much here lately, but others have.

Or rather: They’ve tried.

Some time ago I turned off trackbacks and pingbacks completely, and changed the options for comments to require moderation before anything went online.

That hasn’t stopped the spammers though — I get at least ten mails about spam comments each day, and frankly that’s just not fun.

I should be upgrading to the lastest version of WordPress, as that includes the clever Akismet plugin for catching spam, which seems to work quite well on the other blogs I run. Also, I really should finish the plugin that leverages my social network through FOAF, that’d make for a really great combination, methinks.

Instead I’ve activated a plugin that turns off comments and pings within 30 days of the posting date.

I’m sorry for the inconvience for those who wish to comment on older posts — for now it has to be like that (but do send me a mail if you’d like to comment anyway).