Link relation

{{Short description|Attribute of a hyperlink}}

{{Technical|date=August 2024}}

{{HTML}}

A link relation is a descriptive attribute attached to a hyperlink in order to define the type of the link, or the relationship between the source and destination resources. The attribute can be used by automated systems, or can be presented to a user in a different way.

In HTML these are designated with the {{mono|rel}} attribute on {{mono|link}}, {{mono|a}}, or {{mono|area}} elements. Example uses include the standard way of referencing CSS, {{mono|{{tag|link|empty|attribs=rel="stylesheet" href="example.css"}}}}, which indicates that the external resource linked to with the {{mono|href}} attribute is a stylesheet, so a web browser will generally fetch this file to render the page. Another example is {{mono|1=rel="shortcut icon"}} for the popular favicon icon.{{Cite web|url=http://www.w3.org/2005/10/profile|publisher=World Wide Web Consortium|accessdate=23 February 2011|title=Web site meta data profile: favicon, …|date=October 2005|first=Karl|last=Dubost}}{{Cite web|url=http://www.w3.org/2005/10/howto-favicon|title=How to Add a Favicon to your Site|last=Dubost|first=Karl|date=24 October 2005|publisher=World Wide Web Consortium|accessdate=25 February 2011}}

Link relations are used in some microformats (e.g. {{mono|1=rel="tag"}} for tagging), in XHTML Friends Network (XFN), and in the Atom standard, in XLink, as well as in HTML. Standardized link relations are one of the foundations of HATEOAS as they allow the user agent to understand the meaning of the available state transitions in a Representational State Transfer system.

The Internet Engineering Task Force (IETF) has a registry of standardized link relations,[https://www.iana.org/assignments/link-relations/link-relations.xhtml IANA link relations registry] and a procedure for extending it defined in RFC 5988. HTML5 also defines valid link relations.[http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#linkTypes HTML Living Standard; 4.12.4 Link types] Web Hypertext Application Technology Working Group

In HTML4, the rev attribute of a link is also defined, which defines the relationship between the resources. The attribute is removed in HTML5.

Semantic Web implementation

The RDF typed links are fundamental in LOD datasets for identifying the relationship (predicate) type of RDF triples, contributing to the automatic processability of machine-readable statements of the Giant Global Graph on the Semantic Web. The typed links in RDF are expressed as the value of the rdf:type property, defining the relationship type using well-established controlled vocabulary terms or definitions from LOD datasets such as

References

{{reflist}}