Jump to: navigation, search


rel-tag frequently asked questions

This document serves to answer and discuss frequently asked questions specifically about the rel-tag microformat. You may want to read the rel-faq first as it answers many common questions about the HTML4 "rel" and "rev" attributes, and their linktype values. If you have a new question to ask, first consider asking on the microformats-discuss list.


Where does a tagging link belong?

Where shouldn't I use rel-tag?

Path with a . in

Using Apache mod_rewrite

<Directory "/home/user/public_html/app/>
    RewriteEngine On
    RewriteRule ^tag/([^/]+)$ script.php/$1 [last]
RewriteEngine On
RewriteMap tag int:escape
RewriteRule ^/~user/app/tag/([^/]+)$ /~user/app/script.php?tag=${tag:$1} [last]
<Directory "/home/user/public_html/app/>
    RewriteEngine On
    RewriteRule ^tag/(.*)$ script.php?tag=$1

Does a rel tag still have meaning if the link redirects?

rel-tag in Link elements

CSS selector

Are tags case sensitive?

Multi-word tags

Tags with file extensions

Any file-name extension in the last path segment is part of the tag value:

The rel-tag specification is clear on how to extract a tag from a URL. Special treatment for file-name extensions is not part of the extraction. Brian Suda gave an explanation on the microformats-discuss list. Consider the following URLs, the tags that the following URLs give under the current specification, and the effect of requiring special treatment for file-name extensions on the tags that the following URLs give.

What about Scope?

Since rel-tag is a feature used in many other microformats, the question often arises: "What is the scope of the tag?" For instance, a rel-tag may appear inside of an xfolk xFolk entry and on first glance it may appear that the tag should only apply to that entry. However, current publishing practice seems to indicate anything appearing on a page is likely related to the content of the page. Therefore, the interpretation is that not only does the rel-tag apply its direct container but to all containers and to the document as a whole; it contains the xFolk entry. This is a departure from strict knowledge theory in favor of real-world usage.

As another example, you may link to your friend Joe with XFN and hCard, indicating in his categories that Joe is interested in swimming, which you loathe. Since the article is primarily about you and not about Joe's hobbies and because the rel-tag is inside an hCard, you may expect that the rel-tag does not apply to the document; however, the document does contain information about swimming, albeit tiny, namely that your friend likes it. In this way, rel-tag is binary: it indicates direction (yes or no) but not magnitude. This equivalent to a free-text search sans [tf-idf]; i.e. without a notion of term relevance.

The upshot of this is that rel-tags can have downward scope but not upward scope.

Encoding and decoding the tag text in JavaScript

If you want to get the text of the tag using JavaScript, you should use decodeURIComponent() to get a text representation of the tag, not escape. decodeURIComponent will properly handle UTF-8.

Related pages

The rel-tag specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added. These thoughts, issues, and questions are kept in separate pages.

rel-tag-faq was last modified: Monday, June 29th, 2015