RESTful interface to Drupal topic map module

RESTful interface to Drupal topic map module

Posted August 7th, 2008 by shunting

This URI:

http://localhost.local/drupal/?q=exposed&type=is_a&c=role&man=player&i=role&Homer=player

Yields this page:

when there is exactly one proxy (association) with the roles, players, and types in the URI. If there are no proxies, the URL yields an error message. If there is more than one proxy, a disambiguation page is produced.

Various distinctions between parallel efforts:

1. This application does not conform to the TMDM (although it does disclose under ISO 13250), so TMAPI isn't appropriate.

2. Ditto topicincs.

3. I'd love to see Alexander Johannsen's framework, but unless I missed the memo, he hasn't released it.

So, again, the URI:

http://localhost.local/drupal/?q=exposed&type=is_a&c=role&man=player&i=role&Homer=player

looks an awful lot like:

[[test:is_a[c:man] ... [i:Homer]]

and so it ought to, since they both represent the same proxy tuple fashion. (Where's map "test," you ask? To which I answer, I did not add it, because I didn't see how the user could be expected to know it, or even guess at it.)

Comments on this necessarily partial and complete implementation:

1. GET parameters seem like a very natural way to represent the key/value pairs of the topic map reference model, perhaps because they are key/value pairs. However, I need to develop more clever heuristics for when role player combos get out of order.

2. Values like "Homer" are the "keys" in the URL, because TMRM keys can duplicate. This means that associations that have the same player playing more than one role won't be returned. So maybe the syntax is naive!

3. Like maps, I couldn't think of a way to nicely or kindly represent player notations ("90210=zip")

4. I think what my failures to represent maps and notations really point to is a need for a process whereby a disclosure is negotiated (and hopefully without a central registry, which is vulnerable to attack). Or maybe not. Maybe the discovery process shouldn't be done at the server level, and communities of interest need to develop and publicize their own map names.

A uniform RESTful API for all topic map applications would be a wonderful subject for a Nocturne for Balisage.