hcard: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(raised visibility of property list, noted required properties explicitly (instead implicitly via vCard), moved (c),patents,acks to end like hResume)
m (editorial: https examples, more https links)
(155 intermediate revisions by 42 users not shown)
Line 1: Line 1:
<(削除) h1 (削除ここまで)>hCard</(削除) h1 (削除ここまで)>
(追記) {{DISPLAYTITLE:hCard 1.0}} (追記ここまで)
(追記) {{latest|h-card}} (追記ここまで)
(追記) <span class="vcard"><span class="fn">[[User:Tantek|Tantek Çelik]]</span> (<span class="role">Editor</span>, <span class="role">Author</span>)</span>, <span class="vcard"><span class="fn">[[User:Brian|Brian Suda]]</span> (<span class="role">Author</span>)</span> (追記ここまで)
(追記) ---- (追記ここまで)
<(追記) dfn style="font-style:normal;font-weight:bold" (追記ここまで)>hCard</(追記) dfn (追記ここまで)> (追記) is a simple, open format for publishing people, companies, organizations on the web, using a 1:1 representation of vCard ([[rfc-2426|RFC2426]]) properties and values in HTML. hCard is one of several open [[microformats|microformat]] standards suitable for embedding data in HTML/HTML5, and Atom/RSS/XHTML or other XML. (追記ここまで)


(削除) hCard is a simple, open, distributed format for representing people, companies, organizations, and places, using a 1 (削除ここまで):(削除) 1 representation of vCard ( (削除ここまで)[(削除) http: (削除ここまで)//(削除) www.ietf.org (削除ここまで)/(削除) rfc (削除ここまで)/(削除) rfc2426 (削除ここまで).(削除) txt RFC2426 (削除ここまで)]) (削除) properties (削除ここまで)and (削除) values in (削除ここまで)[[(削除) semantic-xhtml (削除ここまで)|(削除) semantic XHTML (削除ここまで)]]. (削除) hCard is one of several open (削除ここまで)[[(削除) microformats (削除ここまで)|(削除) microformat (削除ここまで)]] (削除) standards suitable for embedding in (X)HTML, Atom, RSS, and arbitrary XML (削除ここまで).
(追記) Translations (追記ここまで): [(追記) [hcard-fr|<span lang="fr">Français< (追記ここまで)/(追記) span>]] • [[hcard-ja|<span lang="ja">日本語< (追記ここまで)/(追記) span>]] • [[hcard-ru|<span lang="ru">Русский< (追記ここまで)/(追記) span>]] • [[hcard-th|<span lang="th">ภาษาไทย< (追記ここまで)/(追記) span>]] • [[hcard-zh|<span lang="zh">漢語</span>]] • <span style="font-size: (追記ここまで).(追記) 8em">([[how-to-start-new-translation|Add your language] (追記ここまで)])(追記) </span><br/> (追記ここまで)
(追記) [[hcard#Copyright|Copyright]] (追記ここまで)and [[(追記) hcard#Patents (追記ここまで)|(追記) patents (追記ここまで)]] (追記) statements apply (追記ここまで). (追記) See (追記ここまで)[[(追記) hcard#Inspiration_and_Acknowledgments (追記ここまで)|(追記) acknowledgments (追記ここまで)]].


(削除) Want (削除ここまで)to (削除) get (削除ここまで)started (削除) with writing an [[hcard|hCard]]? Use the (削除ここまで)[http://microformats.org/code/hcard/creator hCard (削除) creator (削除ここまで)] (削除) to write up some contact information and publish it, or follow the (削除ここまで)[[hcard-authoring|hCard authoring (削除) tips (削除ここまで)]] (削除) to add hCard markup to your current contact page. (削除ここまで)
(追記) == Example == (追記ここまで)
(追記) hCards are most often used (追記ここまで)to (追記) represent people: (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <div class="vcard"> (追記ここまで)
(追記) <a class="url fn" href="https://tantek.com/">Tantek Çelik</a> (追記ここまで)
(追記) </div> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) and organizations: (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <div class="vcard"> (追記ここまで)
(追記) <a class="url fn org" href="https://microformats.org/">microformats.org</a> (追記ここまで)
(追記) </div> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) <div style="float:right;background:rgb(248, 247, 236); border:2px solid rgb(225, 229, 186); margin-left:2em" class="box"> (追記ここまで)
(追記) === Get (追記ここまで)started (追記) === (追記ここまで)
(追記) https://microformats.org/wiki/skins/Microformats/images/bullet.gif Create a (追記ここまで)[http://microformats.org/code/hcard/creator (追記) new (追記ここまで)hCard](追記) <br/> (追記ここまで)
(追記) https://microformats.org/wiki/skins/Microformats/images/bullet.gif Learn (追記ここまで)[[hcard-authoring|hCard authoring]]
(追記) </div> (追記ここまで)


(追記) (追記ここまで)
(追記) The class '''<code>vcard</code>''' is a ''[[hcard#Root_Class_Name|root class name]]'' that indicates the presence of an hCard. (追記ここまで)
(追記) (追記ここまで)
(追記) The classes '''<code>url</code>''', '''<code>fn</code>''', and '''<code>org</code>''' define ''properties'' of the hCard. (追記ここまで)
(追記) (追記ここまで)
(追記) == Properties == (追記ここまで)
(追記) <div style="white-space:nowrap;float:left">Common hCard properties (inside class <code>'''vcard'''</code>) (追記ここまで)
(追記) * <code>'''fn'''</code> - name, formatted/full. required (追記ここまで)
(追記) * <code>'''n'''</code> - structured name, container for: (追記ここまで)
(追記) ** <code>'''honorific-prefix'''</code> - e.g. Ms., Mr., Dr. (追記ここまで)
(追記) ** <code>'''given-name'''</code> - given (often first) name (追記ここまで)
(追記) ** <code>'''additional-name'''</code> - other/middle name (追記ここまで)
(追記) ** <code>'''family-name'''</code> - family (often last) name (追記ここまで)
(追記) ** <code>'''honorific-suffix'''</code> - e.g. Ph.D., Esq. (追記ここまで)
(追記) * <code>'''nickname'''</code> - nickname/alias, e.g. [[IRC]] <abbr title="nickname">nick</abbr> (追記ここまで)
(追記) * <code>'''org'''</code> - company/organization (追記ここまで)
(追記) * <code>'''photo'''</code> - photo, icon, avatar (追記ここまで)
(追記) * <code>'''url'''</code> - home page for this contact (追記ここまで)
(追記) * <code>'''email'''</code> - email address (追記ここまで)
(追記) * <code>'''tel'''</code> - [[phone number|telephone number]] (追記ここまで)
(追記) * <code>'''[[adr]]'''</code> - structured address, container for: (追記ここまで)
(追記) ** <code>'''street-address'''</code> - street <abbr title="number">#</abbr>+name, <abbr title="apartment">apt</abbr>/<abbr title="suite">ste</abbr> (追記ここまで)
(追記) ** <code>'''locality'''</code> - city or village (追記ここまで)
(追記) ** <code>'''region'''</code> - state or province (追記ここまで)
(追記) ** <code>'''postal-code'''</code> - postal code, e.g. <abbr title="United States">U.S.</abbr> ZIP (追記ここまで)
(追記) ** <code>'''country-name'''</code> - country name (追記ここまで)
(追記) * <code>'''bday'''</code> - birthday. [[date-pattern|ISO date]]. (追記ここまで)
(追記) * <code>'''category'''</code> - for tagging contacts (追記ここまで)
(追記) * <code>'''note'''</code> - notes about the contact (追記ここまで)
(追記) </div> (追記ここまで)
(追記) <div style="margin-top:-.4em; float:left;"><span style="display:none">Example hCard of common properties:</span> (追記ここまで)
(追記) <ul style="list-style:none"><li><code>&lt;div class="'''vcard'''"&gt;</code> (追記ここまで)
(追記) <ul style="list-style:none; margin-top:-.02em"> (追記ここまで)
(追記) <li><code>&lt;span class="'''fn'''"&gt;Sally Ride&lt;/span&gt;</code></li> (追記ここまで)
(追記) <li><code>(&lt;span class="'''n'''"&gt;</code><ul style="list-style:none"> (追記ここまで)
(追記) <li><code>&lt;span class="'''honorific-prefix'''"&gt;Dr.&lt;/span&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''given-name'''"&gt;Sally&lt;/span&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;abbr class="'''additional-name'''"&gt;K.&lt;/abbr&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''family-name'''"&gt;Ride&lt;/span&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''honorific-suffix'''"&gt;Ph.D.&lt;/span&gt;&lt;/span&gt;),</code></li></ul></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''nickname'''"&gt;sallykride&lt;/span&gt; (IRC)</code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''org'''"&gt;Sally Ride Science&lt;/div&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;img class="'''photo'''" src="<nowiki>http://example.com/sk.jpg</nowiki>"/&gt; </code></li> (追記ここまで)
(追記) <li><code>&lt;a class="'''url'''" href="<nowiki>http://sally.example.com</nowiki>"&gt;w&lt;/a&gt;,</code></li> (追記ここまで)
(追記) <li><code>&lt;a class="'''email'''" href="<nowiki>mailto:sally@example.com</nowiki>"&gt;e&lt;/a&gt; </code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''tel'''"&gt;+1.818.555.1212&lt;/div&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''adr'''"&gt;</code><ul style="list-style:none"> (追記ここまで)
(追記) <li><code>&lt;div class="'''street-address'''"&gt;123 Main st.&lt;/div&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''locality'''"&gt;Los Angeles&lt;/span&gt;, </code></li> (追記ここまで)
(追記) <li><code>&lt;abbr class="'''region'''" title="California"&gt;CA&lt;/abbr&gt;, </code></li> (追記ここまで)
(追記) <li><code>&lt;span class="'''postal-code'''"&gt;91316&lt;/span&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''country-name'''"&gt;U.S.A&lt;/div&gt;&lt;/div&gt;</code></li></ul></li> (追記ここまで)
(追記) <li><code>&lt;time class="'''bday'''"&gt;1951年05月26日&lt;/time&gt; birthday</code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''category'''"&gt;physicist&lt;/div&gt;</code></li> (追記ここまで)
(追記) <li><code>&lt;div class="'''note'''"&gt;1st American woman in space.&lt;/div&gt;</code></li></ul></li> (追記ここまで)
(追記) <li><code>&lt;/div&gt;</code></li></ul> (追記ここまで)
(追記) </div> (追記ここまで)
(追記) <div style="clear:both; padding:1em 0 0.5em 0">See the [[hcard#Property_List|full list of properties]] for the complete list. (追記ここまで)
(追記) </div> (追記ここまで)
__TOC__
__TOC__


== (削除) Specification (削除ここまで)==
== (追記) Status (追記ここまで)==
(追記) hCard 1.0 is a microformats.org specification. Public discussion on hCard takes place on [[hcard-feedback]], the #microformats [[irc]] channel on irc.freenode.net, and [https://microformats.org/discuss/mail/microformats-discuss/ microformats-discuss mailing list]. (追記ここまで)


(削除) ; Editor: (削除ここまで)[(削除) http://tantek.com/ Tantek Çelik (削除ここまで)](削除) , (削除ここまで)[(削除) http://technorati (削除ここまで).(削除) com Technorati, Inc.] (削除ここまで)
(追記) === Errata and Updates === (追記ここまで)
(削除) ; Authors: (削除ここまで)[(削除) http://tantek.com/ Tantek Çelik (削除ここまで)](削除) , [http://technorati.com Technorati, Inc (削除ここまで)](削除) , [http://suda.co (削除ここまで).(削除) uk/ Brian Suda] (削除ここまで)
(追記) Known errors and issues in this specification are corrected in (追記ここまで)[(追記) [hcard-issues-resolved|resolved] (追記ここまで)] (追記) and (追記ここまで)[(追記) [hcard-issues-closed|closed]] issues (追記ここまで). (追記) Please check there before reporting [ (追記ここまで)[(追記) hcard-issues|issues (追記ここまで)]].


(削除) ; Acknowledgments: See (削除ここまで)[[(削除) hcard#Inspiration_and_Acknowledgements|acknowledgments (削除ここまで)]].
(追記) The hCard 1.0.1 update is currently under development and incorporates known errata corrections as well as the (追記ここまで)[[(追記) value-class-pattern (追記ここまで)]].


(削除) Microformats (削除ここまで)[[(削除) hcard#Copyright (削除ここまで)|(削除) copyright (削除ここまで)]] (削除) and [[hcard#Patents|patents]] statements apply (削除ここまで).
(追記) == Background == (追記ここまで)
(追記) The vCard standard ( (追記ここまで)[[(追記) rfc-2426 (追記ここまで)|(追記) RFC2426 (追記ここまで)]](追記) ), has been broadly interoperably implemented (e.g. Apple's "Address Book" application built into MacOSX) (追記ここまで).


(削除) == Introduction == (削除ここまで)
(追記) In addition, many bloggers identify themselves by name and discuss their friends and family (追記ここまで). (追記) With just a tad bit of structure (追記ここまで), (追記) bloggers can discuss people in their blog (追記ここまで)(s(追記) ) in such a way that spiders and other aggregators can retrieve this information, automatically convert them to vCards, and use them in any vCard (追記ここまで)application (追記) or service (追記ここまで).
(削除) The vCard standard ([http://www (削除ここまで).(削除) ietf.org/rfc/rfc2426.txt RFC2426]) (削除ここまで), (削除) has been broadly interoperably implemented (削除ここまで)((削除) e.g. Apple' (削除ここまで)s (削除) "Address Book" (削除ここまで)application (削除) built into MacOSX) (削除ここまで).


(削除) In addition (削除ここまで), (削除) many bloggers identify themselves by name (削除ここまで)and (削除) discuss their friends and family (削除ここまで). (削除) With just a tad bit of structure, bloggers (削除ここまで)can (削除) discuss people (削除ここまで)in their (削除) blog(s) in such a way that spiders (削除ここまで)and (削除) other aggregators can (削除ここまで)retrieve (削除) this (削除ここまで)information(削除) , automatically convert them (削除ここまで)to (削除) vCards, and use them in any vCard application or service (削除ここまで).
(追記) This specification introduces the '''hCard''' format (追記ここまで), (追記) which uses a 1:1 representation of the properties (追記ここまで)and (追記) values of the aforementioned vCard standard, in semantic HTML (追記ここまで). (追記) Bloggers (追記ここまで)can (追記) both embed hCards directly (追記ここまで)in their (追記) web pages, (追記ここまで)and (追記) style them with CSS to make them appear as desired. In addition, hCard enables applications to (追記ここまで)retrieve information (追記) directly from web pages without having (追記ここまで)to (追記) reference a separate file (追記ここまで).


(削除) This specification introduces (削除ここまで)the (削除) ''' (削除ここまで)hCard(削除) ''' format, which uses a 1:1 representation of the properties (削除ここまで)and (削除) values of (削除ここまで)the (削除) aforementioned vCard standard, in semantic XHTML. Bloggers can both embed hCards directly in their web pages, and style them with CSS to make them appear as desired. In addition, hCard enables applications (削除ここまで)to (削除) retrieve information directly from web pages without having (削除ここまで)to (削除) reference a separate file (削除ここまで).
(追記) Use (追記ここまで)the (追記) [https://microformats.org/code/hcard/creator (追記ここまで)hCard (追記) creator] (追記ここまで)and (追記) copy (追記ここまで)the (追記) HTML code it generates (追記ここまで)to (追記) your blog or website (追記ここまで)to (追記) publish your contact info (追記ここまで).


(削除) Use the [http://microformats.org/code/hcard/creator hCard creator] and copy the HTML code it generates to your blog or website to publish your contact info. (削除ここまで)
(追記) == Conformance == (追記ここまで)
(追記) {{rfc-2119-intro}} (追記ここまで)


== Format ==
== Format ==
=== In General ===
=== In General ===
The vCard standard ([(削除) http://www.ietf.org/ (削除ここまで)rfc(削除) /rfc2426.txt (削除ここまで)RFC2426]) forms the basis of hCard.
The vCard standard ([(追記) [ (追記ここまで)rfc(追記) -2426| (追記ここまで)RFC2426(追記) ] (追記ここまで)]) forms the basis of hCard.


The basic format of hCard is to use vCard object/property names in lower-case for class names, and to map the nesting of vCard objects directly into nested (削除) XHTML (削除ここまで)elements.
The basic format of hCard is to use vCard object/property names in lower-case for class names, and to map the nesting of vCard objects directly into nested (追記) HTML (追記ここまで)elements.


=== Root Class Name ===
=== Root Class Name ===
The root class name for an hCard is "vcard".
The root class name for an hCard is "vcard"(追記) . An element with a class name of "vcard" is itself called an ''hCard''. (追記ここまで)
(追記) === Properties and Sub-properties === (追記ここまで)
(追記) The properties of an hCard are represented by elements inside the hCard. Elements with class names of the listed properties represent the values of those properties. Some properties have sub-properties, and those are represented by elements inside the elements for properties (追記ここまで).


=== Property List ===
=== Property List ===
hCard properties ((削除) subproperties (削除ここまで)in parentheses like this)
hCard properties ((追記) sub-properties (追記ここまで)in parentheses like this)


'''Required:'''
'''Required:'''
* '''fn'''
* '''fn'''
* '''n'''* (削除) ( (削除ここまで)family-name(削除) , (削除ここまで)given-name(削除) , (削除ここまで)additional-name(削除) , (削除ここまで)honorific-prefix(削除) , (削除ここまで)honorific-suffix(削除) ) (削除ここまで)
* (追記) <span id="property-list-n"> (追記ここまで)'''n'''(追記) <sup style="font-size:smaller">[[#note1|1]]</sup></span> (追記ここまで)
(追記) * (追記ここまで)* family-name
(追記) ** (追記ここまで)given-name
(追記) ** (追記ここまで)additional-name
(追記) ** (追記ここまで)honorific-prefix
(追記) ** (追記ここまで)honorific-suffix
Optional:
Optional:
* (削除) nickname, sort-string (削除ここまで)
* (追記) [[adr]] (追記ここまで)
(削除) * url, email (type, value), tel (削除ここまで)** (削除) (type, value) (削除ここまで)
** post-office-box
(削除) * adr ( (削除ここまで)post-office-box(削除) , (削除ここまで)extended-address(削除) , (削除ここまで)street-address(削除) , (削除ここまで)locality(削除) , (削除ここまで)region(削除) , (削除ここまで)postal-code(削除) , (削除ここまで)country-name(削除) , (削除ここまで)type, value)(削除) , label (削除ここまで)
(追記) ** (追記ここまで)extended-address
* geo (削除) ( (削除ここまで)latitude(削除) , (削除ここまで)longitude(削除) ), tz (削除ここまで)
(追記) ** (追記ここまで)street-address
* (削除) photo, (削除ここまで)logo(削除) , sound, bday (削除ここまで)
(追記) ** (追記ここまで)locality
* (削除) title, role, (削除ここまで)org (organization-name, organization-unit)
(追記) ** (追記ここまで)region
* (削除) category (削除ここまで), (削除) note (削除ここまで)
(追記) ** (追記ここまで)postal-code
* (削除) class, key, mailer, (削除ここまで)uid(削除) , rev (削除ここまで)
(追記) ** (追記ここまで)country-name
(追記) ** type (追記ここまで)
(追記) ** value (追記ここまで)
(追記) * agent (追記ここまで)
(追記) * bday (追記ここまで)
(追記) * category (追記ここまで)
(追記) * class (追記ここまで)
(追記) * email ( (追記ここまで)type, value)
* geo
(追記) ** (追記ここまで)latitude
(追記) ** (追記ここまで)longitude
* (追記) key (追記ここまで)
(追記) * label (追記ここまで)
(追記) * (追記ここまで)logo
* (追記) mailer (追記ここまで)
(追記) * nickname (追記ここまで)
(追記) * note (追記ここまで)
(追記) * (追記ここまで)org (organization-name, organization-unit)
* (追記) photo (追記ここまで)
(追記) * rev (追記ここまで)
(追記) * role (追記ここまで)
(追記) * sort-string (追記ここまで)
(追記) * sound (追記ここまで)
(追記) * <span id="property-list-tel">tel<sup style="font-size:smaller">[[#note2|2]]</sup> (type (追記ここまで), (追記) value)</span> (追記ここまで)
(追記) * title (追記ここまで)
(追記) * <span id="property-list-tz">tz<sup style="font-size:smaller">[[#note3|3]]</sup></span> (追記ここまで)
* uid
(追記) * url (追記ここまで)


=== Property Notes ===
=== Property Notes ===
<(削除) nowiki (削除ここまで)>(削除) * (削除ここまで)</(削除) nowiki (削除ここまで)> The 'n' property is optional if any [[hcard#Implied_.22n.22_Optimization|implied 'n' optimization rules]] are in effect.<br />
<(追記) span id="note1" (追記ここまで)>(追記) [[#property-list-n|1. ^]] (追記ここまで)</(追記) span (追記ここまで)>(追記) : (追記ここまで)The 'n' property is (追記) {{ (追記ここまで)optional(追記) }} (追記ここまで)if any [[hcard#Implied_.22n.22_Optimization|implied 'n' optimization rules]] are in effect.<br />
<(削除) nowiki (削除ここまで)>(削除) ** (削除ここまで)</(削除) nowiki (削除ここまで)> tel - Authors (削除) MAY want to (削除ここまで)follow the E.123 standard for writing values of telephone numbers.
<(追記) span id="note2" (追記ここまで)>(追記) [[#property-list-tel|2. ^]] (追記ここまで)</(追記) span (追記ここまで)>(追記) : (追記ここまで)tel - Authors (追記) {{may}} (追記ここまで)follow the (追記) [https://en.wikipedia.org/wiki/E.123 (追記ここまで)E.123(追記) ] (追記ここまで)standard for writing values of telephone numbers(追記) . Letter values (e.g. +1-555-FORMATS) {{must}} be converted to numbers. Use an <code>abbr</code> to display letters and provide a numerical value simultaneously, e.g. <code><nowiki><abbr title="+15553676287">+1-555-FORMATS</abbr></nowiki></code>.<br /> (追記ここまで)
(追記) <span id="note3">[[#property-list-tz|3. ^]]</span>: tz - timezones are indicated with the timezone offset, e.g. <code>PST (&lt;span class="tz">-08:00&lt;/span>)</code> (追記ここまで).


=== Singular vs. Plural Properties ===
=== Singular vs. Plural Properties ===
Singular properties: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class'. For properties which are singular, the first descendant element with that class should take effect, any others being ignored.
Singular properties: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class(追記) ', 'rev (追記ここまで)'. For properties which are singular, the first descendant element with that class (追記) {{ (追記ここまで)should(追記) }} (追記ここまで)take effect, any others being ignored.


All other properties (削除) can (削除ここまで)be plural. Each class instance of such properties (削除) (削除ここまで)creates a new instance of that property.
All other properties (追記) {{may}} (追記ここまで)be plural. Each class instance of such properties creates a new instance of that property.


=== Human vs. Machine readable ===
=== Human vs. Machine readable ===
If an <code>&lt;abbr&gt;</code> element is used for a property, then the '<code>title</code>' attribute of the <code>&lt;abbr></code> element is the value of the property, instead of the contents of the element, which instead provide a human presentable version of the value. (削除) (削除ここまで)
(追記) The human visible text contents of an element for a property represents the value of that property, with a few exceptions: (追記ここまで)
If an <code>&lt;abbr&gt;</code> element is used for a property, then the '<code>title</code>' attribute (追記) (if present) (追記ここまで)of the <code>&lt;abbr></code> element is the value of the property, instead of the contents of the element, which instead provide a (追記) more (追記ここまで)human presentable version of the value.


If an <code>&lt;a&gt;</code> element is used for one or more properties, it must be treated as follows:
If an <code>&lt;a&gt;</code> element is used for one or more properties, it (追記) {{ (追記ここまで)must(追記) }} (追記ここまで)be treated as follows:
# For the (削除) "PHOTO" (削除ここまで)property and any other property that takes a URL as its value, the <code>href="..."</code> attribute provides the property value.
# For the (追記) 'photo' (追記ここまで)property and any other property that takes a URL as its value, the <code>href="..."</code> attribute provides the property value.
# For other properties, the element's content is the value of the property.
# For other properties, the element's content is the value of the property.


If an <code>&lt;img&gt;</code> element is used for one or more properties, it must be treated as follows:
If an <code>&lt;img&gt;</code> element is used for one or more properties, it (追記) {{ (追記ここまで)must(追記) }} (追記ここまで)be treated as follows:
# For the (削除) "PHOTO" (削除ここまで)property and any other property that takes a URL as its value, the <code>src="..."</code> attribute provides the property value.
# For the (追記) 'photo' (追記ここまで)property and any other property that takes a URL as its value, the <code>src="..."</code> attribute provides the property value.
# For other properties, the <code>&lt;img></code> element's '<code>alt</code>' attribute is the value of the property.
# For other properties, the <code>&lt;img></code> element's '<code>alt</code>' attribute is the value of the property.


If an <code>&lt;object&gt;</code> element is used for one or more properties, it must be treated as follows:
If an <code>&lt;object&gt;</code> element is used for one or more properties, it (追記) {{ (追記ここまで)must(追記) }} (追記ここまで)be treated as follows:
# For the (削除) "PHOTO" (削除ここまで)property and any other property that takes a URL as its value, the <code>data="..."</code> attribute provides the property value.
# For the (追記) 'photo' (追記ここまで)property and any other property that takes a URL as its value, the <code>data="..."</code> attribute provides the property value.
# For other properties, the element's content is the value of the property.
# For other properties, the element's content is the value of the property.


=== Value excerpting ===
=== Value excerpting ===
Sometimes only part of an element which is the equivalent for a property (削除) should be (削除ここまで)used for the value of the property. This typically occurs when a property has a subtype, like (削除) TEL (削除ここまで). (削除) (削除ここまで)For this purpose, the special class name "<code>value</code>" is (削除) introduced (削除ここまで)to excerpt out the subset of the element that is (削除) (削除ここまで)the value of the property. (削除) (削除ここまで)E.g. here is an hCard fragment for marking up a home phone number:<br />
Sometimes only part of an element which is the equivalent for a property (追記) is (追記ここまで)used for the value of the property. This typically occurs when a property has a subtype, like (追記) 'tel' (追記ここまで). For this purpose, the special class name "<code>value</code>" is (追記) used (追記ここまで)to excerpt out the subset of the element that is the value of the property. E.g. here is an hCard fragment for marking up a home phone number:<br />


vCard:
vCard:
Line 83: Line 204:


hCard:
hCard:
<(削除) pre><nowiki (削除ここまで)>
<(追記) source lang=html4strict (追記ここまで)>
<span class="tel">
<span class="tel">
<span class="type">home</span>:
<span class="type">home</span>:
<span class="value">+1.415.555.1212</span>
<span class="value">+1.415.555.1212</span>
</span>
</span>
</(削除) nowiki></pre (削除ここまで)>
</(追記) source (追記ここまで)>


This hCard fragment could be displayed as:
This hCard fragment could be displayed as:
Line 98: Line 219:
</span>
</span>
</div>
</div>
(追記) (追記ここまで)
(追記) You may want to customize/localize the visible punctuation and not want to include it in what machines see. Use multiple class="value" elements which are then concatenated. E.g. (追記ここまで)
(追記) (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <span class="tel"> (追記ここまで)
(追記) <span class="type">home</span>: (追記ここまで)
(追記) <span class="value">+1</span>.<span class="value">415</span>.<span class="value">555</span>.<span class="value">1212</span></span> (追記ここまで)
(追記) </span> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) (追記ここまで)
(追記) No change in display, but the parsed hCard property value then becomes in vCard: (追記ここまで)
(追記) (追記ここまで)
(追記) vCard: (追記ここまで)
(追記) <pre><nowiki> (追記ここまで)
(追記) TEL;TYPE=HOME:+14155551212 (追記ここまで)
(追記) </nowiki></pre> (追記ここまで)
(追記) (追記ここまで)
(追記) <!-- note for Tantek: review/edit property casing from here on --> (追記ここまで)


=== Property Exceptions ===
=== Property Exceptions ===
vCard has several properties which either do not make sense on, or are already implied within the context of a web page. This section explains what to (not) do with them.
vCard has several properties which either do not make sense on, or are already implied within the context of a web page. This section explains what to (not) do with them.


# '''NAME''', '''PROFILE''', '''SOURCE''', '''PRODID''', '''VERSION''' properties (削除) as (削除ここまで)defined in Sections 2.1.2, 2.1.3, 2.1.4, 3.6.3, 3.6.9 of (削除) RFC (削除ここまで)2426. Content publishers (削除) MUST NOT (削除ここまで)use these properties in their hCards, and as such, hCard consumers/parsers (削除) MUST (削除ここまで)IGNORE these properties if they are found within an hCard. (削除) (削除ここまで)Instead. hCard to vCard converters (削除) SHOULD (削除ここまで)use the title of the page where the hCard is found (e.g. the <code><title></code> element in (削除) (X) (削除ここまで)HTML documents) to construct the NAME property, (削除) MAY (削除ここまで)output a PROFILE value of "<code>VCARD</code>" per (削除) RFC (削除ここまで)2426, (削除) SHOULD (削除ここまで)use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. (削除) (削除ここまで)Similarly only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per RFC2426 Section 3.6.9.
# (追記) vCard's (追記ここまで)'''NAME''', '''PROFILE''', '''SOURCE''', '''PRODID''', '''VERSION''' properties (追記) are (追記ここまで)defined in Sections 2.1.2, 2.1.3, 2.1.4, 3.6.3, 3.6.9 of (追記) [[rfc- (追記ここまで)2426(追記) |RFC2426]] (追記ここまで). Content publishers (追記) {{must-not}} (追記ここまで)use these properties in their hCards, and as such, hCard consumers/parsers (追記) {{must}} (追記ここまで)IGNORE these properties if they are found within an hCard. Instead. hCard to vCard converters (追記) {{should}} (追記ここまで)use the title of the page where the hCard is found (e.g. the <code><title></code> element in HTML documents) to construct the NAME property, (追記) {{may}} (追記ここまで)output a PROFILE value of "<code>VCARD</code>" per (追記) [[rfc- (追記ここまで)2426(追記) |RFC2426]] (追記ここまで), (追記) {{should}} (追記ここまで)use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. Similarly(追記) , (追記ここまで)only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per (追記) [[rfc-2426| (追記ここまで)RFC2426(追記) ]] (追記ここまで)Section 3.6.9.


=== Organization Contact Info ===
=== Organization Contact Info ===
If the "FN" and "ORG" properties have the exact same value (typically because they are set on the same element, e.g. class="fn org"), then the hCard represents contact information for a company or (削除) organization (削除ここまで)and should be treated as such. (削除) (削除ここまで)In this case the author (削除) MUST (削除ここまで)also (削除) NOT (削除ここまで)set the "N" property, or set it (and any sub-properties) explicitly to the empty string "". (削除) (削除ここまで)Thus parsers should handle the missing "N" property in this case by implying empty values for all the "N" sub-properties.
If the "FN" and "ORG" (追記) (organization) (追記ここまで)properties have the exact same value (typically because they are set on the same element, e.g. class="fn org"), then the hCard represents contact information for a company(追記) , organization (追記ここまで)or (追記) place (追記ここまで)and (追記) {{ (追記ここまで)should(追記) }} (追記ここまで)be treated as such. In this case the author also (追記) {{must-not}} (追記ここまで)set the "N" property, or set it (and any sub-properties) explicitly to the empty string "". Thus parsers (追記) {{ (追記ここまで)should(追記) }} (追記ここまで)handle the missing "N" property(追記) , (追記ここまで)in this case by implying empty values for all the "N" sub-properties.


=== Implied "(削除) n (削除ここまで)" Optimization ===
=== Implied "(追記) N (追記ここまで)" Optimization ===
Although vCard requires that the "N" property be present, the authors of the vCard specification ((削除) RFC (削除ここまで)2426) themselves do not include "N" properties in their vCards near the end of the spec (p.38). This apparent contradiction can be resolved by simply allowing the "FN" property to imply "N" property values in typical cases provided in the spec. (削除) (削除ここまで)We do so explicitly in hCard.
Although vCard requires that the "N" property be present, the authors of the vCard specification ((追記) [[rfc- (追記ここまで)2426(追記) |RFC2426]] (追記ここまで)) themselves do not include "N" properties in their vCards near the end of the spec (p.38). This apparent contradiction can be resolved by simply allowing the "FN" property to imply "N" property values in typical cases provided in the spec. We do so explicitly in hCard.


If "FN" and "ORG" are not the same (see previous section), and the value of the "FN" property is exactly two words (separated by whitespace), and there is no explicit "N" property, then the "N" property is inferred from the "FN" property. For "FN"s with either one word see below, and for three or more, the author (削除) MUST (削除ここまで)explicitly markup the "N", except for the organization contact info case, [(削除) http://microformats.org/wiki/ (削除ここまで)hcard#Organization_Contact_Info see above] for that.
If "FN" and "ORG" are not the same (see previous section), and the value of the "FN" property is exactly two words (separated by whitespace), and there is no explicit "N" property, then the "N" property is inferred from the "FN" property. For "FN"s with either one word see below, and for three or more, the author (追記) {{must}} (追記ここまで)explicitly markup the "N", except for the organization contact info case, [(追記) [ (追記ここまで)hcard#Organization_Contact_Info(追記) | (追記ここまで)see above(追記) ] (追記ここまで)] for that.


# The content of "FN" is broken into two "words" separated by whitespace.
# The content of "FN" is broken into two "words" separated by whitespace.
# The ''first'' word of the "FN" is interpreted as the "given-name" for the "N" property.
# The ''first'' word of the "FN" is interpreted as the "given-name" for the "N" property.
# The ''second/last'' word of the "FN" is interpreted as the "family-name" for the "N" property.
# The ''second/last'' word of the "FN" is interpreted as the "family-name" for the "N" property.
# Exception: If the first word ends in a "," comma (削除) OR if the second word is a single character (optionally followed by a period ".") (削除ここまで), then the first word (minus the comma at the end (削除) if any (削除ここまで)) is interpreted as the "family-name" and the second word is interpreted as the "given-name".
# Exception: If the first word ends in a "," comma, then the first word (minus the comma at the end) is interpreted as the "family-name" and the second word is interpreted as the "given-name".


This allows simplification in the typical case of people stating:
This allows simplification in the typical case of people stating:
* given-name (space) family-name
* given-name (space) family-name
* family-name (comma) given-name
* family-name (comma) given-name
(削除) * family-name (comma) given-name-first-initial (削除ここまで)
(削除) * family-name (space) given-name-first-initial (optional period) (削除ここまで)


=== Implied "nickname" Optimization ===
=== Implied "nickname" Optimization ===
Due to the prevalence of the use of nicknames/handles/usernames (削除) on the Web (削除ここまで)in actual content published on the Web (e.g. authors of [[hReview|reviews]]), hCard also has an implied "nickname" optimization to handle this.
Due to the prevalence of the use of nicknames/handles/usernames in actual content published on the Web (e.g. authors of [[hReview|reviews]]), hCard also has an implied "nickname" optimization to handle this.


Similar to the implied "n" optimization, if "FN" and "ORG" are not the same, and the value of the "FN" property is exactly one word, and there is no explicit "N" property, then:
Similar to the implied "n" optimization, if "FN" and "ORG" are not the same, and the value of the "FN" property is exactly one word, and there is no explicit "N" property, then:


# The content of the "FN" (削除) is (削除ここまで)treated as a "nickname" property value.
# The content of the "FN" (追記) {{must}} be (追記ここまで)treated as a "nickname" property value.
# Parsers should handle the missing "N" property by implying empty values for all the "N" sub-properties.
# Parsers (追記) {{ (追記ここまで)should(追記) }} (追記ここまで)handle the missing "N" property by implying empty values for all the "N" sub-properties.
(追記) Though parsers {{must}} follow the implied nickname optimization, publishers {{should}} explicitly indicate the "nickname" even in this case, e.g.: (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <span class="vcard"> (追記ここまで)
(追記) <span class="fn nickname">daveman692</span> (追記ここまで)
(追記) </span> (追記ここまで)
(追記) </source> (追記ここまで)


(削除) Note: the (削除ここまで)hCard may have additional explicit "nickname" property values in addition to the implied nickname.
(追記) The (追記ここまで)hCard (追記) {{ (追記ここまで)may(追記) }} (追記ここまで)have additional explicit "nickname" property values in addition to the implied nickname.


=== Implied "organization-name" Optimization ===
=== Implied "organization-name" Optimization ===
The "ORG" property has two subproperties, organization-name and organization-unit. Very often authors only publish the organization-name. Thus if an "ORG" property has no "organization-name" inside it, then its entire contents (削除) MUST (削除ここまで)be treated as the "organization-name".
The "ORG" property has two subproperties, organization-name and organization-unit. Very often authors only publish the organization-name. Thus if an "ORG" property has no "organization-name" inside it, then its entire contents (追記) {{must}} (追記ここまで)be treated as the "organization-name".


=== Tags as Categories ===
=== Tags as Categories ===
Categories in hCard (削除) can optionally (削除ここまで)be represented by tags with [[rel-tag]]. When a category property is a rel-tag, the tag (as defined by rel-tag) is used for that category.
Categories in hCard (追記) {{may}} (追記ここまで)be represented by tags with [[rel-tag]]. When a category property is a rel-tag, the tag (as defined by rel-tag) is used for that category.


(削除) = (削除ここまで)=== type subproperty values (削除) = (削除ここまで)===
=== type subproperty values ===
The 'type' subproperty in particular takes different values depending on which property it is a subproperty of. These 'type' subproperty values are case-INSENSITIVE, meaning "Home" is the same as "home", as well as multivalued, e.g. a tel can be home and preferred:
The 'type' subproperty in particular takes different values depending on which property it is a subproperty of. These 'type' subproperty values are case-INSENSITIVE, meaning "Home" is the same as "home", as well as multivalued, e.g. a tel can be home and preferred:


Line 148: Line 293:


hCard:
hCard:
<(削除) pre><nowiki (削除ここまで)>
<(追記) source lang=html4strict (追記ここまで)>
<span class="tel"><span class="type">Home</span> (<span class="type">pref</span>erred):
<span class="tel"><span class="type">Home</span> (<span class="type">pref</span>erred):
<span class="value">+1.415.555.1212</span>
<span class="value">+1.415.555.1212</span>
</span>
</span>
</(削除) nowiki></pre (削除ここまで)>
</(追記) source (追記ここまで)>


This could be displayed as:
This could be displayed as:
Line 162: Line 307:
</div>
</div>


The following lists are ''informative''. See (削除) RFC (削除ここまで)2426 sections 3.2.1 ADR, 3.3.1 TEL, and 3.3.2 EMAIL respectively for normative type values. They are repeated here for convenience. Default type subproperty value(s) is(are) first in each list and indicated in ALL CAPS. types may be multivalued.
(追記) ==== type with unspecified value ==== (追記ここまで)
(追記) When the type of a property is specified, and there is no explicit value specified, then everything in the property except for the type is considered the value of the property. E.g. (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <span class="tel"><span class="type">Home</span> +1.415.555.1212</span> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) is equivalent to: (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <span class="tel"><span class="type">Home</span><span class="value"> +1.415.555.1212</span></span> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) And thus the type is "home" and the value is "+1.415.555.1212". (追記ここまで)
(追記) ==== adr tel email types ==== (追記ここまで)
The following lists are ''informative''. See (追記) [[rfc- (追記ここまで)2426(追記) |RFC2426]] (追記ここまで)sections 3.2.1 ADR, 3.3.1 TEL, and 3.3.2 EMAIL respectively for normative type values. They are repeated here for convenience. Default type subproperty value(s) is(are) first in each list and indicated in ALL CAPS. types may be multivalued.


* adr type: INTL, POSTAL, PARCEL, WORK, dom, home, pref
* adr type: INTL, POSTAL, PARCEL, WORK, dom, home, pref
* tel type: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, [(削除) http (削除ここまで)://flickr.com/photos/tags/carcellphone/ car], isdn, pcs
* tel type: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, [(追記) https (追記ここまで)://flickr.com/photos/tags/carcellphone/ car], isdn, pcs
* email type: INTERNET, x400, pref(削除) , "other IANA registered address types" (削除ここまで)
* email type: INTERNET, x400, pref


=== (削除) XMDP (削除ここまで)Profile ===
=== Profile ===
(追記) The hCard <span id="XMDP_Profile">XMDP profile</span> is at http://microformats.org/profile/hcard (追記ここまで)


(削除) See [[ (削除ここまで)hcard(削除) - (削除ここまで)profile(削除) ]] for the [ (削除ここまで)http://(削除) gmpg (削除ここまで).org/(削除) xmdp XMDP] (削除ここまで)profile (削除) of (削除ここまで)hCard (削除) which contains (削除ここまで)the above (削除) complete list of properties, with references to their RFC 2426 definitions (削除ここまで).
(追記) Content that uses hCard {{should}} reference this profile, e.g. (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <link rel="profile" href="http://microformats.org/profile/ (追記ここまで)hcard(追記) "> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) or (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) This content uses <a rel=" (追記ここまで)profile(追記) " href=" (追記ここまで)http://(追記) microformats (追記ここまで).org/profile(追記) /hcard"> (追記ここまで)hCard(追記) </a>. (追記ここまで)
(追記) </source> (追記ここまで)
(追記) or (追記ここまで)
(追記) <source lang=html4strict> (追記ここまで)
(追記) <head profile="http://microformats.org/profile/hcard"> (追記ここまで)
(追記) </source> (追記ここまで)
(追記) (profile attribute is deprecated in HTML5) (追記ここまで)
(追記) Content may combine (追記ここまで)the above (追記) methods as well (追記ここまで).


=== Parsing Details ===
=== Parsing Details ===
Line 189: Line 364:
N:Çelik;Tantek
N:Çelik;Tantek
FN:Tantek Çelik
FN:Tantek Çelik
URL:(削除) http (削除ここまで)://tantek.com/
URL:(追記) https (追記ここまで)://tantek.com/
(削除) ORG:Technorati (削除ここまで)
END:VCARD
END:VCARD
</nowiki></pre>
</nowiki></pre>
Line 196: Line 370:
and an equivalent in hCard with various elements optimized appropriately. See [[hcard-example1-steps| hCard Example 1]] for the derivation.
and an equivalent in hCard with various elements optimized appropriately. See [[hcard-example1-steps| hCard Example 1]] for the derivation.


<(削除) pre><nowiki (削除ここまで)>
<(追記) source lang=html4strict (追記ここまで)>
<div class="vcard">
<div class="vcard">
<a class="url fn" href="(削除) http (削除ここまで)://tantek.com/">Tantek Çelik</a(削除) > (削除ここまで)
<a class="url fn" href="(追記) https (追記ここまで)://tantek.com/">Tantek Çelik</a>
(削除) <div class="org">Technorati</div (削除ここまで)>
</div>
</div>
</(削除) nowiki></pre (削除ここまで)>
</(追記) source (追記ここまで)>


This hCard might be displayed as:
This hCard might be displayed as:
<div style="border: thin dashed black; width: 95%; padding: .5em 1em;">
<div style="border: thin dashed black; width: 95%; padding: .5em 1em;">
[(削除) http (削除ここまで)://tantek.com/ Tantek Çelik](削除) <br /> (削除ここまで)
[(追記) https (追記ここまで)://tantek.com/ Tantek Çelik]
(削除) Technorati (削除ここまで)
</div>
</div>


Line 213: Line 385:
===Live example===
===Live example===


Here (削除) are the WikiMedia Foundation (削除ここまで)'s contact details, as a live hCard which will be detected, on this page, by microformat parsing tools:
Here (追記) is [http://www.commerce.net/ Commercenet] (追記ここまで)'s contact details, as a live hCard which will be detected, on this page, by microformat parsing tools:


<div class="vcard">
<div class="vcard">
<div class="fn org">'''(削除) Wikimedia Foundation Inc (削除ここまで).'''</div>
<div class="fn org">'''(追記) CommerceNet'''</div> (追記ここまで)
<div class="adr">
(追記) <div class="url">'''<nowiki>http://www (追記ここまで).(追記) commerce.net/</nowiki> (追記ここまで)'''</div>
<div class="street-address">'''(削除) 200 2nd Ave. South #358 (削除ここまで)'''</div>
<div class="adr">(追記) '''<span class="type">Work</span>:''' (追記ここまで)
(削除) <div> (削除ここまで)<span class="locality">'''(削除) St. Petersburg (削除ここまで)'''</span>, <span class="region">'''(削除) FL (削除ここまで)'''</span> <span class="postal-code">'''(削除) 33701-4313 (削除ここまで)'''</span(削除) ></div (削除ここまで)>
<div class="street-address">'''(追記) 169 University Avenue (追記ここまで)'''</div>
<span class="locality">'''(追記) Palo Alto (追記ここまで)'''</span>, <span class="region">'''(追記) CA (追記ここまで)'''</span>(追記) &nbsp;&nbsp; (追記ここまで)<span class="postal-code">'''(追記) 94301 (追記ここまで)'''</span>
<div class="country-name">'''USA'''</div>
<div class="country-name">'''USA'''</div>
</div>
</div>
<div>(削除) '''Phone: (削除ここまで)''' <span class="(削除) tel (削除ここまで)">(削除) ''' (削除ここまで)+1-(削除) 727 (削除ここまで)-(削除) 231 (削除ここまで)-(削除) 0101 (削除ここまで)'''(削除) </span> (削除ここまで)</div>
<div (追記) class="tel" (追記ここまで)>'''<span class="(追記) type (追記ここまで)">(追記) Work</span> (追記ここまで)+1-(追記) 650 (追記ここまで)-(追記) 289 (追記ここまで)-(追記) 4040 (追記ここまで)'''</div>
<div>(削除) '''Email: (削除ここまで)''' <span class="(削除) email (削除ここまで)">(削除) '''info@wikimedia.org''' (削除ここまで)</span></div>
<div (追記) class="tel" (追記ここまで)>'''<span class="(追記) type (追記ここまで)">(追記) Fax (追記ここまで)</span> (追記) +1-650-289-4041''' (追記ここまで)</div>
<div><span class="(削除) tel (削除ここまで)"><(削除) span class="type" (削除ここまで)>(削除) '''Fax''' (削除ここまで)</(削除) span (削除ここまで)>(削除) ''':''' (削除ここまで)<span (削除) class="value" (削除ここまで)>'''(削除) +1-727-258-0207'''</span></span> (削除ここまで)</div>
<div>(追記) '''Email (追記ここまで)<span class="(追記) email (追記ここまで)"><(追記) nowiki (追記ここまで)>(追記) info@commerce.net (追記ここまで)</(追記) nowiki (追記ここまで)><(追記) / (追記ここまで)span>'''</div>
</div>
</div>


The mark-up (削除) (wrapped (削除ここまで), (削除) and (削除ここまで)emboldening omitted(削除) , (削除ここまで)for clarity(削除) ) used is (削除ここまで):
The mark-up, emboldening omitted for clarity(追記) , with the following semantic improvements (追記ここまで):
(追記) * <code>abbr</code> to expand abbreviations (追記ここまで)
(追記) * hyperlinking the org name with the url (追記ここまで)


<(削除) pre><nowiki (削除ここまで)>
<(追記) source lang=html4strict (追記ここまで)>
<div class="vcard">
<div class="vcard">
<(削除) div (削除ここまで)class="fn org">(削除) Wikimedia Foundation Inc. (削除ここまで)</(削除) div (削除ここまで)>
<(追記) a (追記ここまで)class="fn org (追記) url" href="http://www.commerce.net/ (追記ここまで)">(追記) CommerceNet (追記ここまで)</(追記) a (追記ここまで)>
<div class="adr">
<div class="adr">
<div class="street-address">(削除) 200 2nd Ave. South #358 (削除ここまで)</div>
(追記) <span class="type">Work</span>: (追記ここまで)
(削除) <div> (削除ここまで)
<div class="street-address">(追記) 169 University Avenue (追記ここまで)</div>
(削除) (削除ここまで)<span class="locality">(削除) St. Petersburg (削除ここまで)</span>,
<span class="locality">(追記) Palo Alto (追記ここまで)</span>, (追記) (追記ここまで)
(削除) (削除ここまで)<abbr class="region" title="(削除) Florida (削除ここまで)">(削除) FL (削除ここまで)</abbr> <span class="postal-code">(削除) 33701-4313 (削除ここまで)</span(削除) > (削除ここまで)
(追記) (追記ここまで)<abbr class="region" title="(追記) California (追記ここまで)">(追記) CA (追記ここまで)</abbr>(追記) &nbsp;&nbsp; (追記ここまで)
(削除) </div (削除ここまで)>
(追記) (追記ここまで)<span class="postal-code">(追記) 94301 (追記ここまで)</span>
<div class="country-name">USA</div>
<div class="country-name">USA</div>
(削除) (削除ここまで)</div>
(追記) (追記ここまで)</div>
<div(削除) >Phone: <span (削除ここまで)class="tel"(削除) >+1-727-231-0101</span></div (削除ここまで)>
<div class="tel">
(削除) <div>Email: (削除ここまで)<span class="(削除) email (削除ここまで)">(削除) info@wikimedia.org (削除ここまで)</span></div>
(追記) (追記ここまで)<span class="(追記) type (追記ここまで)">(追記) Work (追記ここまで)</span> (追記) +1-650-289-4040 (追記ここまで)
<div(削除) > (削除ここまで)
(追記) (追記ここまで)</div>
(削除) <span (削除ここまで)class="tel"><span class="type">Fax</span>:
<div class="tel">
(削除) (削除ここまで)<span class="(削除) value (削除ここまで)">(削除) +1-727-258-0207</span> (削除ここまで)</span>
(追記) (追記ここまで)<span class="type">Fax</span> (追記) +1-650-289-4041 (追記ここまで)
(追記) </div> (追記ここまで)
(追記) <div>Email (追記ここまで):
(追記) (追記ここまで)<span class="(追記) email (追記ここまで)">(追記) info@commerce.net (追記ここまで)</span>
</div>
</div>
</div>
</div>
</(削除) nowiki></pre (削除ここまで)>
</(追記) source (追記ここまで)>


=== More Examples ===
=== More Examples ===
See [[hcard-examples|hCard examples]] for more examples, including all examples from vCard (削除) RFC (削除ここまで)2426 converted into hCard.
See [[hcard-examples|hCard examples]] for more examples, including all examples from vCard (追記) [[rfc- (追記ここまで)2426(追記) |RFC2426]] (追記ここまで)converted into hCard.
(削除) ==Buttons== (削除ここまで)
(削除) You can use these buttons on pages with hCards. See [[buttons#hCard]] for any recent additions. (削除ここまで)
(削除) * http://www.crowley.nl/images/hcard.png (mirror: http://www.davidjanes.com/images/mf_hcard.png) (削除ここまで)
(削除) * http://rbach.priv.at/2006/buttons/hcard.png (削除ここまで)
(削除) * http://www.boogdesign.com/images/buttons/microformat_hcard.png (削除ここまで)
(削除) * CSS-powered button, as evidenced at [http://re-run.com/about/microformat-badges microformat badges @ re-run] (削除ここまで)


== Examples in the wild ==
== Examples in the wild ==
Line 269: Line 439:


See [[hcard-implementations|hCard Implementations]].
See [[hcard-implementations|hCard Implementations]].
(追記) (追記ここまで)
(追記) == Articles == (追記ここまで)
(追記) This section is <strong>informative</strong>. For <span id="Further_Reading">further reading</span> on hCard see [[hcard-articles]]. (追記ここまで)
(追記) (追記ここまで)
(追記) ==Buttons== (追記ここまで)
(追記) You can use these buttons on pages with hCards. See [[buttons#hCard]] for any recent additions. (追記ここまで)
(追記) (追記ここまで)
(追記) * http://www.crowley.nl/images/hcard.png (mirror: http://www.davidjanes.com/images/mf_hcard.png) (追記ここまで)
(追記) * http://rbach.priv.at/2006/buttons/hcard.png (追記ここまで)
(追記) * http://www.boogdesign.com/images/buttons/microformat_hcard.png (追記ここまで)
(追記) * CSS-powered button, as evidenced at [http://re-run.com/about/microformat-badges microformat badges @ re-run] (追記ここまで)


== Copyright ==
== Copyright ==
{{(削除) MicroFormatCopyrightStatement2004 (削除ここまで)}}
(追記) Per the public domain release on the authors' user pages ([[User:Tantek|Tantek Çelik]], [[User:Brian|Brian Suda]]) this specification is released into the public domain. (追記ここまで)
{{(追記) MicroFormatPublicDomainContributionStatement (追記ここまで)}}


== Patents ==
== Patents ==
Line 278: Line 461:
== References ==
== References ==
=== Normative References ===
=== Normative References ===
* [(削除) http (削除ここまで)://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [(追記) https (追記ここまで)://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [(削除) http (削除ここまで)://www.ietf.org/rfc/rfc2426.txt vCard RFC2426]
* [(追記) https (追記ここまで)://www.ietf.org/rfc/rfc2426.txt vCard RFC2426]
* [http://www.itu.int/rec/T-REC-E.123-200102-I/en ITU recommendation E.123] format of telephone numbers (chargeable document)
* [http://www.itu.int/rec/T-REC-E.123-200102-I/en ITU recommendation E.123] format of telephone numbers (chargeable document)
(追記) * [[rfc-2119|RFC 2119]] (追記ここまで)


=== Informative References ===
=== Informative References ===
* Contributed from http://developers.technorati.com/wiki/hCard(削除) . (削除ここまで)
(追記) This section is '''informative'''. (追記ここまで)
(追記) * [[hcard-history|hCard history]] (追記ここまで)
(追記) ** [http://wiki.oreillynet.com/foocamp04/index.cgi?SimpleSemanticFormats FOO Camp 2004 Simple Semantic Formats presentation, 2004年09月10日] (追記ここまで)
(追記) ** [https://tantek.com/log/2004/09.html#hcard hCard term introduced and defined on the Web, 2004年09月30日] (追記ここまで)
(追記) * (追記ここまで)* Contributed from http://developers.technorati.com/wiki/hCard (追記) 2005年06月20日 (追記ここまで)
* [http://www.dante.net/np/ds/osi/9594-6-X.520.A4.ps X.520 in Postscript] ([http://72.14.253.104/search?q=cache:FjqzsFu4h20J:www.dante.net/np/ds/osi/9594-6-X.520.A4.ps HTMLization courtesy of Google Cache]) - vCard refers to ROLE as being "based on the X.520 Business Category explanatory attribute".
* [http://www.dante.net/np/ds/osi/9594-6-X.520.A4.ps X.520 in Postscript] ([http://72.14.253.104/search?q=cache:FjqzsFu4h20J:www.dante.net/np/ds/osi/9594-6-X.520.A4.ps HTMLization courtesy of Google Cache]) - vCard refers to ROLE as being "based on the X.520 Business Category explanatory attribute".
* [(削除) http (削除ここまで)://www.w3.org/2002/12/cal/rfc2426 HTML reformatted version of RFC2426]
* [(追記) https (追記ここまで)://www.w3.org/2002/12/cal/rfc2426 HTML reformatted version of RFC2426]
* [(削除) http (削除ここまで)://w3.org/TR/REC-CSS1 CSS1]
* [(追記) https (追記ここまで)://(追記) www. (追記ここまで)w3.org/TR/REC-CSS1 CSS1]
* [(削除) http://tantek.com/log/2004/09.html#hcard hCard term introduced and defined on the Web, 20040930] (削除ここまで)
* [(追記) https (追記ここまで)://www.w3.org/TR/xhtml11 XHTML 1.1]
(削除) * [http://wiki.oreillynet.com/foocamp04/index.cgi?SimpleSemanticFormats FOO Camp 2004 Simple Semantic Formats presentation, 20040910] (削除ここまで)
* [(追記) https (追記ここまで)://en.wikipedia.org/wiki/E.123 Wikipedia summary of ITU-T Recommendation E.123] - for "TEL" values.
(削除) * [http (削除ここまで)://www.w3.org/TR/xhtml11 XHTML 1.1]
* [(削除) http (削除ここまで)://en.wikipedia.org/wiki/E.123 Wikipedia summary of ITU-T Recommendation E.123] - for "TEL" values.
* [http://www.imc.org/pdi/ Internet Mail Consortium Personal Data Interchange vCard and vCalendar]
* [http://www.imc.org/pdi/ Internet Mail Consortium Personal Data Interchange vCard and vCalendar]
(追記) * [[iso-8601|ISO8601]] (追記ここまで)


==== Specifications That Use hCard ====
==== Specifications That Use hCard ====
Line 300: Line 487:


==== Similar Work ====
==== Similar Work ====
(追記) This section is '''informative'''. (追記ここまで)
* [http://www.intertwingly.net/wiki/pie/PaceBetterPersonElement Atom PaceBetterPersonElement]
* [http://www.intertwingly.net/wiki/pie/PaceBetterPersonElement Atom PaceBetterPersonElement]
* [http://www.jabber.org/jeps/jep-0054.html JEP-0054: vcard-temp]
* [http://www.jabber.org/jeps/jep-0054.html JEP-0054: vcard-temp]


== Inspiration and Acknowledgments ==
== Inspiration and Acknowledgments ==
(追記) This section is '''informative'''. (追記ここまで)
Thanks to: my good friend [http://vadim.com/ Vadim] who introduced me to vCard ''many'' years ago, and if I'd only paid more attention then, perhaps I could have helped a lot of people avoid wasting a lot of time reinventing various standards wheels.
Thanks to: my good friend [http://vadim.com/ Vadim] who introduced me to vCard ''many'' years ago, and if I'd only paid more attention then, perhaps I could have helped a lot of people avoid wasting a lot of time reinventing various standards wheels.


Line 309: Line 498:
This section is ''informative''.
This section is ''informative''.


=(削除) == Semantic XHTML Design Principles === (削除ここまで)
(追記) <div id (追記ここまで)=(追記) "Semantic_XHTML_Design_Principles">See: [[hcard (追記ここまで)-design-(追記) methodology]].</div> (追記ここまで)
(削除) {{semantic-xhtml (削除ここまで)-design-(削除) principles}} (削除ここまで)


=== More Semantic Equivalents ===
=== More Semantic Equivalents ===
For some properties there are HTML elements which better match and convey their semantics. The following properties SHOULD be encoded with the following (削除) (X) (削除ここまで)HTML:
For some properties there are HTML elements which better match and convey their semantics. The following properties SHOULD be encoded with the following HTML:
* <code>URL</code> in vCard becomes <code><a class="url" href="...">...</a></code> inside the element with <code>class="vcard"</code> in hCard.
* <code>URL</code> in vCard becomes <code><a class="url" href="...">...</a></code> inside the element with <code>class="vcard"</code> in hCard.
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a class="email" href="mailto:...">...</a></nowiki></code>
* Similarly, <code>EMAIL</code> in vCard becomes <code><nowiki><a class="email" href="mailto:...">...</a></nowiki></code>
Line 324: Line 512:
==== Plural Properties Singularized ====
==== Plural Properties Singularized ====
Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.
Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.
(削除) (削除ここまで)
(削除) == Further Reading == (削除ここまで)
(削除) * [http://www.digital-web.com/articles/microformats_primer/ Digital Web Magazine: Microformats Primer] by Garrett Dimon has a good intro to hCard (削除ここまで)
(削除) * [http://24ways.org/advent/practical-microformats-with-hcard Practical Microformats with hCard] by Drew McLellan (削除ここまで)
(削除) * [http://www.naturalsearchblog.com/archives/2006/09/28/tips-for-local-search-engine-optimization-for-your-site/ Local Search Engine Optimization using Microformats] by Chris Silver Smith (削除ここまで)
(削除) * [http://thedredge.org/ Andrew D. Hume] has written a blog post on [http://usabletype.com/articles/2005/usable-microformats/ usable microformats] which discusses hCard (削除ここまで)
(削除) * [http://www.thefutureoftheweb.com/blog/2006/1/hcard Jesse Skinner's introduction to hCard] (削除ここまで)
(削除) * [http://blog.usweb.com/ Shaun Shull's] great post on [http://blog.usweb.com/archives/how-microformats-affect-search-engine-optimization-seo How Microformats Affect SEO], including his [[hcard|hCard]] as an example. (削除ここまで)
(削除) * [http://24ways.org/2006/styling-hcards-with-css 24 Ways: Styling hCards with CSS] A 24 Ways article - John Allsopp on styling hCard using CSS (削除ここまで)
(削除) * See also [http://www.technorati.com/cosmos/referer.html blogs discussing this page] and the [http://technorati.com/tags/hcard hCard tag] (削除ここまで)
(削除) * [http://www.rfc-editor.org/rfc/rfc4770.txt RFC 4770 - Extensions for Instant Messaging] (削除ここまで)


== Related Pages ==
== Related Pages ==
{{hcard-related-pages}}
{{hcard-related-pages}}
(追記) (追記ここまで)
(追記) [[Category:Specifications]] (追記ここまで)
(追記) [[Category:hCard]] (追記ここまで)
(追記) (追記ここまで)
(追記) == Translations == (追記ここまで)
(追記) The English version of this specification is the only normative version. Read the hCard specification in additional <span id="languages">languages</span>: (追記ここまで)
(追記) * [[hcard-fr|<span lang="fr">Français</span>]] (追記ここまで)
(追記) * [[hcard-ja|<span lang="ja">日本語</span>]] (追記ここまで)
(追記) * [[hcard-ru|<span lang="ru">Русский</span>]] (追記ここまで)
(追記) * [[hcard-th|<span lang="th">ภาษาไทย</span>]] (追記ここまで)
(追記) * [[hcard-zh|<span lang="zh">漢語</span>]] (追記ここまで)
(追記) Help [[how-to-start-new-translation|translate hCard into more languages]]. (追記ここまで)

Latest revision as of 23:36, 24 August 2020

See latest version: h-card

Tantek Çelik (Editor, Author), Brian Suda (Author)


hCard is a simple, open format for publishing people, companies, organizations on the web, using a 1:1 representation of vCard (RFC2426) properties and values in HTML. hCard is one of several open microformat standards suitable for embedding data in HTML/HTML5, and Atom/RSS/XHTML or other XML.

Translations: Français日本語Русскийภาษาไทย漢語(Add your language)
Copyright and patents statements apply. See acknowledgments.

Example

hCards are most often used to represent people:

<div class="vcard">
 <a class="url fn" href="https://tantek.com/">Tantek Çelik</a>
</div>

and organizations:

<div class="vcard">
 <a class="url fn org" href="https://microformats.org/">microformats.org</a>
</div>

Get started

bullet.gif Create a new hCard
bullet.gif Learn hCard authoring


The class vcard is a root class name that indicates the presence of an hCard.

The classes url, fn, and org define properties of the hCard.

Properties

Common hCard properties (inside class vcard)
  • fn - name, formatted/full. required
  • n - structured name, container for:
    • honorific-prefix - e.g. Ms., Mr., Dr.
    • given-name - given (often first) name
    • additional-name - other/middle name
    • family-name - family (often last) name
    • honorific-suffix - e.g. Ph.D., Esq.
  • nickname - nickname/alias, e.g. IRC nick
  • org - company/organization
  • photo - photo, icon, avatar
  • url - home page for this contact
  • email - email address
  • tel - telephone number
  • adr - structured address, container for:
    • street-address - street #+name, apt/ste
    • locality - city or village
    • region - state or province
    • postal-code - postal code, e.g. U.S. ZIP
    • country-name - country name
  • bday - birthday. ISO date.
  • category - for tagging contacts
  • note - notes about the contact
Example hCard of common properties:
  • <div class="vcard">
    • <span class="fn">Sally Ride</span>
    • (<span class="n">
      • <span class="honorific-prefix">Dr.</span>
      • <span class="given-name">Sally</span>
      • <abbr class="additional-name">K.</abbr>
      • <span class="family-name">Ride</span>
      • <span class="honorific-suffix">Ph.D.</span></span>),
    • <span class="nickname">sallykride</span> (IRC)
    • <div class="org">Sally Ride Science</div>
    • <img class="photo" src="http://example.com/sk.jpg"/>
    • <a class="url" href="http://sally.example.com">w</a>,
    • <a class="email" href="mailto:sally@example.com">e</a>
    • <div class="tel">+1.818.555.1212</div>
    • <div class="adr">
      • <div class="street-address">123 Main st.</div>
      • <span class="locality">Los Angeles</span>,
      • <abbr class="region" title="California">CA</abbr>,
      • <span class="postal-code">91316</span>
      • <div class="country-name">U.S.A</div></div>
    • <time class="bday">1951年05月26日</time> birthday
    • <div class="category">physicist</div>
    • <div class="note">1st American woman in space.</div>
  • </div>
See the full list of properties for the complete list.

Status

hCard 1.0 is a microformats.org specification. Public discussion on hCard takes place on hcard-feedback, the #microformats irc channel on irc.freenode.net, and microformats-discuss mailing list.

Errata and Updates

Known errors and issues in this specification are corrected in resolved and closed issues. Please check there before reporting issues.

The hCard 1.0.1 update is currently under development and incorporates known errata corrections as well as the value-class-pattern.

Background

The vCard standard (RFC2426), has been broadly interoperably implemented (e.g. Apple's "Address Book" application built into MacOSX).

In addition, many bloggers identify themselves by name and discuss their friends and family. With just a tad bit of structure, bloggers can discuss people in their blog(s) in such a way that spiders and other aggregators can retrieve this information, automatically convert them to vCards, and use them in any vCard application or service.

This specification introduces the hCard format, which uses a 1:1 representation of the properties and values of the aforementioned vCard standard, in semantic HTML. Bloggers can both embed hCards directly in their web pages, and style them with CSS to make them appear as desired. In addition, hCard enables applications to retrieve information directly from web pages without having to reference a separate file.

Use the hCard creator and copy the HTML code it generates to your blog or website to publish your contact info.

Conformance

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Format

In General

The vCard standard (RFC2426) forms the basis of hCard.

The basic format of hCard is to use vCard object/property names in lower-case for class names, and to map the nesting of vCard objects directly into nested HTML elements.

Root Class Name

The root class name for an hCard is "vcard". An element with a class name of "vcard" is itself called an hCard.

Properties and Sub-properties

The properties of an hCard are represented by elements inside the hCard. Elements with class names of the listed properties represent the values of those properties. Some properties have sub-properties, and those are represented by elements inside the elements for properties.

Property List

hCard properties (sub-properties in parentheses like this)

Required:

  • fn
  • n1
    • family-name
    • given-name
    • additional-name
    • honorific-prefix
    • honorific-suffix

Optional:

  • adr
    • post-office-box
    • extended-address
    • street-address
    • locality
    • region
    • postal-code
    • country-name
    • type
    • value
  • agent
  • bday
  • category
  • class
  • email (type, value)
  • geo
    • latitude
    • longitude
  • key
  • label
  • logo
  • mailer
  • nickname
  • note
  • org (organization-name, organization-unit)
  • photo
  • rev
  • role
  • sort-string
  • sound
  • tel2 (type, value)
  • title
  • tz3
  • uid
  • url

Property Notes

1. ^ : The 'n' property is OPTIONAL if any implied 'n' optimization rules are in effect.
2. ^ : tel - Authors MAY follow the E.123 standard for writing values of telephone numbers. Letter values (e.g. +1-555-FORMATS) MUST be converted to numbers. Use an abbr to display letters and provide a numerical value simultaneously, e.g. <abbr title="+15553676287">+1-555-FORMATS</abbr>.
3. ^ : tz - timezones are indicated with the timezone offset, e.g. PST (<span class="tz">-08:00</span>).

Singular vs. Plural Properties

Singular properties: 'fn', 'n', 'bday', 'tz', 'geo', 'sort-string', 'uid', 'class', 'rev'. For properties which are singular, the first descendant element with that class SHOULD take effect, any others being ignored.

All other properties MAY be plural. Each class instance of such properties creates a new instance of that property.

Human vs. Machine readable

The human visible text contents of an element for a property represents the value of that property, with a few exceptions:

If an <abbr> element is used for a property, then the 'title' attribute (if present) of the <abbr> element is the value of the property, instead of the contents of the element, which instead provide a more human presentable version of the value.

If an <a> element is used for one or more properties, it MUST be treated as follows:

  1. For the 'photo' property and any other property that takes a URL as its value, the href="..." attribute provides the property value.
  2. For other properties, the element's content is the value of the property.

If an <img> element is used for one or more properties, it MUST be treated as follows:

  1. For the 'photo' property and any other property that takes a URL as its value, the src="..." attribute provides the property value.
  2. For other properties, the <img> element's 'alt' attribute is the value of the property.

If an <object> element is used for one or more properties, it MUST be treated as follows:

  1. For the 'photo' property and any other property that takes a URL as its value, the data="..." attribute provides the property value.
  2. For other properties, the element's content is the value of the property.

Value excerpting

Sometimes only part of an element which is the equivalent for a property is used for the value of the property. This typically occurs when a property has a subtype, like 'tel'. For this purpose, the special class name "value" is used to excerpt out the subset of the element that is the value of the property. E.g. here is an hCard fragment for marking up a home phone number:

vCard:

TEL;TYPE=HOME:+1.415.555.1212

hCard:

<span class="tel">
 <span class="type">home</span>:
 <span class="value">+1.415.555.1212</span>
</span>

This hCard fragment could be displayed as:

home: +1.415.555.1212

You may want to customize/localize the visible punctuation and not want to include it in what machines see. Use multiple class="value" elements which are then concatenated. E.g.

<span class="tel">
 <span class="type">home</span>:
 <span class="value">+1</span>.<span class="value">415</span>.<span class="value">555</span>.<span class="value">1212</span></span>
</span>

No change in display, but the parsed hCard property value then becomes in vCard:

vCard:

TEL;TYPE=HOME:+14155551212


Property Exceptions

vCard has several properties which either do not make sense on, or are already implied within the context of a web page. This section explains what to (not) do with them.

  1. vCard's NAME, PROFILE, SOURCE, PRODID, VERSION properties are defined in Sections 2.1.2, 2.1.3, 2.1.4, 3.6.3, 3.6.9 of RFC2426. Content publishers MUST NOT use these properties in their hCards, and as such, hCard consumers/parsers MUST IGNORE these properties if they are found within an hCard. Instead. hCard to vCard converters SHOULD use the title of the page where the hCard is found (e.g. the <title> element in HTML documents) to construct the NAME property, MAY output a PROFILE value of "VCARD" per RFC2426, SHOULD use the URL of the page where the hCard is found to construct the SOURCE property (e.g. perhaps as a parameter to a URL/service that converts hCards to vCards), for an output vCard stream (e.g. a .vcf file). Only services/applications that output actual vCards should write the PRODID property, with the product identifier for said service/application. Similarly, only such services/applications should write the VERSION property, with the value "3.0" (without quotes) per RFC2426 Section 3.6.9.

Organization Contact Info

If the "FN" and "ORG" (organization) properties have the exact same value (typically because they are set on the same element, e.g. class="fn org"), then the hCard represents contact information for a company, organization or place and SHOULD be treated as such. In this case the author also MUST NOT set the "N" property, or set it (and any sub-properties) explicitly to the empty string "". Thus parsers SHOULD handle the missing "N" property, in this case by implying empty values for all the "N" sub-properties.

Implied "N" Optimization

Although vCard requires that the "N" property be present, the authors of the vCard specification (RFC2426) themselves do not include "N" properties in their vCards near the end of the spec (p.38). This apparent contradiction can be resolved by simply allowing the "FN" property to imply "N" property values in typical cases provided in the spec. We do so explicitly in hCard.

If "FN" and "ORG" are not the same (see previous section), and the value of the "FN" property is exactly two words (separated by whitespace), and there is no explicit "N" property, then the "N" property is inferred from the "FN" property. For "FN"s with either one word see below, and for three or more, the author MUST explicitly markup the "N", except for the organization contact info case, see above for that.

  1. The content of "FN" is broken into two "words" separated by whitespace.
  2. The first word of the "FN" is interpreted as the "given-name" for the "N" property.
  3. The second/last word of the "FN" is interpreted as the "family-name" for the "N" property.
  4. Exception: If the first word ends in a "," comma, then the first word (minus the comma at the end) is interpreted as the "family-name" and the second word is interpreted as the "given-name".

This allows simplification in the typical case of people stating:

  • given-name (space) family-name
  • family-name (comma) given-name

Implied "nickname" Optimization

Due to the prevalence of the use of nicknames/handles/usernames in actual content published on the Web (e.g. authors of reviews), hCard also has an implied "nickname" optimization to handle this.

Similar to the implied "n" optimization, if "FN" and "ORG" are not the same, and the value of the "FN" property is exactly one word, and there is no explicit "N" property, then:

  1. The content of the "FN" MUST be treated as a "nickname" property value.
  2. Parsers SHOULD handle the missing "N" property by implying empty values for all the "N" sub-properties.

Though parsers MUST follow the implied nickname optimization, publishers SHOULD explicitly indicate the "nickname" even in this case, e.g.:

<span class="vcard">
 <span class="fn nickname">daveman692</span>
</span>

The hCard MAY have additional explicit "nickname" property values in addition to the implied nickname.

Implied "organization-name" Optimization

The "ORG" property has two subproperties, organization-name and organization-unit. Very often authors only publish the organization-name. Thus if an "ORG" property has no "organization-name" inside it, then its entire contents MUST be treated as the "organization-name".

Tags as Categories

Categories in hCard MAY be represented by tags with rel-tag. When a category property is a rel-tag, the tag (as defined by rel-tag) is used for that category.

type subproperty values

The 'type' subproperty in particular takes different values depending on which property it is a subproperty of. These 'type' subproperty values are case-INSENSITIVE, meaning "Home" is the same as "home", as well as multivalued, e.g. a tel can be home and preferred:

vCard:

TEL;TYPE=HOME,PREF:+1.415.555.1212

hCard:

<span class="tel"><span class="type">Home</span> (<span class="type">pref</span>erred):
 <span class="value">+1.415.555.1212</span>
</span>

This could be displayed as:

Home (preferred): +1.415.555.1212

type with unspecified value

When the type of a property is specified, and there is no explicit value specified, then everything in the property except for the type is considered the value of the property. E.g.

<span class="tel"><span class="type">Home</span> +1.415.555.1212</span>

is equivalent to:

<span class="tel"><span class="type">Home</span><span class="value"> +1.415.555.1212</span></span>

And thus the type is "home" and the value is "+1.415.555.1212".

adr tel email types

The following lists are informative. See RFC2426 sections 3.2.1 ADR, 3.3.1 TEL, and 3.3.2 EMAIL respectively for normative type values. They are repeated here for convenience. Default type subproperty value(s) is(are) first in each list and indicated in ALL CAPS. types may be multivalued.

  • adr type: INTL, POSTAL, PARCEL, WORK, dom, home, pref
  • tel type: VOICE, home, msg, work, pref, fax, cell, video, pager, bbs, modem, car, isdn, pcs
  • email type: INTERNET, x400, pref

Profile

The hCard XMDP profile is at http://microformats.org/profile/hcard

Content that uses hCard SHOULD reference this profile, e.g.

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

or

This content uses <a rel="profile" href="http://microformats.org/profile/hcard">hCard</a>.

or

<head profile="http://microformats.org/profile/hcard">

(profile attribute is deprecated in HTML5) Content may combine the above methods as well.

Parsing Details

See hCard parsing.

Examples

This section is informative.

Sample vCard

Here is a sample vCard:

BEGIN:VCARD
VERSION:3.0
N:Çelik;Tantek
FN:Tantek Çelik
URL:https://tantek.com/
END:VCARD

and an equivalent in hCard with various elements optimized appropriately. See hCard Example 1 for the derivation.

<div class="vcard">
 <a class="url fn" href="https://tantek.com/">Tantek Çelik</a>
</div>

This hCard might be displayed as:

Note: The version information is unnecessary in hCard markup directly since the version will be defined by the profile of hCard that is used/referred to in the 'profile' attribute of the <head> element.

Live example

Here is Commercenet's contact details, as a live hCard which will be detected, on this page, by microformat parsing tools:

CommerceNet
http://www.commerce.net/
Work:
169 University Avenue

Palo Alto, CA  94301

USA
Work +1-650-289-4040
Fax +1-650-289-4041
Email info@commerce.net

The mark-up, emboldening omitted for clarity, with the following semantic improvements:

  • abbr to expand abbreviations
  • hyperlinking the org name with the url
<div class="vcard">
 <a class="fn org url" href="http://www.commerce.net/">CommerceNet</a>
 <div class="adr">
 <span class="type">Work</span>:
 <div class="street-address">169 University Avenue</div>
 <span class="locality">Palo Alto</span>, 
 <abbr class="region" title="California">CA</abbr>&nbsp;&nbsp;
 <span class="postal-code">94301</span>
 <div class="country-name">USA</div>
 </div>
 <div class="tel">
 <span class="type">Work</span> +1-650-289-4040
 </div>
 <div class="tel">
 <span class="type">Fax</span> +1-650-289-4041
 </div>
 <div>Email: 
 <span class="email">info@commerce.net</span>
 </div>
</div>

More Examples

See hCard examples for more examples, including all examples from vCard RFC2426 converted into hCard.

Examples in the wild

This section is informative. The number of hCard examples in the wild has expanded far beyond the capacity of being kept inline in this specification. They have been moved to a separate page.

See hCard Examples in the wild.

Implementations

This section is informative. The number of hCard implementations has also expanded beyond the capacity of keeping them inline. They have been moved to a separate page.

See hCard Implementations.

Articles

This section is informative. For further reading on hCard see hcard-articles.

Buttons

You can use these buttons on pages with hCards. See buttons#hCard for any recent additions.

Copyright

Per the public domain release on the authors' user pages (Tantek Çelik, Brian Suda) this specification is released into the public domain.

Public Domain Contribution Requirement. Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding the public domain release template to their user page per the Voluntary Public Domain Declarations instructions. Unreleased contributions may be reverted/removed.

Patents

This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

References

Normative References

Informative References

This section is informative.

Specifications That Use hCard

Similar Work

This section is informative.

Inspiration and Acknowledgments

This section is informative. Thanks to: my good friend Vadim who introduced me to vCard many years ago, and if I'd only paid more attention then, perhaps I could have helped a lot of people avoid wasting a lot of time reinventing various standards wheels.

Notes on derivation from vCard

This section is informative.

More Semantic Equivalents

For some properties there are HTML elements which better match and convey their semantics. The following properties SHOULD be encoded with the following HTML:

  • URL in vCard becomes <a class="url" href="...">...</a> inside the element with class="vcard" in hCard.
  • Similarly, EMAIL in vCard becomes <a class="email" href="mailto:...">...</a>
  • PHOTO in vCard becomes <img class="photo" src="..." alt="Photo of ..." /> or <object class="photo" data="..." type="...">Photo of ...</object>
  • UID in vCard simply becomes another semantic applied to a specific URL (or EMAIL) for an hCard.

Singular and Plural derivations

The lists of singular and plural properties have been derived by analyzing the semantics of the individual properties in vCard RFC2426 and determining logically that they MUST be singular per their semantics. See hcard-singular-properties for explanations.

Plural Properties Singularized

Since plural property names become their singular equivalents, even if the original plural property permitted only a single value with multiple components, those multiple components are represented each with their own singularly named property and the the property is effectively multivalued and subject to the above treatment of multivalued properties.

Related Pages

The hCard 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.

Translations

The English version of this specification is the only normative version. Read the hCard specification in additional languages:

Help translate hCard into more languages.

Retrieved from "http://microformats.org/wiki/index.php?title=hcard&oldid=70233"