I have just uploaded the latest draft of the ODD specification to OpenDD.net, so pop over and take a look.

Since the last release of the draft I’ve done a fair amount of work to simplify the format even further; simplifying terminology, clearing up some inconsistencies and dropping namespaces altogether.

You’ll notice that we still don’t define any terms. As Ben touched on in a recent post, we decided to not confuse the format by trying to tie it to any one application, while keeping it as easy as possibly to actually use. I’ll cover this in more detail a bit later…

So, lets talk about how I’m using ODD to implement full data import and export in the upcoming release of ElggElgg 1.

For those who don’t already know, Elgg is an Open source social networking application engine. The previous version has been downloaded over 100K times, and Import and export was one of the most frequently requested enhancements.


Export was a fairly trivial matter. The new version of Elgg employs a flexible event system, so all I had to do was trigger an “export” event.

This event is passed a GUID – an identifier identifying the thing you are exporting, and elements of the system (and thirdparty plugins) can listen for this event and react accordingly.

The event is essentially asking all parts of the Elgg application – core and plugins – “Tell me all you know about X”. The export listens to the answers and converts it into an ODD document that looks something like this:

<odd version="1.0" generated="Wed, 30 Apr 2008 22:21:55 +0100">

<entity uuid="http://example.com/odd/78/" class="object" subclass="blog" published="Fri, 18 Apr 2008 11:45:50 +0100" />

<metadata uuid="http://example.com/odd/78/attr/owner_uuid/" entity_uuid="http://example.com/odd/78/" name="owner_uuid" published="Fri, 18 Apr 2008 11:45:50 +0100" >http://example.com/odd/77/</metadata>

<metadata uuid="http://example.com/odd/78/attr/title/" entity_uuid="http://example.com/odd/78/" name="title" published="Fri, 18 Apr 2008 11:45:50 +0100" >test</metadata>

<metadata uuid="http://example.com/odd/78/attr/description/" entity_uuid="http://example.com/odd/78/" name="post" published="Fri, 18 Apr 2008 11:45:50 +0100" >First post</metadata>

<metadata uuid="http://example.com/odd/78/metadata/35/" entity_uuid="http://hexample.com/odd/78/" name="tags" type="metadata" owner_uuid="http://example.com/odd/77/" published="Fri, 18 Apr 2008 11:45:50 +0100" >wibble</metadata>


Here we see an entity (in this case a blog post), and some details about it (the metadata).


Import is traditionally the more complicated part of the equation. ODD is trivial to parse, each tag is atomic and represents exactly one thing, this is a big advantage from the point of view of anyone implementing a reader for it since it makes the whole thing pretty much stateless.

ODD tags arrive, whether as a file to import or as a live feed, and an event is triggered. This event passes around the tag and essentially asks the question “Does anyone know how to handle this?”.

The stateless nature of ODD of course meaning that you don’t have to process the entire file, making it a trivial matter to implement a reader using a SAX parser.

That just about covers it, I’ll be posting some example code in a few days (workload permitting) so hopefully people can start getting stuck in. If you want to get involved in development, please head over to the ODD group.

A final note: I will be in San-Francisco all next week, so if you are in the bay area and feel like having a chat about ODD or Elgg, then please get in touch!

7 thoughts on “ODD and Import / Export

  1. I have a hard time getting what the value in that data is… what have you exported? And what are you importing? A list of previous blog posts?

  2. Pictured here is a trivial example (exporting one blog post), mainly because a full export is quite a long file.

    With the ODD implementation in Elgg you can move part or all of your data about between hosts, synchronise your account details, as well as produce an RSS like feed for things that RSS doesn’t cover.

  3. So in real world, what are going to be benefits of the new functionality…will it be possible to get data from other SN sites imported into Elgg, like profile data etc…or?

  4. @Haris ODD primarily addresses a need we have to be able to move data which has yet to be defined between Elgg sites (elgg systems remember have plugins which add to the data that needs to be shifted about).

    So, the answer is definitely yes between Elgg and Elgg classic sites.

    The reason why we have opened the format up to people to discuss is that we are very keen to see others pick it up…. this may or may not happen. Some SN’s business models are based around keeping users so perhaps not for some, others probably.

    Of course because the UUID points to a representation of a user, there’s no reason why they couldn’t mimic the effect you want without actually doing an import/export, and making the SN somewhat distributed.

  5. Can I export the social graph this way, too? or I must do other things for it’s possible.

    Obviously, I think that in the class field we must put the user class, but the rest I don’t have clear

  6. What happened to ODD ? and all the nice airs about it since Marcus Povey veered from the elgg flock to venture into the nether-bytes-at-1-times-stratospeheric-stratas.. I started looking into Elgg’s ‘built-ins’ ODD export/ imports for some formalized data exchanges… then kinda slow-like figured that not much has been said around ODD for quite a long time.

  7. In many ways I think ActivityStreams can be thought of as the spiritual successor to ODD. It tries to do much of the same kind of stuff that we were trying to do with ODD, and has got greater attention and resources behind it.

Leave a Reply