Internet-Draft | jscontact-vcard | December 2021 |
Loffredo & Stepanek | Expires 4 June 2022 | [Page] |
This document defines how to convert contact information as defined in the JSContact [draft-ietf-jmap-jscontact] specification 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 4 June 2022.¶
Copyright (c) 2021 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised 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, this document defines how to convert contact information as defined in the JSContact [draft-ietf-jmap-jscontact] specification 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 properties. In particular, unlike vCard, JSContact distinguishes between a single contact card, named Card, and a group of contact cards, named CardGroup.¶
While translating vCard properties to JSContact, any vCard property that doesn't have a direct counterpart in JSContact MUST be converted into a property whose name is prefixed by "ietf.org/<RFC defining the extension>/".¶
Any custom extension MAY be added and its name MUST be prefixed with a specific domain name to avoid conflict, e.g. "example.com/customprop".¶
Similarly, the reversed rules are applied while translating JSContact properties to vCard.¶
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].¶
In the following of this document, the vCard features, namely properties and parameters, are written in uppercase while the Card/CardGroup features are written in camel case wrapped in double quotes.¶
This section contains the translation rules from vCard to Card/CardGroup. The vCard properties are grouped according to the categories as defined in [RFC6350].¶
If a vCard represents a group of contacts, those vCard properties which don't have a counterpart in CardGroup are converted into related properties of the "CardGroup.card" object. In this case, the "uid" member of both the resulting CardGroup object and its "card" member MUST have the same value.¶
The following mapping rules apply to parameters that are common to most of the vCard properties:¶
The generic values of the TYPE parameter are mapped to the values of the "Context" type as defined in Section 1.5.1 of [draft-ietf-jmap-jscontact]. The "home" value corresponds to the "private" key. The mapping of those specific TYPE values used in the TEL and RELATED properties are defined in Section 2.6.1 and Section 2.8.5.¶
The PREF parameter is mapped to the "pref" property.¶
The MEDIATYPE parameter is mapped to the "mediaType" property. 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.¶
The ALTID and LANGUAGE parameters are used in combination for associating the language-dependent alternatives with a given property. Such alternatives are represented by using the "localizations" map: the "localizations" key is the LANGUAGE value, the key of the related PatchObject map is the JSON pointer of the JSContact member matching the vCard property while the value is the JSContact member itself.¶
The rules to generate a map key of type Id as well as a value for "created", "language" and "preferredContactMethod" properties are out of the scope of this document.¶
The BEGIN and END properties don't have a direct match with a JSContact feature.¶
A SOURCE property is represented as an entry of the "online" map (Figure 1). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "source" and the "resource" member is the SOURCE value.¶
The PREF and MEDIATYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The KIND property is mapped to the "kind" member (Figure 2). Allowed values are those described in Section 6.1.4 of [RFC6350] and extended with the values declared in [RFC6473] and [RFC6869]. The value "group" is reserved for a CardGroup instance.¶
The XML property doesn't have a direct match with a JSContact feature.¶
All the FN instances are represented through the "fullName" member (Figure 3). The presence of multiple instances is implicitly associated with the full name translations in various languages regardless of the presence of the ALTID parameter. Each translation is mapped according to the rules as defined in (Section 2.1).¶
If the vCard represents a group of contacts, implementers MAY convert the FN property into either "CardGroup.card.fullName" or "CardGroup.name" or both properties.¶
The N instances are converted into equivalent items of the "components" array of the "name" property (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.¶
Each NICKNAME instance is mapped to an item of "nickNames" array.¶
N component | "type" value |
---|---|
Honorific Prefixes | prefix |
Given Names | personal |
Family Names | surname |
Additional Names | additional |
Honorific Suffixes | suffix |
A PHOTO property is represented as an entry of the "photos" map (Figure 4). The entry value is a "File" object whose "href" member is the PHOTO value.¶
The PREF and MEDIATYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The BDAY and ANNIVERSARY properties and the extensions BIRTHPLACE, DEATHDATE, DEATHPLACE described in [RFC6350] are represented as "Anniversary" objects included in the "anniversaries" map (Figure 5):¶
BDAY and BIRTHPLACE are mapped to "date" and "place" where "type" is set to "birth";¶
DEATHDATE and DEATHPLACE are mapped to "date" and "place" where "type" is set to "death";¶
Both birth and death places are represented as instances of the "Address" object.¶
The BIRTHPLACE and DEATHPLACE properties 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 ALTID and LANGUAGE parameters of both BIRTHPLACE and DEATHPLACE properties are mapped according to the rules as defined in (Section 2.1).¶
The GENDER property doesn't have a direct match with a JSContact feature.¶
An ADR property is represented as an entry of the "addresses" map (Figure 6). The entry value is an "Address" object.¶
The ADR components are transformed into the "Address" members as presented in Table 2 and Table 3.¶
The "street address" and "extended address" ADR components MAY be converted into either a single StreetComponent item or a combination of StreetComponent items.¶
ADR component | Address member |
---|---|
locality | locality |
region | region |
postal code | postcode |
country name | country |
ADR component | Single StreetComponent item | Combination of StreetComponent items |
---|---|---|
post office box | postOfficeBox | |
extended address | extension | extension, building, floor, room, apartment |
street address | name | name, number, direction |
The LABEL parameter is converted into the "fullAddress" member.¶
The GEO parameter is converted into the "coordinates" member.¶
The TZ parameter is converted into the "timeZone" member.¶
The CC parameter as defined in [RFC8605] is converted into the "countryCode" member.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The ALTID and LANGUAGE parameters are mapped according to the rules as defined in (Section 2.1). Each possible language-dependent alternative is represented as an entry of the PatchObject map where the key references the "fullAddress" member.¶
A TEL property is represented as an entry of the "phones" map (Figure 7). The entry value is a "Phone" object. The TEL-specific values of the TYPE parameter are mapped to the "features" map keys. The values that don't match a key are represented as comma-separated values of the "label" member. The "phone" member is set to the TEL value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
An EMAIL property is represented as an entry of the "emails" map (Figure 8). The entry value is an "EmailAddress" object. The "email" member is set to the EMAIL value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
An IMPP property is represented as an entry of the "online" map (Figure 9). The entry value is a "Resource" object whose "type" member is set to "username", the "label" member is set to "XMPP" and the "resource" member is the IMPP value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
A LANG property is represented as an entry of the "preferredContactLanguages" map (Figure 10). The entry keys correspond to the language tags, the corresponding entry values are arrays of "ContactLanguage" objects.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
If both PREF and TYPE parameters are missing, the array of "ContactLanguage" objects MUST be empty.¶
The GEO and TZ properties are not directly mapped to topmost Card members because the same information is represented through equivalent "Address" members.¶
The ALTID parameter is used for associating both GEO and TZ properties with the related address information. When the ALTID parameter is missing, the matched members SHOULD be included in the first "Address" object.¶
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 a UTC offset or as a URI.¶
If the TZ value is defined in the IANA timezone database, it 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 or is not an IANA timezone name, it requires special handling.¶
Both TITLE and ROLE properties are represented as entries of the "titles" map (Figure 11). The entry value is a "Title" object whose "title" member includes information about the title or role. The rules to set the "organization" member are out of the scope of this document.¶
The ALTID and LANGUAGE parameters are mapped according to the rules as defined in (Section 2.1).¶
A LOGO property is represented as an entry of the "online" map (Figure 12). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "logo" and the "resource" member is the LOGO value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
An ORG property is represented as an entry of the "organizations" map (Figure 13). The entry value is an "Organization" object whose "name" member contains the organizational name and the "units" member contains the organizational units.¶
The ALTID and LANGUAGE parameters are mapped according to the rules as defined in (Section 2.1).¶
According to the JSContact specification, a group of contact cards is represented through a CardGroup (Figure 14). The uids of the contact cards composing the group are included in the "members" map.¶
In this case, the PREF parameter has not a JSContact counterpart; however, the implementers MAY insert the map entries by order of preference.¶
Only if the GROUP contains properties that don't have a mapping to CardGroup properties, then the CardGroup.card property MAY contain the optional Card object of this group.¶
All the RELATED instances are converted into the "relatedTo" map (Figure 16): an entry for each entity the entity described by the Card 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 the RELATED-specific values of the TYPE parameter as defined in Section 6.6.6 of [RFC6350].¶
If the relation type is unspecified, the "relation" member MUST be empty.¶
A CONTACT-URI property as defined in [RFC8605] is represented as an entry of the "online" map (Figure 17). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "contact-uri" and the "resource" member is the CONTACT-URI value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The LEVEL parameter as defined in [RFC6715] is directly mapped to the "level" property of the "PersonalInformation" type apart from when LEVEL is used in the EXPERTISE property; in this case, the values are converted as in the following:¶
An EXPERTISE property as defined in [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" map (Figure 18). The "type" member is set to "expertise".¶
The INDEX parameter is represented as the index of the expertise among the declared expertises.¶
A HOBBY property as defined in [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" map (Figure 19). The "type" member is set to "hobby".¶
The INDEX parameter is represented as the index of the hobby among the declared hobbies.¶
An INTEREST property as defined in [RFC6715] is represented as a "PersonalInformation" object in the "personalInfo" map (Figure 20). The "type" member is set to "interest".¶
The INDEX parameter is represented as the index of the interest among the declared interests.¶
An ORG-DIRECTORY property is represented as an entry of the "online" map (Figure 21). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "org-directory" and the "resource" member is the ORG-DIRECTORY value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The INDEX parameter is represented as the index of the directory among the online resources with the "org-directory" label.¶
A CATEGORIES property is converted into a set of entries of the "categories" map (Figure 22). The keys are the comma-separated text values of the CATEGORIES property.¶
In this case, the PREF parameter has not a JSContact counterpart; however, implementers MAY use a map preserving the order of insertion and the map entries can be inserted by order of preference.¶
A NOTE property is mapped to the "notes" property (Figure 23). All the NOTE instances are condensed into a single note and separated by newline.¶
The ALTID and LANGUAGE parameters are mapped according to the rules as defined in (Section 2.1).¶
The PRODID property is converted into the "prodId" member (Figure 24).¶
The REV property is transformed into the "updated" member (Figure 25).¶
A SOUND property is represented as an entry of the "online" map (Figure 26). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "sound" and the "resource" member is the SOUND value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The UID property corresponds to the "uid" property (Figure 27) in both Card and CardGroup.¶
The CLIENTPIDMAP property and the PDI parameter don't have a direct match with a Card feature.¶
An URL property is represented as an entry of the "online" map (Figure 28). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "url" and the "resource" member is the URL value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The VERSION property doesn't have a direct match with a JSContact feature.¶
A KEY property is represented as an entry of the "online" map (Figure 29). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "key" and the "resource" member is the KEY value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
An FBURL property is represented as an entry of the "online" map (Figure 30). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "fburl" and the "resource" member is the FBURL value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
A CALADRURI property is represented as an entry of the "online" map (Figure 31). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "caladruri" and the "resource" member is the CALADRURI value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
A CALURI property is represented as an entry of the "online" map (Figure 32). The entry value is a "Resource" object whose "type" member is set to "uri", the "label" member is set to "caluri" and the "resource" member is the CALURI value.¶
The PREF and TYPE parameters are mapped according to the rules as defined in (Section 2.1).¶
The unmatched vCard properties MAY be converted into JSContact properties whose name contains the prefix "ietf.org/RFC6350/" followed by property name in uppercase (i.e. ietf.org/RFC6350/GENDER").¶
While converting a vCard into a Card/CardGroup, only the topmost "uid" member is mandatory. Implementers are REQUIRED to set it when it is missing.¶
In most of the cases, the rules about the translation from Card/CardGroup to vCard can be derived by reversing the rules presented in Section 2. The remaining cases are treated in the following of this section.¶
Where a map key is of type Id, implementers are free to either ignore it or preserve it as a vCard information (e.g. a vCard parameter).¶
Each PatchObject entry value of each "localizations" entry is converted into a instance of the vCard property matching the JSContact member referenced by the PatchObject entry key. The LANGUAGE parameter of such alternative MUST be set to the value of the given "localizations" entry. The LANGUAGE parameter of a vCard property presenting, at least, a language-dependent alternative MUST be set to the value of the JSContact "language" property if it is valued. Implementers MAY set the ALTID parameter to couple language-based alternatives of the same value.¶
Note also that the components of some vCard values and their language-dependent alternatives are split into different JSContact values. For example, the "name" and "units" values for a given language must be grouped to make a single ORG value where components are separated by ";".¶
The JSContact spec defines the "UTCDateTime" type to represent [RFC3339] "date-time" format with further restrictions. This means that the matched vCard format for a "UTCDateTime" value MUST be one of the formats shown in Section 4.3.5 of [RFC6350] (i.e. "19961022T140000Z").¶
In addition to such format, the "date" member of the "Anniversary" type allows specifying both a date without the time and a partial date. In this case, the corresponding vCard format is that defined in Section 4.3.1.¶
The time zone name as represented by the "timeZone" property is mapped to the TZ parameter.¶
Implementers MAY map an "Etc/GMT" time zone either preserving the time zone name or converting it into a UTC offset.¶
The "titles" property contains information about the job, the position or the role of the entity the card represents. In vCard, such information is split into the TITLE and ROLE properties. This specification defines TITLE as the default target property when converting the "titles" property.¶
The "online" property includes resources that are usually represented through different vCard properties. The matched vCard property of a "Resource" object can be derived from the value of its "label" member.¶
Any resource included in the "online" map that doesn't match a vCard property MAY be converted into vCard extended properties.¶
A CardGroup object is converted into a vCard by merging its properties with the properties of "CardGroup.card" object. If the "CardGroup.card.fullName" property exists, it MUST be used to set the FN value.¶
Both the "preferredContactMethod" and "created" members don't match any vCard property. Implementers MAY represent them as vCard extended properties.¶
While converting a Card/CardGroup into a vCard, only the FN property is required. Since both the "Card.fullName" and "CardGroup.name" properties are optional, implementers are REQUIRED to generate an FN value when it is missing.¶
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 as defined in 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 considerationto 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.¶