- From: Dan Connolly <connolly@w3.org>
- Date: Wed, 11 Feb 2004 10:52:43 -0600
- To: www-rdf-calendar@w3.org
On Fri, 2004-02-06 at 01:26, Dan Connolly wrote: > As we discussed on Wednesday, ical2rdf.pl is so crufty > that none of us likes to maintain it very much. > > "Plan to throw the first one away - you will anyway" (Fred Brooks). > > Now that I understand iCalendar data better, > I managed to code up the basic structure that > I designed while brushing my teeth and such... > > http://www.w3.org/2002/12/cal/icalWebize.py > v 1.3 2004/02/06 07:13:24 I showed it to a few people, one of whom suggested renaming it fromIcal.py to match toIcal.py. I'm sold on the idea, so... http://www.w3.org/2002/12/cal/fromIcal.py v 2.1 2004/02/11 16:40:23 > It doesn't work well enough to pass any of the tests > yet; it needs support for non-text properties, like > dates, before it'll do anything really interesting. It now works on many of the test inputs, but the outputs are different from ical2rdf.pl's. I'll send details in subsequent messages. > But unlike ical2rdf.pl where iterating over lines > dominated the whole program, icalWebize.py has a nice > stepwise design for dealing with iCalendar data: > > - contentLines(fp) does line folding and calls > parseLine() to break up name/params/value > > - findComponents() builds a nested list > of components > > - doCalendarObject serializes properties > and subcomponents as RDF/XML > - doEvent likewise > > ... and so on. > > For output, I'm using a sax-based XML writer from the > python-xml package. I'm not sure I'm happy with it, but > the sax interface is pretty stable and I'm sure it would be > easy to slot in something better. I could use an RDF > serializer, but that seems like overkill. I spent some time trying to replace the sax interface with an RDF serializer interface; it wasn't straightforward at all. The iCalendar data is very xml-tree-like. Making the unnamed nodes explicit in the code is a pain. I'm still leaning toward finding or making a better XML serializer. I'm tired of running tidy to indent the results so that I can look at them. -- Dan Connolly, W3C http://www.w3.org/People/Connolly/ see you at the W3C Tech Plenary in Cannes 1-5 Mar 2003?
Received on Wednesday, 11 February 2004 11:52:46 UTC