rel-faq: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(rel-examples ()
(is rev a perfect use case for anything? no it's unusable.)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<h1> "rel" attribute frequently asked questions </h1>
<h1> "rel" attribute frequently asked questions </h1>
{{TOC-right}}
This document serves to answer and discuss frequently asked questions about the HTML4 "rel" and "rev" attributes, and their linktype values. Specifically this document explores a number of issues common to and exposed by the various [[microformats]] which extend the HTML4 rel attribute.


This document serves to answer and discuss frequently asked questions about the HTML4 "rel" and "rev" attributes, and their linktype values. Specifically this document explores a number of issues common to and exposed by the various [[microformats]] which extend the HTML4 rel attribute.
== FAQ ==


__TOC__
===How is rel used ===
''How is the '<code>rel</code>' attribute used?''


== Authors ==
<code>rel</code> values indicate the relationship '''''of''''' the target resource '''''to''''' the resource on which they appear. In microformats, <code>rel</code> are used on links (e.g. <code><nowiki><a rel="home" href="http://example.org"></nowiki></code>). Elsewhere, they are also used on <code>link</code> headers (e.g. <code><nowiki><link rel="start" href="http://example.org/section/page1.htm"></nowiki></code>.
* John Allsopp, [http://westciv.com Western Civilisation]
* [http://tantek.com Tantek Çelik], [http://technorati.com Technorati, Inc]
* [[User:AndyMabbett|Andy Mabbett]]


== FAQ ==
Multiple values may be used, in the same manner as multiple <code>class</code> values (e.g. <code><nowiki><a rel="home me contents" href="http://example.org"></nowiki></code>).


===What microformats use "rel"? ===
===What microformats use rel ===
''What microformats use '<code>rel</code>'?''
*[[rel-directory]]
*[[rel-directory]]
*[[rel-license]]
*[[rel-license]]
Line 21: Line 22:
*[http://gmpg.org/xfn/ XFN]
*[http://gmpg.org/xfn/ XFN]


=== What is the proper use of the 'rel' attribute? ===
=== What is the proper use of the rel attribute ===
''What is the proper use of the '<code>rel</code>' attribute?''


First, you can use the [http://www.w3.org/TR/html4/types.html#type-links linktype] as specified in [http://www.w3.org/TR/html4/ HTML 4]. A well known example of this is rel="stylesheet". Second, you "can extend the rel attribute using a [http://www.w3.org/TR/html4/types.html#type-links profile"], but "[http://www.w3.org/TR/html4/types.html#idx-link_type-2 HTML doesn't specify/recommend a profile format]". XMDP can be used to formally define new rel values.
First, you can use the [http://www.w3.org/TR/html4/types.html#type-links linktype] as specified in [http://www.w3.org/TR/html4/ HTML 4]. A well known example of this is rel="stylesheet". Second, you "can extend the rel attribute using a [http://www.w3.org/TR/html4/types.html#type-links profile"], but "[http://www.w3.org/TR/html4/types.html#idx-link_type-2 HTML doesn't specify/recommend a profile format]". XMDP can be used to formally define new rel values.


=== What does a rel value really mean? ===
=== What does a rel value really mean? ===
''What does a '<code>rel</code>' value really mean?''


The rel values in HTML follow a consistent pattern which at a minimum ''implies'' a deliberate design. rel describes the relationship of a hyperlink in terms of what the destination (href) is, to the source, or from the source's perspective. rel="stylesheet" is perhaps the easiest example to understand in this manner, because it is saying that this resource over there (indicated with the href) ''is'' a "stylesheet" for the current document.  Similarly, rel="help" link states that the resource indicated by the href is "help" (e.g. a help file or FAQ) for the current document.  All the rest of the values defined in HTML4 also follow this pattern of being a ''noun'' which labels the resource indicated by the href, from the perspective of the current document.
The rel values in HTML follow a consistent pattern which at a minimum ''implies'' a deliberate design. rel describes the relationship of a hyperlink in terms of what the destination (href) is, to the source, or from the source's perspective. rel="stylesheet" is perhaps the easiest example to understand in this manner, because it is saying that this resource over there (indicated with the href) ''is'' a "stylesheet" for the current document.  Similarly, rel="help" link states that the resource indicated by the href is "help" (e.g. a help file or FAQ) for the current document.  All the rest of the values defined in HTML4 also follow this pattern of being a ''noun'' which labels the resource indicated by the href, from the perspective of the current document.


=== Then what does "rev" mean? ===
=== Then what does rev mean ===
''Then what does '<code>rev</code>' mean?''


"rev" is the precise opposite (or "reverse") of the "rel" attribute.  E.g. a rev="help" link indicates that ''the current document'' is "help" for the resource indicated by the href.
"rev" is the precise opposite (or "reverse") of the "rel" attribute.  E.g. a rev="help" link indicates that ''the current document'' is "help" for the resource indicated by the href.


=== Is rel single or bi directional? ===
=== Is rel single or bi directional ===
''Is rel single or bi-directional?''


Though the HTML4 specification is not specific on this point, all the rel values in the HTML4 specification follow a very consistent pattern that indicate a specific directionality to the value of the rel attribute.  The ''only'' exception to this is the value "alternate", which, is actually inherently symmetric, so rel="alternate" means pretty much the same thing as rev="alternate".  I say pretty much because in theory (and in practice) one of a pair of alternates is likely to be more definitive, and thus one is more a primary resource, with the other being an alternative.  In theory you could extend rel with a new value, e.g. "original" which could be used to point back the original version of a document.  This could be used for example with translations, where translations of a document would point back to the original with rel="original".
Though the HTML4 specification is not specific on this point, all the rel values in the HTML4 specification follow a very consistent pattern that indicate a specific directionality to the value of the rel attribute.  The ''only'' exception to this is the value "alternate", which, is actually inherently symmetric, so rel="alternate" means pretty much the same thing as rev="alternate".  I say pretty much because in theory (and in practice) one of a pair of alternates is likely to be more definitive, and thus one is more a primary resource, with the other being an alternative.  In theory you could extend rel with a new value, e.g. "original" which could be used to point back the original version of a document.  This could be used for example with translations, where translations of a document would point back to the original with rel="original".


=== Are "rel" attributes, and linktypes in general, just document to document? ===
=== Are rel attributes and linktypes in general just document to document ===
''Are "rel" attributes, and linktypes in general, just document to document?''


The vast majority of the rel values defined in HTML4 are from a document to a document.  rel="stylesheet" is a bit of an exception, as it from an HTML document to a style sheet, which is more like a set of styling rules and instructions than a "document" in the classical sense.  Two notable exceptions are rel="copyright" and rel="bookmark" which describe the relationship from the current document to (potentially) only part of a document.  The 'rev' attribute adds an interesting perspective on this question.  Specifically, [http://www.w3.org/TR/html4/struct/links.html#rev-link 12.3.1 of HTML4] shows an example of two links one using rel and the other using rev which mean the same thing.  Thus linktypes in general may be either from a whole document or part of a document to a whole document or a part of a document.  For example, the RelTag specification introduces the rel="tag" value, and notes that it indicates a relation from a document or major portion thereof to a document.  Finally, XFN probably stretches rel the farthest, as it uses rel to indicate a person to person relationship. This person to person scope was not introduced by XFN, but merely adopted.  It was introduced by bloggers who have taken to linking to other bloggers by name and thus using people's blog URLs as proxies for people themselves.
The vast majority of the rel values defined in HTML4 are from a document to a document.  rel="stylesheet" is a bit of an exception, as it from an HTML document to a style sheet, which is more like a set of styling rules and instructions than a "document" in the classical sense.   


=== Is/Was VoteLinks a proper use of rel? ===
Two more notable exceptions are rel="copyright" and rel="bookmark" which describe the relationship from the current document to (potentially) only part of a document. 
 
The 'rev' attribute adds an interesting perspective on this question.  Specifically, [http://www.w3.org/TR/html4/struct/links.html#rev-link 12.3.1 of HTML4] shows an example of two links one using rel and the other using rev which mean the same thing.
 
Thus linktypes in general may be either from a whole document or part of a document to a whole document or a part of a document. For example, the [[rel-tag]] specification introduces the rel="tag" value, and notes that it indicates a relation from a document or major portion thereof to a document.
 
Finally, [[XFN]] probably stretches rel the farthest, as it uses rel to indicate a person to person relationship. This person to person scope was not introduced by XFN, but merely adopted from emergent publishing behavior on the Web. It was introduced by bloggers who have taken to linking to other bloggers by name and thus using people's blog URLs as proxies for people themselves.
 
=== Do rel values refer to a relationship to the page or the contents of the page or both ===
''When a 'rel' value refers to a relationship to or from a page or document, is it referring to just the page, or the contents of the page, or both?''
 
The consensus (and convention; '''citation needed''') is that such rel values are referring to the page itself including its immediate contents, but not for example to embedded contents of like images, objects, frames etc.
 
=== Was VoteLinks a proper use of rel ===
''Is/Was VoteLinks a proper use of rel?''


No. The problem with using rel for VoteLinks is made apparent with the following example:
No. The problem with using rel for VoteLinks is made apparent with the following example:
Line 51: Line 71:
Following the reasoning in the earlier answer to the question of what a rel value means, this link would mean:
Following the reasoning in the earlier answer to the question of what a rel value means, this link would mean:


The resource indicated by http://www2005.org is a "vote-for" the current document.
:The resource indicated by http://www2005.org is a "vote-for" the current document.


That clearly doesn't make any sense, and was certainly not the intent of VoteLinks. Ironically, the reverse makes a lot more sense:
That clearly doesn't make any sense, and was certainly not the intent of VoteLinks. Ironically, the reverse makes a lot more sense:


The current document is a "vote-for" the resource indicated by http://www2005.org.
:The current document is a "vote-for" the resource indicated by http://www2005.org.


And generalizing to the same cultural usage links as XFN:
And generalizing to the same cultural usage links as XFN:


The current document, as a proxy for the person who wrote it (e.g. the blogger whose blog it is),  
:The current document, as a proxy for the person who wrote it (e.g. the blogger whose blog it is), is a vote-for the resource indicated by http://www2005.org.
is a vote-for the resource indicated by http://www2005.org.


Fortunately the "rev" attribute captures this "reverse" relationship semantic, and thus the above example should be written like this:
Fortunately the "rev" attribute captures this "reverse" relationship semantic, and thus the above example should be written like this:
Line 70: Line 89:
And thus VoteLinks has been changed to use "rev" instead of "rel", in order to keep the well known and easily understandable "vote-for", "vote-abstain", and "vote-against" values.
And thus VoteLinks has been changed to use "rev" instead of "rel", in order to keep the well known and easily understandable "vote-for", "vote-abstain", and "vote-against" values.


=== Should 'rev' even be used ===
=== Should rev even be used ===
''Should 'rev' even be used?''
 
In (X)HTML, the same values may be used as <code>rev</code> ("reverse relationship") values, to indicate the relationship '''''of''''' the resource on which they appear '''''to''''' the target resource.
 
However, given that the 'rev' attribute has been more often misused by authors than properly used ([http://code.google.com/webstats/2005-12/linkrels.html Google Code: Web Authoring Statistics: Link Relationships]) is it even a good idea to use rev at all?
 
The short answer is unfortunately "'''NO'''".  Use of "rev" {{should}} be avoided.
 
However, VoteLinks' use of rev has been [[glossary#grandfathered|grandfathered]] since it was such an early use.
 
No future microformats should be developed that use 'rev', and any use of 'rev' (apart from the "[[glossary#grandfathered|grand-fathered]]" case of [[vote-links|VoteLinks]]) is [[glossary#deprecated|deprecated]] in microformats.
 
More data on use of rel/rev:
* http://philip.html5.org/data/link-rel-rev.txt - 127249 random pages from dmoz.org downloaded on 2008-02-26.
which demonstrates poor understanding of the rev attribute, e.g. <code class="html">&lt;link rev="1.02" ...&gt;</code>


Given that the 'rev' attribute has been more often misused by authors than properly used ([http://code.google.com/webstats/2005-12/linkrels.html Google Code: Web Authoring Statistics: Link Relationships]) is it even a good idea to use rev at all?
=== Is X a perfect use case for the rev attribute ===
''Isn't this [something] a perfect use case for the rev attribute?''


The short answer is unfortunately "no".  Use of "rev" SHOULD be avoided.
'''In short, no.'''


However, VoteLinks, is being grandfathered since it was such an early use.  No future microformats should be developed that use 'rev'.
The rev attribute is unusable (bad at usability) as [[#Should_rev_even_be_used|explained above]].


=== When a 'rel' value refers to a relationship to or from a page or document, is it referring to just the page, or the contents of the page, or both? ===
The rev attribute creates 10x at least more confusions than the rel attribute (and its values).


The consensus (and convention) is that such rel values are referring to the page itself including its immediate contents, but not for example to embedded contents of like images, objects, frames etc.
Thus the rev attribute has zero <em>practical</em> use-cases


== See Also ==
== See Also ==
 
{{rel-related-pages}}
* [[rel-directory]]
* [[rel-directory]]
* [[rel-examples]]
* [[rel-license]]
* [[rel-license]]
* [[rel-payment]]
* [[rel-payment]]
* [[rel-tag]], [[rel-tag-faq]]
* [[rel-tag]], [[rel-tag-faq]]
* [[rel-design-pattern]]
* [[vote-links]]
* [[vote-links]]
* [http://gmpg.org/xfn/ XFN], [http://gmpg.org/xfn/faq XFN FAQ]
* [http://gmpg.org/xfn/ XFN], [http://gmpg.org/xfn/faq XFN FAQ]

Latest revision as of 00:46, 26 June 2013

"rel" attribute frequently asked questions

This document serves to answer and discuss frequently asked questions about the HTML4 "rel" and "rev" attributes, and their linktype values. Specifically this document explores a number of issues common to and exposed by the various microformats which extend the HTML4 rel attribute.

FAQ

How is rel used

How is the 'rel' attribute used?

rel values indicate the relationship of the target resource to the resource on which they appear. In microformats, rel are used on links (e.g. <a rel="home" href="http://example.org">). Elsewhere, they are also used on link headers (e.g. <link rel="start" href="http://example.org/section/page1.htm">.

Multiple values may be used, in the same manner as multiple class values (e.g. <a rel="home me contents" href="http://example.org">).

What microformats use rel

What microformats use 'rel'?

What is the proper use of the rel attribute

What is the proper use of the 'rel' attribute?

First, you can use the linktype as specified in HTML 4. A well known example of this is rel="stylesheet". Second, you "can extend the rel attribute using a profile", but "HTML doesn't specify/recommend a profile format". XMDP can be used to formally define new rel values.

What does a rel value really mean?

What does a 'rel' value really mean?

The rel values in HTML follow a consistent pattern which at a minimum implies a deliberate design. rel describes the relationship of a hyperlink in terms of what the destination (href) is, to the source, or from the source's perspective. rel="stylesheet" is perhaps the easiest example to understand in this manner, because it is saying that this resource over there (indicated with the href) is a "stylesheet" for the current document. Similarly, rel="help" link states that the resource indicated by the href is "help" (e.g. a help file or FAQ) for the current document. All the rest of the values defined in HTML4 also follow this pattern of being a noun which labels the resource indicated by the href, from the perspective of the current document.

Then what does rev mean

Then what does 'rev' mean?

"rev" is the precise opposite (or "reverse") of the "rel" attribute. E.g. a rev="help" link indicates that the current document is "help" for the resource indicated by the href.

Is rel single or bi directional

Is rel single or bi-directional?

Though the HTML4 specification is not specific on this point, all the rel values in the HTML4 specification follow a very consistent pattern that indicate a specific directionality to the value of the rel attribute. The only exception to this is the value "alternate", which, is actually inherently symmetric, so rel="alternate" means pretty much the same thing as rev="alternate". I say pretty much because in theory (and in practice) one of a pair of alternates is likely to be more definitive, and thus one is more a primary resource, with the other being an alternative. In theory you could extend rel with a new value, e.g. "original" which could be used to point back the original version of a document. This could be used for example with translations, where translations of a document would point back to the original with rel="original".

Are rel attributes and linktypes in general just document to document

Are "rel" attributes, and linktypes in general, just document to document?

The vast majority of the rel values defined in HTML4 are from a document to a document. rel="stylesheet" is a bit of an exception, as it from an HTML document to a style sheet, which is more like a set of styling rules and instructions than a "document" in the classical sense.

Two more notable exceptions are rel="copyright" and rel="bookmark" which describe the relationship from the current document to (potentially) only part of a document.

The 'rev' attribute adds an interesting perspective on this question. Specifically, 12.3.1 of HTML4 shows an example of two links one using rel and the other using rev which mean the same thing.

Thus linktypes in general may be either from a whole document or part of a document to a whole document or a part of a document. For example, the rel-tag specification introduces the rel="tag" value, and notes that it indicates a relation from a document or major portion thereof to a document.

Finally, XFN probably stretches rel the farthest, as it uses rel to indicate a person to person relationship. This person to person scope was not introduced by XFN, but merely adopted from emergent publishing behavior on the Web. It was introduced by bloggers who have taken to linking to other bloggers by name and thus using people's blog URLs as proxies for people themselves.

Do rel values refer to a relationship to the page or the contents of the page or both

When a 'rel' value refers to a relationship to or from a page or document, is it referring to just the page, or the contents of the page, or both?

The consensus (and convention; citation needed) is that such rel values are referring to the page itself including its immediate contents, but not for example to embedded contents of like images, objects, frames etc.

Was VoteLinks a proper use of rel

Is/Was VoteLinks a proper use of rel?

No. The problem with using rel for VoteLinks is made apparent with the following example:

<a href="http://www2005.org" rel="vote-for">WWW2005 is a great conference</a>

Following the reasoning in the earlier answer to the question of what a rel value means, this link would mean:

The resource indicated by http://www2005.org is a "vote-for" the current document.

That clearly doesn't make any sense, and was certainly not the intent of VoteLinks. Ironically, the reverse makes a lot more sense:

The current document is a "vote-for" the resource indicated by http://www2005.org.

And generalizing to the same cultural usage links as XFN:

The current document, as a proxy for the person who wrote it (e.g. the blogger whose blog it is), is a vote-for the resource indicated by http://www2005.org.

Fortunately the "rev" attribute captures this "reverse" relationship semantic, and thus the above example should be written like this:

<a href="http://www2005.org" rev="vote-for">WWW2005 is a great conference</a>

And thus VoteLinks has been changed to use "rev" instead of "rel", in order to keep the well known and easily understandable "vote-for", "vote-abstain", and "vote-against" values.

Should rev even be used

Should 'rev' even be used?

In (X)HTML, the same values may be used as rev ("reverse relationship") values, to indicate the relationship of the resource on which they appear to the target resource.

However, given that the 'rev' attribute has been more often misused by authors than properly used (Google Code: Web Authoring Statistics: Link Relationships) is it even a good idea to use rev at all?

The short answer is unfortunately "NO". Use of "rev" SHOULD be avoided.

However, VoteLinks' use of rev has been grandfathered since it was such an early use.

No future microformats should be developed that use 'rev', and any use of 'rev' (apart from the "grand-fathered" case of VoteLinks) is deprecated in microformats.

More data on use of rel/rev:

which demonstrates poor understanding of the rev attribute, e.g. <link rev="1.02" ...>

Is X a perfect use case for the rev attribute

Isn't this [something] a perfect use case for the rev attribute?

In short, no.

The rev attribute is unusable (bad at usability) as explained above.

The rev attribute creates 10x at least more confusions than the rel attribute (and its values).

Thus the rev attribute has zero practical use-cases

See Also