I’ve been doing a lot of work with Microformats, recently, but have hit a stumbling block: scoping. According to the reltag specification, scoping is possible:
rel=”tag” is specifically designed for “tagging” content, typically web pages (or portions thereof, like blog posts)
Source: reltag
For example, here’s a chunk of code borrowed from ideaShrub:
<li class="shrub"> <h2><a href="">...</a></h2> <div class="date">...</div> <p class="desc">...</p> <p> <img src=""/> <strong>Tags:</strong> <a href="" rel="tag">ideashrub</a> <a href="" rel="tag">documentation</a> </p> ... </li>
For this block, the appropriate scope for the two tags is within the ‘li’ element – but how can I specify that? For all some application knows, the ‘scope’ of those tags is within the ‘p’ element – or maybe the tags are related to the page as a whole. Why isn’t this specified anywhere? How should scoping be handled – am I missing something?
On the other hand, if you look at the hcard microformat, they seem to be a little bit clearer by saying that a card is wrapped in:
<div class="hcard">...</div>
Which makes sense. Maybe there needs to be some sort of generic ‘object’ or ‘item’ microformat – you could use reltag, xfn, and even hcard all together to describe the object at hand – it just needs a proper scoping wrapper to make it possible. Should I be looking at RDF for this sort of issue, or am I just overlooking something?
Bob Aman (August 5, 2005 at 9:32 am)
As much as I love rdf, I don’t believe it has a big future, except perhaps in the form of foaf, where it seems to be ideally suited because of the graph-like nature of social relationships. Basically, the problem is that it’s far too rigid and difficult to parse. (Though, It’s not too hard to produce.) I would stick with the microformats primarily. That said, if you have an opportunity to duplicate the information in the form of rdf, absolutely, go for it. Just don’t make it your only method for publishing metadata.
As for your actual question, I wouldn’t have put the tag information inside the paragraph in the first place. Semantically, I wouldn’t consider tags to the sort of content that belongs in a paragraph, because really, tags are always metadata. So I would just rearrange your content to read something like:
<li class=”shrub”>
<h2><a href=””>…</a></h2>
<div class=”date”>…</div>
<p class=”desc”>…</p>
<p>
<img src=””/>
</p>
<strong>Tags:</strong>
<a href=”” rel=”tag”>ideashrub</a>
<a href=”” rel=”tag”>documentation</a>
…
</li>
If you have to, use CSS to move the content around to get it back to how you wanted it to be.
John Resig (August 5, 2005 at 10:55 am)
Bob Thanks for the suggestion – I’ve already implemented it! Also, I decided to markup the li (and its contents) using the xFolk specification – which utilizes reltag, specifically.