The currently defined Person Construct is rather weak at describing a person or “contact information” in general. There may be situations where contact information such as phone numbers, street address, alternate e-mails addresses may be of value. For example, a feed publisher may wish to put a customer service phone number or company mailing address in the person construct.
(I do apologise that the examples can only be correctly read in the "edit" mode of this proposal. I have tried without success to insert the examples as literal text).
It is clear that some mechanism is needed to convey information about who created a particular feed or entry. It is also desirable to improve on relating content to a person or institution that created the content. It is desirable to use a mechanism that has already been well established and is in widespread use to facilitate acceptance.
There are two different proposals to include a vCard as information as the person construct: 1. Use a solution similar to how SyncML includes vCards (with some fixes). 2. Use an XML vCard format.
Although there are other options (such as FOAF), the vCard has a well-established use in portable devices and in e-mail.
For the current Atom syntax spec, the Person name, URI and e-mail map to the vCard FN (formal name), UID and EMAIL types. There is much greater flexibility in describing (for example) multiple e-mail addresses for various purposes. To enforce the same required elements as Person, it could be stated “the vCard MUST include an FN and an UID”.
For the first proposal, we reference the use of vCard within the SyncML specification.Any SyncML server that supports a contact database must support the vCard 2.1 and the vCard 3.0 (see RFC 2425 and RFC 2426) format. The following example is from the SyncML spec:
<syncml proto="irmc" version="1.2"> <hdr> <source>http://calendar.host.com </source> <target> <sid>1234567890ABCDEF</sid> <devid>+1-617-555-8787<devid> <res>irmc://telecom/pb1</res> </target> </hdr> <body> <synchronize> <add> <res>1</res> <data> BEGIN:VCARD VERSION:3.0 FN:John Smith N:Smith;John ORG:FooBar Industries TEL;TYPE=WORK:+1-617-555-1234 TEL;TYPE=WORK,FAX:+1-617-555-4444 EMAIL;TYPE=INTERNET:email@example.com END:VCARD </data> </add> </synchronize> </body> </syncml>
Although the vCard is represented using a tabular text structure, this structure is not well suited for XML parsers. To parse this, the XML parser would need to recognize the <data> element and then switch to a tokenizing parser to read the vCard fields.
To remedy this problem, it is proposed that the vCard be base64 encoded. The XML parser can still recognize the <person> element and then extract the base64 encoded text as a single string. The base64 encoded vCard can then be handed to a higher level of processing that base64 decodes and then parses the result as a tokenized string. The Atom spec enhancement is:
<person>base64(Text form of vCard)</person>A second proposal is to use the RDF vCard or some variant http://www.w3.org/TR/2001/NOTE-vcard-rdf-20010222/. An example from the RDf vCard spec for XML encoding a vCard without RDF is:
<?xml version="1.0"?> <myns:myElement xmlns:myns = "http://www.qqqfoo.com/my-namespace#" xmlns:vCard = "http://www.w3.org/2001/vcard-rdf/3.0#" > <vCard:FN> Corky Crystal </vCard:FN> <vCard:N> <vCard:Family> Crystal </vCard:Family> <vCard:Given> Corky </vCard:Given> </vCard:N> <vCard:EMAIL vcard:TYPE="http://www.w3.org/2001/vcard-rdf/3.0#internet"> firstname.lastname@example.org </vCard:EMAIL> <vCard:ORG> <vCard:Orgname> qqqfoo.com Pty Ltd </vCard:Orgname> <vCard:Orgunit> Commercialisation Division </vCard:Orgunit> <vCard:Orgunit> Engineering Office </vCard:Orgunit> <vCard:Orgunit> Java Unit </vCard:Orgunit> </vCard:ORG> </myns:myElement >
This solution would be friendlier to XML parsers but may require revisiting the RDF issue again.
A third proposal is to use hCard, which IMHO is both friendly to XML parsers (already proven with X2V), more compact than the above, and avoids the RDF issue because a) RDF is unnecessary, and b) others have demonstrated that if you really need/want RDF, you can transform a microformat like hCard into whatever other vocabulary you prefer.
<?xml version="1.0"?> <myns:myElement xmlns:myns = "http://www.qqqfoo.com/my-namespace#"> <div xmlns="http://www.w3.org/1999/xhtml" class="vcard"> <a class="email fn n" href="mailto:email@example.com"> <span class="given-name">Corky</span> <span class="family-name">Crystal</span> </a> <div class="org"> <div class="organization-name">qqqfoo.com Pty Ltd</div> <div class="organization-unit">Commercialisation Division</div> <div class="organization-unit">Engineering Office</div> <div class="organization-unit">Java Unit</div> </div> </div> </myns:myElement >
Note the advantages of hCard over the previous example.
Direct 1:1 mapping of vCard property names (no strange/arbitrary abbreviations or capitalizations like ORG vs. Orgname and Orgunit).
Fewer elements (more efficient).
No redundant information, i.e. the name information isn't duplicated (overlapping markup reuses the given-name and family-name to seamlessly construct the fn).
Easy to present.
OSS implementations already exist to transform hCard into vCard (e.g. see X2V) to interoperate with numerous existing vCard applications and services.
OSS implementations already exist to easily author hCards (e.g. see hCard creator).