Although regular readers of O’Reilly Weblogs probably already grasp the difference between XML and RDF, I still occassionally talk to a developer who is unsure of the difference.

I recently co-presented a discussion at the British Computer Society on the Semantic Web and Social Technologies. This is how I described the difference between the technologies.

I’ve created a new reality TV show called The XML Factor, set in the future (I’m not sure if you get The X-Factor in the U.S., but it’s just like Pop Idol). In this show, Simon Cowell (whose body has been replaced with robotics, for some reason - probably just because it’s the future) judges mark-up languages and technologies on their relative merits.

Simon Cowell and XML

With XML, Simon is impressed by his technical ability - very flexible, can perform any song - but just isn’t feeling any emotion. This is because XML is basically just a data format. A pretty good one, but there is no built-in meaning to an XML file; unless your computer has prior knowledge of a particular type of XML (a particular schema, like XHTML or SVG), it won’t be able to do much with it.

Simon Cowell and RDF

With RDF, it’s a different kettle of fish. Simon’s really feeling it. RDF may not have the technical flexibility of XML, but she’s got real emotion in her voice. And that’s because RDF is all about conveying semantics (OK, maybe that’s a bit of a twist of the truth, it conveys statements about things). RDF isn’t a data format, it’s… a model (hence the picture above, and the following particularly bad pun).

Are you sure you’re ready for this pun? OK… Well:

  • like all good models,
  • RDF is very simple,
  • and hence is easy to take advantage of.

See? Told you it was bad… Anyway, in conclusion, RDF is not a data format, but a simple model (which goes a bit like: something has a something of something). Which means that whenever a computer gets hold of an RDF file, no matter how complex, or what it’s about, it can always break it down to a set of these statements - i.e. information that follows this model.

Any more bad XML or RDF puns out there?