4 Step quickguide

Quick guide to set up DDDS across an existing web site with existing URLs.

Throughout this example we will use the URL http://www.foo.com/page.html.

This demo assumes that:

  • You already have a web site and that you can easily create a 'page.html.rdf' file next to the existing 'page.html' files.
  • You control, or are good friends with, the person who manages the DNS zone file of 'www.foo.com'.

Step 1 - create the metadata.

For each URL you want to provide information about create a companion file with the RDF about the URL which simply as '.rdf' postfixed. E.g. if you have a page called 'page.html' or an image called 'me.gif' then you put a short RDF (Using for example Dublin Core or FOAF) description of each in 'page.html.rdf' and 'me.gif.rdf' respectively.

Step 2 - advertize the route to -your- metadata.

In DNS there is propably now an entry like

www.foo.com. IN CNAME bar.foo.com.
or perhaps
www.foo.com IN A 123.45.12.7
which points to your web servers canonical name or IP address.

Just below this, on the next line, insert the lines:

IN NAPTR 10 10 "u" "http+I2R" "!(.*)!\\1!" .
IN NAPTR 10 10 "u" "http+I2C" "!(.*)!\\1.rdf!" .

and restart your DNS server after updating its 'serial number' in the SOA record at the start of the file.

What this does is insert a simple minded rule which says that the resource with the given URL can be fetched from that very location (first line) using HTTP and that in order to get the metadata you need to postfix .rdf and then fetch the resulting URL (the "u" flag) using HTTP as well.

Note that this is a very simple rule; which applies for the while www.foo.com URI space; and only defines how one gets things using the HTTP protocol.

Step 3 - test the DNS record

With the command

dig -t NAPTR www.foo.com
check that the record has properly propagated.

Step 4 - testing that it all works.

Download any of the tools on the right - and type the command

./resolve -r http://www.foo.com/page.html
which should give you back the original resource. And then try the command:
./resolve -c http://www.foo.com/page.html
which should give back the RDF description of the above URL.

Thats it.

Create a self managed URN for your own foaf here or see these examples.

Ready to run code in ANSI-C, java 1.x and perl. Note that this ' code is alpha quality and far from beeing secure or production ready at this time.

This code is under an open source style license and comes without warranty.