Thursday, August 13, 2009

On sorting files... part 3, exchange format

In this post I want to talk about the content of the metadata itself and the format in which it is distributed...

Let's take a similar example of metadata exchange: del.icio.us (or delicious.com now). I have to admit that delicious is the initial idea that got me thinking about this problem of file exchange sorting. What I liked about the delicious example was the API. Like a lot of web application, the API is a simple webpage that you call using arguments in the url. (you can see it here)

I propose either XML or JSON as these format are well understood and easy to implement but really, any sort of inter-exchange format, it could be implemented.
That metadata need to include:
  • Filename
  • Md5 & Sha1 Hash (optionally Sha256 / Sha512)
  • Description
  • List of Tags
  • optional website
A bit like the data del.icio.us stores about each bookmark.

A method of distribution of all that information also needs to be created. Either something like a url on the distribution server (like http://server/file-metadata/name/file.exe or http://server/file-metadata/index.php?&filename=file.exe) that would produce a page with the XML or JSON. Something that looks like:

{
"Filename": "executable.exe",
"hashsum": {
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
"metadata": {
"Description": "Description",
"tags": "Info, executable",
"Website": "http://www.wwww.com"
}
}

Or like:

<?xml version="1.0" encoding='UTF-8' ?>
<File Filename="executable.exe" >
<hashsum>

<md5>d41d8cd98f00b204e9800998ecf8427e</md5>
<sha1>da39a3ee5e6b4b0d3255bfef95601890afd80709</sha1>
<sha256>e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</sha256>

</hashsum>
<metadata>

<Description>Description</Description>
<tags>Info, executable</tags>
<Website>Http://www.www.com </Website>

</metadata>
</File>

Or course the devil is in the details and this should be considered a draft and not a definitive thing. The notion of web API has been done before and I really just wanted to give an idea of how I think things could be done.

Update: I was specifically talking about a RESTful API. I could not remember the name when I wrote this post. Here are a couple of links on the subject:

No comments: