rel-profile: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(rel-profile now incorporated into XMDP, added explicit editorship as we now need this as part of XMDP infrastructure for microformats)
(document use of rel-profile inside Atom as suggested by tobyink in irc)
Line 23: Line 23:


These fragments of self-defining portable [[semantic HTML]] would enable more modular HTML for transclusion and other purposes.
These fragments of self-defining portable [[semantic HTML]] would enable more modular HTML for transclusion and other purposes.
== additional languages ==
=== Atom ===
In Atom the <code>link</code> element can be used inside the <code>feed</code> element to link to a profile for microformats used in the feed. e.g.:
<source lang=xml>
<feed>
<link rel="profile" href="http://microformats.org/profile/hcard" />
...
</feed>
</source>
To scope a profile to a specific Atom entry use <code>&lt;link rel="profile" /&gt;</code> inside that <code>&lt;entry&gt;</code> element, e.g.:
<source lang=xml>
<entry>
<link rel="profile" href="http://microformats.org/profile/hcard" />
...
</entry>
</source>


== implementations ==
== implementations ==
[http://buzzword.org.uk/cognition/ Cognition] has supported <code>rel=profile</code> since March 2008. Cognition has two microformat parsing modes:
[http://buzzword.org.uk/cognition/ Cognition] has supported <code>rel=profile</code> since March 2008. Cognition has two microformat parsing modes:
* '''Strict mode:''' pages using microformats are required to include a [[profile-uris|well-known profile URI]] for each microformat they use, essentially as a "flag" to enable parsing of that microformat.
* '''Strict mode:''' pages using microformats are required to include a [[profile-uris|well-known profile URI]] for each microformat they use, essentially as a "flag" to enable parsing of that microformat.

Revision as of 13:53, 28 April 2010

<entry-title>rel profile</entry-title>

rel="profile" was originally introduced in a draft of XHTML 2.0 (citation needed) as a result of a proposal by Tantek Çelik during an early HTML Working Group meeting (sometime in the early 2000s, working group minutes citation needed) to solve the problem of profile URLs being limited to a single one-off invisible attribute of the <head> element.

This same meaning, that of a link to a metadata profile for the current document, is has been incorporated into XMDP since HTML5 drops the "profile" attribute. See also xmdp-brainstorming, in particular, when microformats may be in use.

Editor
Tantek Çelik

processing model

In brief: the head[profile] takes precedence per current XMDP description (for backward compat), and then the same first defined rules apply, that is in cases where more than one profile from an <a rel="profile"> defines the same term, first definition wins.

advantages

Using rel="profile" has numerous advantages aside from the obvious and originally intended advantage of enabling a future version of HTML to depend less on the "profile" attribute of the <head> element, and simply use the existing <link> element instead.

Most of these advantages come from the ability to use <a> hyperlinks instead of (or in addition to) <head> and <link> elements and are based on the microformats principles.

visibility

The idea is that a document that uses a particular microformat, e.g. hCard, can explicitly link to the profile for that microformat and indicate the profile relationship, via existing visible content hyperlink text such as "This document uses hCard", or an hCard badge image, both of which have been seen in real world web content.

modularity

Hyperlinks with rel="profile" provide the potential for contextual definitions of terms. That is, we could define vocabularies included by a hyperlink with rel="profile" to apply only within the context of the hyperlink (either the parent element and all its descendants, or perhaps just the latter siblings of the hyperlinks and all their descendants).

These fragments of self-defining portable semantic HTML would enable more modular HTML for transclusion and other purposes.

additional languages

Atom

In Atom the link element can be used inside the feed element to link to a profile for microformats used in the feed. e.g.:

<feed>
 <link rel="profile" href="http://microformats.org/profile/hcard" />
 ...
</feed>

To scope a profile to a specific Atom entry use <link rel="profile" /> inside that <entry> element, e.g.:

<entry>
 <link rel="profile" href="http://microformats.org/profile/hcard" />
 ...
</entry>

implementations

Cognition has supported rel=profile since March 2008. Cognition has two microformat parsing modes:

  • Strict mode: pages using microformats are required to include a well-known profile URI for each microformat they use, essentially as a "flag" to enable parsing of that microformat.
  • Loose mode (default): most microformats will be parsed without a profile being explicitly included (though authors are still recommended to include profile URIs for any microformats they use). Some obscure microformats (e.g. XFN 1.0, XEN) still require a profile URI to work.

see also