Tuesday, December 2, 2008

IBM's XML challenge - joke?

I got an email today about this XML challenge from IBM, which sounded very interesting. But I was quite disappointed.

After registering, I was taken to a MCQ quiz, with the answer to each question almost given out in the introduction text. Oh well.

Next I was provided with 3 contests: Video Mania, Query Challenge, and Programming Contest. I'm no good at making videos, and the programming contest was only available to students, so I started on the Query Challenge.

The query challenge was about pureXML, which could be summarised as some kind of combination between traditional SQL and XML into their database management system.

They launched a website: http://db2xmlcontest.morphexchange.com, which acts as a quick console for those who don't want to download the huge package called DB2 Express-C, but I quickly found it vulnerable to XSS.

After a hard time struggling through their online documents to find reference for some simple queries, I finally managed to reach question 4, in which I needed to find out which country has bordering countries in other continents. Well, have a look at a sample data file:

<?xml version="1.0" encoding="UTF-8" ?><country cid="1"><border_countries>China 76 km, Iran 936 km, Pakistan 2,430 km, Tajikistan 1,206 km, Turkmenistan 744 km, Uzbekistan 137 km</border_countries><population>31056997</population><area unit="sq km"><total>647500</total><land>647500</land><water>0</water></area><boundaries unit="km">5529 </boundaries><coastline unit="km">0</coastline><currency>AFA</currency><fiscal_year>
21 March - 20 March
</fiscal_year><ports_and_terminals>
Kheyrabad, Shir Khan
</ports_and_terminals><elevation_extremes><highest_point>Nowshak 7,485 m</highest_point><lowest_point>Amu Darya 258 m</lowest_point></elevation_extremes></country>

WTF?!!! It's XML, why do they have to store the bordering countries in a stupid string, which isn't even comma-separated? I could still do it anyway, using the power of regular expression in my favourite language. But to do it with a single query, there's no way I'm gonna dig through the poorly documented website just to find some stupid string manipulation functions to get the job done.

2 comments:

Leon said...

Thanks for looking at the contest and giving the XML Query application a try. I completely understand your comment on the XML schema. It is by no means designed to be a good example of XML. It was created for hte contest to test the skill rather than to make it an example of best practices in XML. I think most people woould expect to see a list of elements representing bordering country with border length as an attribute or something along these lines.
DB2 Express-C is actually not just a large package. It is a complete DB2 database server that is available to anyone to use free of charge for development but also for deploying production applications. You can redistribute it as part of your own application to your customers at no charge as in "no money of any kind to pay IBM". nOh, and it includes all of those XML capabilities that you are using in the contest. By the way, the XML Query application that you were using actually runs on DB2 Express-C. It is written in Ruby on Rails and is deployed in the cloud on Morph Labs.

Leon Katsnelson
http://FreeDB2.com

Anonymous said...

haha,

yeah, websites like that are typically worth what you pay to visit them. Simply because they are mainly produced from the commercial viewpoint.

Not to provide great content, but for HR, or advertising. Kindly proven by Leon. who was quick on the ball checking referrers and all. Got to give them credit for at least being web2.O savvy (something i still refuse to be).

where you went wrong is probably having the screwed up view that anything with XML could sound interesting.

at the time of posting the service is down even.

personally i don't get why they try to hype "XML" all the time. as if it's a buzzword that signifies modern and quality. "superstar" is not chosen by accident.

The reality is that XML will fade into the background. Since it counts on advances being made in all fields of CS. When the sad fact is that technology has been more or less consolidating for a good while now.
Anyway the technologies mentioned are alright if you have any nails to hit with them. And it's ok to have harder questions in a quiz. You just weren't taking it as serious as they were :-) which sort or validates my point :D

you-know-who