[uf-dev] `microformats` and a universal test suite

Toby Inkster mail at tobyinkster.co.uk
Thu Jul 15 08:26:43 PDT 2010


On Wed, 14 Jul 2010 21:11:22 -0700
Angelo Gladding <angelo at gladding.name> wrote:

> I am currently writing a universal parser [1]. It goes by the name
> `microformats` because I intend it to be as close as possible to a
> canonical codification of all things Microformats. This will be
> accomplished by codifying each specification in a Python module using
> what can best be described as a domain-specific language. See the
> `adr` definition [2] and accompanying tests [3].

I used something similar in Swignition, which has been ported to
HTML::Microformats. It summarises how each property is parsed, and how
they're mapped to RDF.

e.g.

http://goddamn.co.uk/viewvc/perlmods/HTML-Microformats/lib/HTML/Microformats/hRecipe.pm?revision=409#l62

Shows 'fn' follows pattern '1' which means that it's singular and
required, whereas property 'photo' follows pattern 'u*' meaning that
it's optional, multiple and parsed as a URL.

Most microformats have a few little features that can't be captured
that way, but I've found it covers most things.

Regarding test cases, have you seen Glen Jones' effort?

http://ufxtract.com/testsuite/

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>


More information about the microformats-dev mailing list