REL and REV Attributes for Hypertext Relationships
by
Ian S. Graham

Copyright © 1997 Ian S. Graham

Introduction	
Anchor and Link Elements	
Meaning of a Hypertext Link—REL and REV	
Browser Interpretation of LINK Elements	
REL and REV in A Elements	
Defined Relationships For REL and REV	
Navigation Values	
Sequence Values	
Hierarchy Values	
Relational Values	
Meta-Informational Values	
Legacy Values	
CLASS Attributes and Other Extensions	
References	

Introduction
A standard hypertext anchor can link two documents or resources together, but does not provide any explanation of the reason behind the link. This is sometimes a problem for a person reading HTML documents, as they cannot tell the important navigation links from the unimportant ones. This is even more of a problem for a person attempting to manage a large collection of interlinked documents, as this manager has no way of structuring or prioritizing the links, so as to get a feel for the overall structure and organization of the collection.
Fortunately HTML anchor elements can take the attributes REL and REV, which are used to define the relationships between the linked resources. However, this is only useful if there are universally understood values for REL and REV. Otherwise, different authors will use different values to indicate the same thing, such that documents labeled with REL and REV cannot be easily shared or intelligently combined. This appendix provides a list of some commonly accepted REL and REV values, and their meanings. The references at the end of the appendix provide links to working documents that are involved in developing this list, and upon which this appendix was based.
Anchor and Link Elements
In HTML, links between a document and other Internet-accessible resource are usually indicated by A, or anchor elements, which were discussed in detail in Chapters 2 and 4. (For this discussion, we are ignoring hypertext links implied by SRC attributes to IMG [or other] elements, and embedded objects implied by EMBED, APP, APPLET, or OBJECT elements, which also imply a form of hypertext relationship.) Through the HREF attribute, the A element can indicate a link from the anchored location in the document to another Internet-accessible resource. At the same time, the NAME attribute allows an anchor element to be labeled as the possible destination of a hypertext link. (In HTML tables, the ID attribute can be used to designate a table cell (TD or TH element) as a target of a hypertext link — see Chapters 4 and 5 for more details).
LINK elements in the HEAD of a document can be used to describe hypertextual relationships between two documents, or between a document and another Internet-accessible resource. For example, the element
<LINK REL="author" HREF="mailto:igraham@flober.rodent.edu"> 

indicates a relationship between the current document and the indicated URL, in this case that the object at the end of the link bears, in some way, on the author of the document containing the LINK element. The meaning of this relationship is defined by the value assigned to the attribute REL or, alternatively, REV. The purpose of REL and REV is to assign meaning to a hypertext relationship, so that REL and REV are allowed attributes for both LINK and A elements. However, since LINK indicates a relationship between resources, it must always have a REL or REV attribute to describe that relationship. The possible types of relationships are almost limitless. Commonly accepted values are described in this appendix. 
Meaning of a Hypertext Link—REL and REV
As just noted, the LINK element is only meaningful if the relationship between the two resources is specified as part of the element. For example, the element
<LINK HREF="http://bla.bla.edu/junk.html">

is meaningless, since it does not explain the relationship between the two resources. As discussed in Chapter 4, the meaning of the hypertext relationship between a document and the resource to which it is linked is indicated by the attributes REL and  REV. REL specifies the relationship of the destination of the hypertext link to the start of the link. Thus, REL="previous" indicates that the linked resource is the previous document, relative to the current one, in a logical, author-specified sequence. REV, on the other hand, indicates the relationship of the current document to the destination of the link. Thus, REV="previous" indicates that the current document is the previous document, relative to the linked document, in a logical author-specified sequence. 
REL and REV are often, but not always, the converse of one another. The importance of having both terms will be evident from the examples given later.
The values assigned to REL and REV are sequences of name tokens. As mentioned in Chapter 4, name tokens are case-insensitive strings that can contain any ASCII letter (a-z, A-Z) or number (0-9), plus the dash (-) or period (.) characters, but nothing else. They must also begin with a letter. Multiple values can be assigned to a single REL or REV attribute, simply by separating the values by whitespace (any combination of space and/or tab characters), and enclosing the collection of values in double quotes. Thus 
REL="contents previous"
indicates that the linked document is both a table of contents related to the current document, and the previous document in an author-defined sequence of documents. 
Browser Interpretation of LINK Elements
Unlike A, LINK is not specifically designed to be an active anchor, although it may be used by a browser to customize the user interface, so as to indicate important, related documents. At present, most Web browsers ignore LINK elements. However, browsers currently under development will reconfigure the user interface to include buttons linked to resources indicated by certain LINKs. For example, LINK elements with REL/REV values of "previous" and "next" may produce customized button bars on graphical browsers, allowing the user to click on the buttons and link directly to the next and previous documents of the author-specified sequence. Similar features may be result from LINKs to indexes, table of contents pages, and so on.
This functionality is only possible if there are well-understood meanings for the REL and REV values, so that the browser can unambiguously know the intent of the document author. The REL/REV values specified in this appendix provide this set of standard values and meanings.
REL and REV in A Elements
It is clear that REL and REV are essential for LINK elements—without such values, a LINK has no useful meaning. At the same time, REL and REV can be extremely useful with A anchors, since they provide useful information about the nature of the link. Browsers may use this information to render a link differently, or to behave differently. For example, clicking on the following anchor
<A HREF="/cgi-bin/lin.pl" REL="glossary">reference material</A>

