Internet-Draft | jscontact-vcard | October 2020 |
Loffredo & Stepanek | Expires 14 April 2021 | [Page] |
This document provides informational guidance for converting the contact card defined by JSContact specification, namely JSCard, from and to vCard.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 14 April 2021.¶
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The JSContact specification [draft-ietf-jmap-jscontact] has been defined to represent contact card information as a more efficient alternative to vCard [RFC6350] and its JSON-based version named jCard [RFC7095].¶
While new applications might adopt JSContact as their main format to exchange contact card data, they are likely to interoperate with services and clients that just support vCard/jCard. Similarly, existing contact data providers and consumers already using vCard/jCard might want to represent their data also according to the JSContact specification.¶
To facilitate this use cases, this document provides informational guidance about how to convert the card defined in JSContact, namely JSCard, from and to vCard.¶
JSContact and vCard have a lot of semantics in common, however some differences must be outlined:¶
The JSContact data model defines some contact information that doesn't have a direct mapping with vCard elements. In particular, unlike vCard, JSContact distinguishes between a single contact card, named JSCard, and a group of contact cards, named JSCardGroup.¶
The vCard specification includes some features (like parameters) that have been formally removed from JSCard due to a complete refactoring of vCard content. Anyway, the vCard parameters may appear as JSCard features.¶
Some vCard elements represented individually have been mapped onto members of JSCard objects.¶
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 [RFC2119].¶
This section contains the mapping between vCard and JSCard. The vCard properties are grouped according to the categories defined by [RFC6350].¶
Where it is needed, the JCardGroup is taken into account.¶
In the following of this document, the vCard features, namely properties and parameters, are written in uppercase while the JSCard features are written in camel case.¶
The BEGIN and END properties don't have a direct match with a JSCard feature.¶
A SOURCE element is represented as a "Resource" object in the "online" array (Figure 1) whose "type" member is set to "uri" and "labels" map contains the entry <"source",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
The KIND element is mapped onto the "kind" member (Figure 2). Allowed values are those, except "group", described in section 6.1.4 of [RFC6350] and extended with the values declared in [RFC6473] and [RFC6869]. A group of cards is represented through a JSCardGroup.¶
The XML property doesn't have a direct match with a JSCard feature.¶
All the FN elements are globally represented through the "fullName" member. The presence of more than one name is implicitly associated with the full name translations in various languages regardless of the presence of the ALTID parameter. Each translation corresponds to a different entry of the "localizations" map (Figure 3).¶
Both the N and NICKNAME elements are converted into equivalent items of the "name" array (Figure 3):¶
the N components are transformed into related "NameComponent" objects as presented in Table 1. Name components SHOULD be ordered such that their values joined by whitespace produce a valid full name of this entity;¶
N component | "type" value |
---|---|
Honorific Prefixes | prefix |
Given Names | personal |
Family Names | surname |
Additional Names | additional |
Honorific Suffixes | suffix |
A PHOTO element is represented as a "Resource" object in the "online" array (Figure 4) whose "type" member is set to "uri" and "labels" map contains the entry <"photo",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
The BDAY and ANNIVERSARY elements and the extensions BIRTHPLACE, DEATHDATE, DEATHPLACE described in [RFC6350] are represented as "Anniversary" objects included in the "anniversaries" array (Figure 5):¶
BDAY and BIRTHPLACE are mapped onto "date" and "place" where "type" is set to "birth";¶
DEATHDATE and DEATHPLACE are mapped onto "date" and "place" where "type" is set to "death";¶
Both birth and death places are represented as instances of the "Address" object. BIRTHPLACE and DEATHPLACE that are represented as geo URIs are converted into "Address" instances including only the "coordinates" member. If the URI value is not a geo URI, the place is ignored. The LANGUAGE parameter values of both BIRTHPLACE and DEATHPLACE elements are represented as corresponding entries of the "fullAddress.localizations" map.¶
TBD¶
An ADR element is represented as an "Address" object in the "addresses" array (Figure 6).¶
The ADR components are transformed into the "Address" members as presented in Table 2.¶
ADR component | Address member |
---|---|
p.o. box | postOfficeBox |
extended address | extension |
street address | street |
locality | locality |
region | region |
postal code | postcode |
country name | country |
The LABEL parameter is converted into the "fullAddress" member.¶
The PREF parameter is converted into the "isPreferred" member.¶
The GEO parameter is converted into the "coordinates" member.¶
The TZ parameter is converted into by the "timeZone" member.¶
The TYPE parameter is converted into the "context" member. The "home" value is replaced with the "private" value.¶
The LANGUAGE parameter values are represented as different entries of the "fullAddress.localizations" map.¶
The CC parameter defined by [RFC8605] is converted into the "countryCode" member.¶
A TEL element is represented as a "Resource" object in the "phones" array (Figure 7). The vCard "type-param-tel" values are mapped onto the "type" member values. Those vCard "type-param-tel" values that don't have a counterpart among the "type" member values are represented as entry keys of the "labels" map with the corresponding entry value set to true. The "type-param" values are are mapped onto the "context" member values. The "home" value is replaced with the "private" value.¶
The PREF parameter is mapped onto the "isPreferred" member.¶
An EMAIL element is represented as a "Resource" object in the "emails" array (Figure 8). The vCard "type-param" values are mapped onto the "context" member values. The "home" value is replaced with the "private" value.¶
The PREF parameter is mapped onto the "isPreferred" member.¶
An IMPP element is represented as a "Resource" object in the "online" array (Figure 9) whose "type" member is set to "username" and "labels" map contains the entry <"XMPP",true>.¶
In case of a contact card related to an acconunt on another online service, the entry key SHOULD be the canonical service name, including capitalisation (e.g. "Twitter", "Facebook", "Skype", "GitHub")¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
A LANG element is represented through the "preferredContactLanguages" map (Figure 10): an entry for each language that may be used for contacting the entity associated with the JSCard. The entry keys correspond to the language tags, the corresponding entry values are arrays of "ContactLanguage" objects.¶
The TYPE and PREF parameters are mapped onto the "ContactLanguage" members "type" and "preference" respectively.¶
If both PREF and TYPE parameters are missing, the array of "ContactLanguage" objects MUST be empty.¶
The GEO and TZ elements are not directly mapped into equivalent topmost JSCard members because the same information is represented through equivalent "Address" members.¶
The ALTID parameter is used for associating both GEO and TZ elements with the related address information. When the ALTID parameter is missing, the element should be associated with the first contact address.¶
A TITLE element is mapped onto a "LocalizedString" object included in the "jobTitle" array (Figure 11).¶
The ALTID parameter is used for for associating the language-dependent alternatives with a given element.¶
The LANGUAGE parameter values are represented as corresponding entries of the "localizations" map.¶
A ROLE element is mapped onto a "LocalizedString" object included in the "role" array (Figure 12).¶
The ALTID parameter is used for for associating the language-dependent alternatives with a given element.¶
The LANGUAGE parameter values are represented as corresponding entries of the "localizations" map.¶
A LOGO element is represented as a "Resource" object in the "online" array (Figure 13) whose "type" member is set to "uri" and "labels" map contains the entry <"logo",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
An ORG element is mapped onto a "LocalizedString" object included in the "organization" array (Figure 14). The organization name includes the organizational units if any.¶
The ALTID parameter is used for for associating the language-dependent alternatives with a given element.¶
The LANGUAGE parameter values are represented as corresponding entries of the "localizations" map.¶
According to the JSContact specification, a group of contact cards is represented through a JSCardGroup (Figure 15). The contact cards composing the group are included in the "cards" array. Therefore, the MEMBER element doesn't have a direct match with a JSCard feature.¶
All the RELATED elements are globally converted into the "relatedTo" map (Figure 16): an entry for each entity the entity described by the JSCard is associated with. The map keys are the "uid" values of the associated cards.¶
Each map value is a "Relation" object including only the "relation" member represented as a set of relation types described in section 6.6.6 of [RFC6350].¶
If the relation type is unspecified, the "relation" is empty.¶
A CONTACT-URI element defined by [RFC8605] is represented as a "Resource" object of the "online" array (Figure 17) whose "type" member is set to "uri" and "labels" map contains the entry <"contact-uri",true>.¶
The PREF parameter is mapped onto the "isPreferred" member.¶
An EXPERTISE element defined by [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" array (Figure 18). The "type" member is set to "expertise".¶
The LEVEL parameter is mapped onto the "level" member with following mapping:¶
The INDEX parameter is represented as the index of the expertise among the declared expertises.¶
An HOBBY element defined by [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" array (Figure 19). The "type" member is set to "hobby".¶
The LEVEL parameter is mapped onto the "level" member with a direct mapping.¶
The INDEX parameter is represented as the index of the hobby among the declared hobbies.¶
An INTEREST element defined by [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" array (Figure 20). The "type" member is set to "interest".¶
The LEVEL parameter is mapped onto the "level" member with a direct mapping.¶
The INDEX parameter is represented as the index of the interest among the declared interests.¶
An ORG-DIRECTORY element is represented as a "Resource" object in the "online" array (Figure 21) whose "type" member is set to "uri" and "labels" map contains the entry <"org-directory",true>.¶
The PREF parameter is mapped onto the "isPreferred" member.¶
The INDEX parameter is represented as the index of the directory among the online resources with the "org-directory" key in the "labels" map.¶
A CATEGORIES element is converted into an object in the "categories" array (Figure 22).¶
A NOTE element is mapped onto a "LocalizedString" object included in the "notes" array (Figure 23).¶
The ALTID parameter is used for associating the language-dependent alternatives with a given element.¶
The LANGUAGE parameter values are represented as corresponding entries of the "localizations" map.¶
The PRODID element is converted into the "prodId" member (Figure 24).¶
The REV element is transformed into the "updated" member (Figure 25).¶
A SOUND element is represented as a "Resource" object in the "online" array (Figure 26) whose "type" member is set to "uri" and "labels" map contains the entry <"sound",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
The UID element corresponds to the "uid" member (Figure 27).¶
TBD¶
An URL element is represented as a "Resource" object in the "online" array (Figure 28) whose "type" member is set to "uri" and "labels" map contains the entry <"url",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
The VERSION property doesn't have a direct match with a JSCard feature.¶
A KEY element is represented as a "Resource" object in the "online" array (Figure 29) whose "type" member is set to "uri" and "labels" map contains the entry <"key",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
A FBURL element is represented as a "Resource" object of the "online" array (Figure 30) whose "type" member is set to "uri" and "labels" map contains the entry <"fburl",true>.¶
The PREF and MEDIATYPE parameters are mapped ontoy the "isPreferred" and "mediaType" members respectively.¶
A CALADRURI element is represented as a "Resource" object of the "online" array (Figure 31) whose "type" member is set to "uri" and "labels" map contains the entry <"caladruri",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
A CALURI element is represented as a "Resource" object of the "online" array (Figure 32) whose "type" member is set to "uri" and "labels" map contains the entry <"caluri",true>.¶
The PREF and MEDIATYPE parameters are mapped onto the "isPreferred" and "mediaType" members respectively.¶
As described in section 5.7 of [RFC6350], the media type of a resource can be identified by its URI. For example, "image/gif" can be derived from the ".gif" extension of a GIF image URI. JSContact producers MAY provide the media type information even when it is not specified in the vCard.¶
As specified in section 6.5.1 of [RFC6350], the time zone information can be represented in three ways: as a time zone name, as an UTC offset or as an URI.¶
The time zone name is directly matched by the "timeZone" member in JSContact.¶
An UTC offset MUST be converted into the related "Etc/GMT" time zone (e.g. the value "-0500" converts to "Etc/GMT+5"). If the UTC offset value contains minutes information, it MUST be mapped to map it to the zone "Etc/GMT<sign><hour>:<minute>".¶
If an extended property is a resource, JSCard already allows to represent it by setting the "type" member to "other" and specifying a value for the "labels" map.¶
Any other property supporting a custom feature MAY be added and its name MUST be prefixed with a specific domain name to avoid conflict, e.g. "example.com/customprop".¶
Any vCard property that doesn't have a direct counterpart in JSContact is treated as an extended property whose name is prefixed by "ietf.org/rfc6350/".¶
The resulting name MUST be in lowercase.¶
While converting a vCard into a JSCard, only the topmost "uid" member is required.¶
The "preferredContactMethod" member doesn't match any vCard element.¶
This document has no actions for IANA.¶
NOTE: Please remove this section and the reference to RFC 7942 prior to publication as an RFC.¶
This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist.¶
According to RFC 7942, "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".¶
This document doesn't present any security consideration.¶