Don’t call me DOM

9 July 2004

GRDDLizer for visited countries

Filed under:

Having discovered the RDF Vocabulary to describe countries one has visited that Morten had developed and integrated in a WordPress plug-in, and seeing the nice results it gives in the FOAF explorer, I decided I wanted to use it, too.

But I was kind of reluctant to use the WordPress plug-in for this: I don’t want to put too much in my wordpress set up, and generally speaking, I’d rather avoid using too much of the database infrastructure that comes with it. Plus, I already had a list of countries I visited in XHTML on my personal web site, and it didn’t look like a good practice to duplicate that.

The obvious solution was rather to GRDDL-ize my HTML page to have it generate the relevant RDF, and so I did.

  1. first, since the Semantic Visits schema is used in the context of FOAF, the GRDDL-izer had to be integrated somehow with the FOAF GRDDL-izer; to make that possible, I added a qualified-named template to the latter (foafGrddl:extend, with foafGrddl bound to the URI of the XSLT), which by default does nothing
  2. then, I created a new XSLT that imports the FOAF GRDDL-izer, and overrides the foafGrddl:extend template with one that scrapes XHTML mark up to extract the list of countries (the details of the mark up conventions are documented in the XSLT itself)
  3. adding a <link rel='transformation' href='' /> in my XHTML page, plus the GRDDL profile in the head element gave the expected reults in RDF (through the GRDDL demonstrator)
  4. … which I was able to verify in a more human-friendly way, using FOAF explorer

So, that makes a visual representation of the countries you visited almost directly available from a well-formatted XHTML page!

There a few issues that this raises, though:

  • the mark up convention for identifying countries relies on having the id attribute set to the relevant ISO country code; this obviously doesn’t scale well – e.g. you can’t have twice the same country in the same page, and isn’t really user-friendly for the user
  • the extension mechanism for the FOAF GRDDLizer is really ad-hoc; i.e., having write access to the FOAF GRDDLizer, it was easy enough for me to add this extensibility point, but should GRDDLizers become more widely deployed, that’s not something you should rely on; of course, license permitting, there is always the possibility to copy the XSLT and extend it in a new version, but it has the usual drawbacks in terms of maintenance; I wonder if there is a way around this
  • it would be much cooler if this didn’t have to go through the GRDDL demonstrator, i.e. if one could use the FOAF explorer directly on an XHTML page (esp. with the handy bookmarklet); I guess a patch to the getFoaF PHP module would be in order

One Response to “GRDDLizer for visited countries”

  1. Karl Dubost Says:

    I guess it’s time for me to create a country list page :)

Picture of Dominique Hazael-MassieuxDominique Hazaël-Massieux ( is part of the World Wide Web Consortium (W3C) Staff; his interests cover a number of Web technologies, as well as the usage of open source software in a distributed work environment.