might cause the browser to spawn a second window containing the glossary document, as opposed to replacing the currently displayed material. 
Perhaps more importantly, REL and REV attributes provide information needed by site managers or site management software when trying to understand the overall organization of a large document collection. Information about the relationships defined by the links or anchors, such as "next", "previous", "index", or "glossary", make it much easier to categorize and organize the collection, and to provide an overview of the collection's structure. In this context, link information can be useful to a Web browser, which can use the information to provide navigational aids for a document collection, since the relationship values allow for the differentiation of important navigational nodes from navigationally less-important references. 
Defined Relationships For REL and REV
The currently accepted values for REL and REV and their meanings, as given here, are taken from a discussion paper, prepared by Murray Maloney and Liam Quin. This document can be found on-line at:
ftp://ds.internic.net/internet-drafts/draft-ietf-html-relrev-00.txt
http://www.sq.com/papers/Relationships.html

The HTML version is an early draft of the document. The relationships are divided into five broad categories. Navigational values define links to or from documents, or other tools, that are useful in navigating through a collection of documents. Sequential values define a preferred, or logical sequence between documents. Such a sequence is usually defined by the author. Hierarchical values define hierarchical relationships between documents. Related document values define related documents, such as bibliography or citation lists. Finally, meta values define links to meta-information, such as author and copyright.
Navigation Values
Navigational values define relationships to (or from) documents designed to assist a user in navigating through a document collection. Possible values are "content" (Table of Contents), "index" (an index), and "navigate" (a navigational aid). 
Contents (or toc) — Identifies a relationship with a table of contents.
REL="contents" – The target document is a table of contents relevant to the current document.
REV="contents" – The current document is a table of contents relevant to the linked document.
Examples:
<A REL="contents" HREF="htmlindex.html">Table of Contents</A>
<LINK REL="contents" HREF="htmlindex.html">
<LINK REV="contents" REL="glossary" HREF="refs/glossary.html">

The first two links indicate that the target document is the table of contents relevant to the current document. The third example states that the current document is a table of contents relevant to the linked document, and also states that the linked document is a glossary relevant to the current document. This value is understood by NCSA Mosaic for Macintosh and by the UDI-WWW browser.
Index  — Identifies a relationship with an index.
REL="index" – The target document is an index related to the current document.
REV="index" – The current document is an index related to the linked document.
Example:
<LINK REL="index" HREF="/cgi-bin/indx_srch.pl">

This indicates that the linked resource is an index relevant to the current document. In this example, the resource is a gateway program, which could be a gateway to a searchable index of the document collection containing the current document.
Navigate — Identifies a relationship with a navigational aid.  A navigational aid may consist of a partial table of contents, a clickable document map, or some other resource.
REL="navigate" – The link is to a navigational aid relevant to the current document.
REV="navigate" – The current document is a navigational aid related to the linked document.
Sequence Values
Often, a collection of hypertext documents is presented as a sequence of documents, rather like a printed book. In this case, there are obvious first and last documents, as well as obvious next and previous pages. Relationships with these documents are indicated by the values "begin", "end", "next" and "previous".
Begin  (or first) — Identifies a relationship with the author-defined start of a sequence of documents, of which the current document is a part.
REL="begin" –The link is to the start of the author-defined sequence of documents, of which the current document is part.
REV="begin" – The link is from the start of the author-defined sequence; that is, the current document is the start of the sequence.
Examples:
[ <A REL="begin"    HREF="intro.html">Start</A> ]
[ <A REL="previous" HREF="doc2_1.html">Prev</A> ]
[ <A REL="next"     HREF="doc2_3.html">Next</A> ]
[ <A REL="end"      HREF="biblio.html">End</A> ]
 - - -
[ <A REL="contents" HREF="htmlindex.html"><EM>ToC</EM></A> ]
{ <A REL="index"    HREF="/cgi-bin/indx.pl"><EM>Index</EM></A> ]

