In this post, Bredan Eich talks about the possibilities for a major overhaul of the Mozilla (/Firefox) codebase. There are opportunities offered by being able to break with frozen APIs -
For example, we can get rid of RDF, which seems to be the main source of "Mozilla ugliness" humorously decried by Steve Yegge.
I must confess I've not gone further than "Hello World" with Moz, but there's no denying the code sample provided by Yegge is ugly. Robert Sayre goes further -
But dang, RDF does suck, and SQLite (which we already ship) has grown full-text indexing capabilities that outperform Lucene (by a lot, I hear).
So in what respects does RDF suck? For a start, Mozilla's got it very early on (I'm not sure, maybe even before the 1999 specs were finalized). Before anyone had spent much time playing with the stuff. It makes a lot of use of containers (Bag, Seq, Alt), idioms that were in effect deprecated by the 2004 specs. But even so, I've got plenty of code I've done with Jena recently which doesn't look that different from Yegge's example. There also RDF/XML, which tends to cause pain if you want to use regular XML tools.
But these things are all bathwater.
Robert makes an interesting statement a few lines after the quote above:
...we'd like to have annotations and other "extensible" features, while keeping things relatively normalized, because extensions will be able to hit the database, and we can't bank on them keeping everything in order if we denormalize to avoid joins.
Taking a step back, RDF can be viewed as a highly normalized relational model, in which the keys are URIs and an open-world assumption is made. This are the feature that make it well-aligned with the web - normalization simplifies the extensibility Robert mentions; URIs give it global consistency; the open world allows for unknowns out of local scope (a analog of the 404s of HTTP). RDF also has well-defined specifications, standards without vendor lock-in.
With SPARQL there's a simple query language, and its results are totally XML tool-friendly (or Javascript tool-friendly if you prefer). Turtle offers a human-friendly syntax for expressing data (comparable to JSON in terms of simplicity, given that JSON doesn't have URIs as first-class entities). Code for directly manipulating RDF can be ugly, but it doesn't have to be. Check this example from Mark Nottingham (using his Sparta API).
If Mozilla is to be considered an open platform for web development, surely RDF is an obvious choice?
Ok, there are still the performance issues to consider. But recent developments have shown that it's perfectly feasible to use a traditional RDBMS alongside RDF models, to get the best features of each (a very recent example being Henry Story's RDF/SPARQL-enablement of the Roller Weblogger).
I'd love to see using RDF to its best advantage through maybe a Javascript version of Sparta, backed by a SQLite store (dear LazyWeb...). Tighten up its Ajax (and other bathroom cleansers...). It'd also be good I reckon to include a lightweight HTTP server, and make it trivial to run the the thing headless for server-side apps written in whatever languages it will ultimately support. In other words I'd like to see Mozilla become a fully-capable Semantic Web platform, built on a streamlined and modernised core derived from its current good bits. Time to get away from tit-for-tat competition and simply blow the alternative browsers out of the water.
Take away : I reckon RDF is the baby in Mozilla's bath, it
should be nurtured not ditched.
(spotter : Shelley)
@en