[uf-discuss] class="tag"

Toby A Inkster mail at tobyinkster.co.uk
Fri Jun 27 16:03:39 PDT 2008


It has been documented <http://microformats.org/wiki/rel-tag-other- 
evidence> that rel-tag places significant limitations on authors'  
choice of tag space.

Many popular blogs (in case you doubt the popularity of these blogs,  
they were all in the top 40 results from a Google search for "blog"  
at the time of writing) include category links that do not have URIs  
suitable for use with rel-tag:

	* http://dilbertblog.typepad.com/
	* http://dig.csail.mit.edu/breadcrumbs/
	* http://stephenfry.com/blog/
	* http://blogs.msdn.com/ie/ (currently using rel-tag incorrectly)
	
Additionally, authors may wish to use links to searches for terms on  
Google or various dictionary/thesaurus sites as tags, but these do  
not typically use URIs suitable for rel-tag.

One of the principles <http://microformats.org/wiki/principles> of  
microformats is to build around current behaviours and usage  
patterns. Microformats involve adding a few class names and rel  
values to existing semantic HTML; they should not require major  
overhauls in publishing patterns. Requiring authors to fiddle  
with .htaccess files (or whatever) to provide themselves with a clean  
tagspace raises the barrier to entry too high. The alternative:  
asking them to use a third party's tagspace (e.g. link all their tags  
to Wikipedia or Technorati or whatever) is unrealistic, and doesn't  
fit with existing publishing.

So I propose an extension to rel-tag.

As outlined above, there are many blogs which cannot easily use rel- 
tag. However, there are also a large number that can, and already do.  
So any extension to rel-tag has to be completely compatible with the  
existing specification. Any existing data marked up with several rel- 
tags should not find that the meaning of their tags has changed under  
the extended format.

My proposed solution is that rel="tag" continues as-is, but  
class="tag" is introduced as a parallel mechanism for marking up  
tags. When class="tag" is used, the link text is used as the tag  
value, subject to value excerption. Like rel="tag", class="tag" will  
only be allowed on <a> and <area> tags, and not non-linking elements  
such as <span>, nor invisible elements such as <link>.

As per the microformats principles, class="tag" is a use of semantic,  
meaningful HTML; it is an example of visible metadata; and of course  
it reuses terminology from rel-tag.

Examples:
<a rel="tag" href="http://example.com/tags/TheTag">NotThis</a>
<a class="tag" href="http://example.com/tags/NotThis">TheTag</a>

For backwards compatibility reasons, when both rel="tag" and  
class="tag" attributes are found on the same element, then the  
existing rel="tag" parsing rules take precedence.

Example:
<a rel="tag" class="tag" href="http://example.com/tags/ 
TheTag">NotThis</a>

Under this proposal, class="tag" would be allowed anywhere that rel- 
tag is currently allowed, including hCard categories and xFolk tags.

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





More information about the microformats-discuss mailing list