This example uses all the attribute values defined in this section to construct a navigational button bar containing the words Start, Prev, Next, and End. Each of these words is in turn linked to the starting, previous, next, and end documents of the document collection. There are also links to the table of contents (ToC) and an Index.
End (or last) — Identifies a relationship with the author-defined end of a sequence of document, of which the current document is a part.
REL="end" – The link is to the end of the author-defined sequence of documents, of which the current document is part.
REV="end" – The link is from the end of the author-defined sequence; that is, the current document is the end of the sequence.
Next — Identifies a relationship with the next or subsequent document in an author-defined sequence of documents. An obvious analogy is the next page of a printed book.
REL="next" – The link is to the next document in a linear document sequence
REV="next" – The link is from the next document in the document sequence; the current document is the next document relative to the linked document.
Previous — Identifies a relationship with the previous document in an author-defined sequence of documents. An obvious analogy is the previous page of a printed book.
REL="previous" – The link is to the previous document in a linear document sequence.
REV="previous" – The link is from the previous document in the document sequence; the current document is the previous document relative to the linked document.
Hierarchy Values
Often a collection of documents can be described hierarchically. Possible relationships are then "parent" (the top of the local branch in the hierarchy), "child" (a subordinate document), "sibling" (a document of equivalent level in the hierarchy) and "top" (the top or root document of the hierarchy).
Child — Identifies a relationship with a subordinate document, or subdocument. In comparison with computer file system, this is equivalent to saying that a file is subordinate to the directory in which it is contained. 
REL="child" – The link is to a subdocument, or child document, of the current document.
REV="child" – The current document is a child, or subdocument, of the linked document.
Example:
<LINK REL="child next" HREF="dlooble.html">

This indicates that the current document is the child of the document dlooble.html, and is also the next document following dlooble.html in the author-defined logical document sequence.
Parent — Identifies a relationship with a superior element in the hierarchy. This is not the inverse of a child, since a parent can have more than one child.
REL="parent" – The link is to the parent document of the current document.
REV="parent" – The current document is the parent of the linked document.
Sibling — Identifies a relationship with a sibling, or equivalent document, in the hierarchy. A given document can have any number of siblings.
REL="sibling" – The link is to a sibling of the current document; that is, the current document and linked document have a common parent.
REV="sibling" – The link is from a sibling of the current document; that is, the current document and linked document both a common parent.
Top (or origin) — Identifies a relationship with the top of the logical or hierarchical tree of which the current document is a part.
REL="top" – The link is to the logical top node of the document hierarchy containing the current document.
REV="top" – The link is from the top of the logical document hierarchy containing the linked document.
Example:
<A REL="parent top" HREF="intro.html">Introduction</A>

This link is to a document that is both the parent of the current document, as well as the top of the hierarchical tree containing the current document.
Relational Values
Relational values indicate documents that have well-understood contextual relationships to a collection of documents. Examples are glossaries, bibliographies, lists of definitions, and so on. Possible values are "biblioentry" (a bibliographic entry), "bibliography" (a bibliography), "citation" (for a bibliographic citation), "definition" (for the definition of a word or term), and "glossary" (for a glossary).
Biblioentry — Identifies a relationship with bibliographic entry; typically used within an A element to indicate a link to a bibliographic entry related to a citation.
REL="biblioentry" – The link is to a bibliographic entry related to the current document. 
REV="biblioentry" – The link is from a biblioentry related to the document to which the link is directed. This usage would be extremely uncommon.
Example:
<A REL="biblioentry" HREF="bib.html#ISG"><CITE>The HTML Sourcebook<CITE></A>

This link is to a bibliographic entry relevant to the citation The HTML Sourcebook.
Bibliography — Identifies a relationship with a bibliography. A bibliography may simply be a document containing bibliographic entries, or it might be a queryable bibliographic database.
REL="bibliography" – The link is to a bibliography related to the current document. 
REV="bibliography" – The link is from a bibliography to a document for which the bibliography is relevant.
Example:
<LINK REL="bibliography" REV="top" HREF="/refs/biblio.html">

