MadMode

Dan Connolly's tinkering lab notebook

using JSON and templates to produce microformat data

In Getting my Personal Finance data back with hCalendar and hCard, I discussed using JSON-style records as an intermediate structure between tab-separated transaction report data and hCalendar. I just took it a step further in palmagent; hipsrv.py uses kid templates, so the markup can be tweaked independently of the normalization and SPARQL-like filtering logic. I expect to be able to do RDF/XML output thru templates too.

Working at the JSON level is nice; when I want to make a list of 3 numbers, I can just do that, unlike in XML where I have to make up names and think about whether to use a space-separated microparsed attribute value or a massively redundant element structure.

It brings me back to my March 1997 essay for the Web Apps issue on Distributed Objects and noodling on VHLL types in ILU.

In SExpr.isl, I wrote:

(* table allows natural marshalling of:
    perl associative arrays
    scheme hash tables
    python dictionarys
    postscript dictionaries
    SmallTalk dictionaries
*)

I'm not sure how far this approach goes; it's more convenient than the RDF data model in a lot of ways, but I'm not sure about namespace mixing, not to mention object sharing. I wonder how long I can go before I hit those issues...

I don't have as much energy to write this the 2nd time; firefox 1.5 crashed and ate the 1st draft just as I was finishing it. :-{