[uf-discuss] [hcite] nesting container elements

Michael McCracken michael.mccracken at gmail.com
Thu Mar 29 11:41:01 PST 2007

(note - I originally sent this to uf-dev accidentally. My impression
is that more hcite people are on uf-discuss. Correct me if I'm wrong
and we can move this to uf-dev. Thanks!)

We need to deal with bibliographic details for things like chapters in
a book, articles in a journal or magazine, and issues in a series.

For designing a format, the main problem is that there are duplicate
items that need to be scoped - for instance, both the article and the
journal have a title.

The point has been made in a few places that many existing
bibliographic formats handle this by just adding fields at the top
level - for example in the common usage of bibtex, a chapter of a book
is a record of type "inbook", and the "title" field represents the
book title, while the chapter title is recorded in the "chapter"
field. For example:

title = {The Art of Computer Programming: Graph and Network Algorithms},
chapter = {Expander Graphs},

While it's certainly possible to continue this scheme of adding field
names whenever a publication type can be contained by another type
with clashing fields, other formats have adopted an approach that
avoids this field name multiplication, at the cost of a little extra
complexity in nesting. For example, an article in a journal,
represented in MODS XML (from
http://www.scripps.edu/~cdputnam/software/bibutils/mods_intro.html ):

<mods ID="C003">
        <title>Different base/base mismatches are corrected with
        different efficiencies by the methyl-directed DNA mismatch-repair
        system of E. coli</title>
   <relatedItem type="host">

In this way, when a journal has a title, you just use the 'title'
field, and you don't need to remember the difference between
'booktitle', 'chapter', 'journal', etc... There's also the advantage
that you can support more types of references without changing the
format to add new field names.

I am proposing that we treat these cases in hCite in a way similar to
MODS instead of the way BibTeX does it. Here's what I propose for

I propose a 'container' class name that would be attached to a nested
hCite instance to note when the nested hCite represents the containing
item for the root hCite. The journal example above would then look
something like this:

<span class="hcite">
    <span class="title">Different base/base mismatches are corrected with
        different efficiencies by the methyl-directed DNA mismatch-repair
        system of E. coli
   <span class="hcite container">
        <span class="title">Cell</span>


FWIW, I have code in BibDesk that interprets this nesting scheme to
translate into BibTeX, and it works pretty well.

*note - Yes, it is also useful to know the type of the container so we
can tell if we're looking at a book or a journal, but that's a
separate discussion we'll have to have soon enough. For now lets focus
on the nesting issue.


Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/

More information about the microformats-discuss mailing list