The linked document is a bibliography relevant to the current document, and the current document is also the top of a hierarchical document collection containing the bibliography.
Citation — Identifies a relationship with a bibliographic citation.
REL="citation" – The link is to a bibliographic citation, in which case the anchor may be a bibliographic entry.
REV="citation" – The anchored text in the current document is a citation related to the linked document or resource. Since the anchored text is a citation, it should also be placed inside CITE.
Examples (from Murray Maloney's discussion paper):
.. as described by Tim Berners-Lee [<A REL="citation" HREF="#TBL">1</A>]
... is described in Tim Berners-Lee's
<CITE>
   <A NAME="TBL" REV="citation" HREF="./biblio/TBL.html">The 
   Hypertext Markup Language</A>
</CITE>

The first example shows a link to a citation, while the second shows a link from a citation to additional information relevant to the citation.
Definition — Identifies a relationship with a definition of a word or term. A definition would most typically be specified as part of an A, as it is specific to a word or term, and not generic to a document. 
REL="definition" – The link is to the definition of the text contained within the anchor .
REV="definition" – The current document, or the text within the anchor, contains the definition associated with the term indicated by the hypertext link. This form would rarely be used.
Example:
<A REL="definition" HREF="/cgi-bin/defns.pl#cgi">CGI</A>
<A REL="definition" HREF="glossary.html#cgi">CGI</A>

These indicate links to resources containing definitions of the term, in the first case via a gateway program, in the second via a glossary document containing NAME-anchored term definitions.
Glossary — Identifies a relationship with a glossary document, or with a query interface to a glossary. 
REL="glossary" – The link is to a glossary or glossary query interface that contains glossary information relevant to the current document.
REV="glossary" – The current document is a glossary or glossary query interface relevant to the linked document.
Examples:
<LINK REL="glossary" HREF="glossary.html">

The linked document glossary.html is a glossary related to the current document.
Meta-Informational Values
Meta-informational values describe relationships with documents that contain information about the document collection, but that are not explicitly part of the collection. Accepted values are "author" (the document author), "copyright" (copyright information), "disclaimer" (a legal disclaimer), "editor" (the editor(s) of the document), "meta" (a metadocument containing meta-information relevant to the current document), "publisher" (the document publisher), and "trademark" (trademark notice or related information).
Author — Identifies a relationship with the author of a document.
REL="author" – The link is to the author (for example, via a mailto URL), or to information about the author.
REV="author" – The current document contains information about the author of the linked document.
Example:
<LINK REV="made" REL="author" HREF="mailto:isq@fe.fi.fo.fum.org>

The destination of the link is the author of the current document (the link lets you send him or her email); the target of the link "made" the current document.
Copyright — Identifies a relationship with copyright information relevant to a document.
REL="copyright" – The link is to a document containing copyright information relevant to the current document.
REV="copyright" – The current document contains copyright information appropriate to the linked document.
Example:
<LINK REL="copyright" HREF="copy_info.html">

The destination of the link contains copyright information relevant to the current document.
Disclaimer — Identifies a relationship with a legal disclaimer associated with a document.
REL="disclaimer" – The link is to a document containing a legal disclaimer relevant to the current document.
REV="disclaimer" – The current document contains a legal disclaimer relevant to the linked document. 
Editor — Identifies a relationship with information about the editor (or editors) of the document.
REL="author" – The link is to the editor(s) (for example, a mailto URL), or to information about the editor(s).
REV="author" – The current document contains information about the editor(s) of the linked document.
Meta — Identifies a relationship with node containing diverse meta- (LINK, META, or other) information relevant to a document.
REL="meta" – The link is to a document containing meta-information about the current document.
REV="meta" – The current document contains meta-information relevant to the linked document.
Publisher — Identifies a relationship with information about the publisher (or publishers) of the document.
REL="publisher" – The link is to the publisher(s) (for example, via a mailto URL), or to information about the publisher(s).
REV="publisher" – The current document contains information about the publisher(s) of the linked document.
Trademark — Identifies a relationship with trademark information relevant to a document.
REL="trademark" – The link is to trademark information relevant to the current document.
REV="trademark" – The current document contains trademark information relevant to the linked document.
Legacy Values
Some simple REL/REV values are already in use. These are:
Made — Defines a relationship with the creator of a document.
REV="made" – Identifies that the current document was created by the user referenced by the indicated URL. 
Examples
<LINK REV="made" HREF="mailto:igraham@foo.bar.edu">
<LINK REV="made" HREF="http://home.edu/igraham/home.html">

These links indicates that the current document was created by the person referenced at the indicated URL.
CLASS Attributes and Other Extensions
The list of REL and REV values will grow as uses are found for new relationship values. Murray Maloney and Liam Quin's discussion paper reviews some other, proposed, values. In HTML 3, both LINK and A can take a CLASS attribute, which leads to the possibility of selecting certain relationships according to their class. For example, multiple author-defined navigation sequences could be defined, according to the CLASS, via:
<LINK REL="next" CLASS="beginner" HREF="...">
<LINK REL="next" CLASS="expert" HREF="...">

which could permit selecting alternate paths through the collection, depending on the experience of the user. Alternatively, 
<LINK REL="next" CLASS="path-A" HREF="...">
<LINK REL="next" CLASS="path-B" HREF="...">

could allow exploration of the same set of documents using alternate exploratory paths. This is not currently possible, as it requires an implementation of CLASS, along with well-defined values and meanings for a set of CLASS values.
References
A general discussion of hypertext links and of REL and REV values is found in the HTML references listed in Chapters 4 and 5. Murray Maloney and Liam Quin's discussion paper presents a more detailed treatment of these issues, as well as a complete list of generally accepted, and proposed, REL and REV values. This document can be found at:
http://www.sq.com/papers/Relationships.html
ftp://ds.internic.net/internet-drafts/draft-ietf-html-relrev-00.txt