RFC 9555: JSContact: Converting from and to vCard
- M. Loffredo,
- R. Stepanek
Abstract
This document defines how to convert contact information between the JSContact and vCard data formats. It defines conversion rules for every JSContact and vCard element registered at IANA at the time of publication. It also defines new JSContact properties as well as vCard properties and parameters, to support converting arbitrary or unknown JSContact and vCard elements.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2024 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://
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.¶
1. Introduction
1.1. Motivation
The JSContact data model and format [RFC9553] aims to be an alternative to the widely used vCard standard [RFC6350] and jCard format [RFC7095].¶
While applications might prefer JSContact to exchange contact card data with other systems, they are likely to interoperate with services and clients that only support vCard or jCard. Similarly, existing contact data providers and consumers already using vCard or jCard might also want to represent their contact data in JSContact.¶
To achieve this, this document defines standard rules to convert contact data between JSContact and vCard (and consequently jCard).¶
1.2. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
2. Converting vCard to JSContact
This section contains the conversion rules from the vCard to the JSContact Card. It follows the same structure as vCard v4 [RFC6350]. Properties and parameters of vCard extension RFCs, including those described in "vCard Format Extension for JSContact" [RFC9554], have been added to the appropriate subsections.¶
2.1. General Rules
2.1.1. The Card uid Property
The UID property (Section 6.7.6 of [RFC6350]) in vCard is optional, but the Card object's uid property (Section 2.1.9 of [RFC9553]) is mandatory. Implementations that convert a vCard without a UID property MUST generate a unique identifier as value for the uid property. This value SHOULD be the same when converting the same vCard multiple times, but how to achieve this is implementation
2.1.2. Choosing Identifiers
Multivalued properties in JSContact are typically represented as a JSON object where the object keys are of the Id type (Section 1.4.1 of [RFC9553]) and the object values are the converted vCard property. In the absence of the PROP-ID parameter (see Section 2.3.18), implementations are free to choose any identifier as key for such entries. Whatever identifier generation scheme implementations use, they MUST generate values that are valid according to the definition of the Id type in [RFC9553]. For example, this could be an incrementing number across all identifier keys in the Card object or only unique within one JSON object.¶
2.2. vCard Value Data Types
2.2.1. BOOLEAN
The BOOLEAN type (Section 4.4 of [RFC6350]) converts to the JSContact Boolean type (Section 1.3.2 of [RFC9553]).¶
2.2.2. DATE, TIME, DATE-TIME, DATE-AND-OR-TIME, and TIMESTAMP
The TIMESTAMP type (Section 4.3.5 of [RFC6350]) converts to the UTCDateTime type (Section 1.4.5 of [RFC9553]), except for anniversaries. For anniversaries, it converts to the Timestamp type (Section 2.8.1 of [RFC9553]).¶
The DATE type (Section 4.3.1 of [RFC6350]) converts to a PartialDate object (Section 2.8.1 of [RFC9553]) when used for an anniversary, unless the DATE value only contains a month or a day (but not both).¶
The following temporal types do not convert to a JSContact datetime type. Instead, vCard properties or parameters having such value types convert as defined in Section 2.15.¶
2.2.3. INTEGER
The INTEGER type (Section 4.5 of [RFC6350]) converts to the JSContact Int and UnsignedInt types (Section 1.4.2 of [RFC9553]).¶
2.2.4. FLOAT
The FLOAT type (Section 4.6 of [RFC6350]) converts to the JSContact Number type (Section 1.3.2 of [RFC9553]).¶
2.2.5. LANGUAGE-TAG
The LANGUAGE-TAG type (Section 4.8 of [RFC6350]) converts to the JSContact String type (Section 1.3.2 of [RFC9553]). The value MUST be a language tag as defined in [RFC5646].¶
2.2.6. TEXT
The TEXT type (Section 4.1 of [RFC6350]) converts to the JSContact String type (Section 1.3.2 of [RFC9553]).¶
2.2.7. URI
The URI type (Section 4.2 of [RFC6350]) converts to the JSContact String type (Section 1.3.2 of [RFC9553]). The value MUST be a URI as defined in Section 3 of [RFC3986]¶
2.2.8. UTC-OFFSET
The UTC-OFFSET type (Section 4.7 of [RFC6350]) either converts to a String value containing an IANA Time Zone Database entry name (see Section 2.8.2) or does not convert to any JSContact type. For the latter, vCard properties or parameters having such values convert as defined in Section 2.15.¶
2.3. vCard Parameters
This section contains the conversion rules for vCard parameters. A rule typically applies only for specific vCard properties. To convert a vCard parameter on an arbitrary vCard property, see Section 2.15.2.¶
2.3.1. ALTID
The ALTID parameter (Section 5.4 of [RFC6350]) does not convert to an IANA-registered property in JSContact, but several conversion rules make use of this parameter to combine multiple vCard properties into a single JSContact object instance. For an example of this, see Section 2.6.1. To preserve the verbatim value of the ALTID parameter, set the JSContact properties defined in Section 2.15.¶
2.3.4. CALSCALE
The CALSCALE parameter (Section 5.8 of [RFC6350]) set on a BDAY, DEATHDATE, or ANNIVERSARY property converts to the PartialDate object's calendarScale property (Section 2.8.1 of [RFC9553]).¶
2.3.5. CC
The CC parameter (Section 3.1 of [RFC8605]) on an ADR property converts to the Address object's countryCode property (Section 2.5.1.1 of [RFC9553]).¶
2.3.6. CREATED
The CREATED parameter (Section 4.3 of [RFC9554]) on a NOTE property converts to the Note object's created property (Section 2.8.3 of [RFC9553]).¶
2.3.7. DERIVED
The DERIVED parameter (Section 4.4 of [RFC9554]) does not convert to JSContact. If the DERIVED parameter is set to "true" on a vCard property, then implementations MAY choose not to convert that property.¶
2.3.8. GEO
The GEO parameter (Section 5.10 of [RFC6350]) set on an ADR property converts to the Address object's coordinates property (Section 2.5.1.1 of [RFC9553]).¶
2.3.9. GROUP
The GROUP parameter (Section 7.1 of [RFC7095]) does not convert to JSContact. It exclusively is for use in jCard and MUST NOT be set in a vCard.¶
Preserving the exact group name when converting from vCard to JSContact and back to vCard is not necessary. Any group identifiers will do, as long as the resulting vCard groups its properties equally to the original vCard. Implementations that still wish to preserve the exact property group name of a vCard property MAY set the jCard "group" parameter in the JSContact properties vCardProps or vCardParams as defined in Section 2.15.¶
2.3.10. INDEX
The INDEX parameter (Section 3.1 of [RFC6715]) set on the EXPERTISE, HOBBY, INTEREST, and ORG-DIRECTORY properties converts to the PersonalInfo (Section 2.8.4 of [RFC9553]) and Directory (Section 2.6.2 of [RFC9553]) objects' listAs property.¶
2.3.11. LANGUAGE
The LANGUAGE parameter (Section 5.1 of [RFC6350]) converts to an entry in the Card object's localizations property (Section 2.7.1 of [RFC9553]) for that vCard property on which this parameter is set on. The value of the LANGUAGE parameter defines the language tag key in the localizations property.¶
This specification does not define a single standard conversion rule for how to convert the property values. Instead, building the localizations value is implementation
Two options to populate the localizations property are:¶
Generally, localizations only localize properties that are present in the non-localized version of this Card. Figure 3 illustrates this.¶
As a special case, if one or more vCard properties of the same type do not have the LANGUAGE parameter set, add them to the non-localized Card. Convert any with LANGUAGE parameters to the localizations property. Figure 4 illustrates this.¶
2.3.12. LABEL
The LABEL parameter (Section 6.3.1 of [RFC6350]) on an ADR property converts to the Address object's full property (Section 2.5.1.1 of [RFC9553]).¶
2.3.13. LEVEL
The LEVEL parameter (Section 3.2 of [RFC6715]) converts to the PersonalInfo object's level property (Section 2.8.4 of [RFC9553]). If this parameter is set on the EXPERTISE property, then its values convert as follows:¶
In all other cases, the values convert verbatim, but lowercase MUST be used for the JSContact value.¶
2.3.14. MEDIATYPE
The MEDIATYPE parameter (Section 5.7 of [RFC6350]) converts to the Resource object's mediaType property (Section 1.4.4 of [RFC9553]).¶
2.3.15. PHONETIC
The PHONETIC parameter (Section 4.6 of [RFC9554]) converts to the Name (Section 2.2.1 of [RFC9553]) and Address (Section 2.5.1 of [RFC9553]) objects' phoneticSystem property unless the parameter value is "script", in which case the phoneticSystem property is not set.¶
The value of the SCRIPT parameter converts to the phoneticScript property (see Section 2.3.19).¶
The related N or ADR property is defined by the vCard ALTID parameter. The conversion rules for the N (Section 2.5.5) and ADR (Section 2.6.1) properties define how the vCard components convert to JSContact.¶
The component values of the property on which the PHONETIC parameter is set convert to the respective NameComponent or Address
If more than one property has the PHONETIC parameter set and relates to the same property, then they convert to the Card object's localizations property according to their LANGUAGE parameter values as outlined in Section 2.3.11.¶
2.3.16. PID
The PID parameter (Section 5.5 of [RFC6350]) converts to the vCardParams property; see Section 2.15.2.¶
2.3.17. PREF
The PREF parameter (Section 5.3 of [RFC6350]) converts to the pref property of the derived JSContact object.¶
2.3.18. PROP-ID
The PROP-ID parameter (Section 4.7 of [RFC9554]) converts to the Id-typed key of the derived JSContact object.¶
2.3.19. SCRIPT
The SCRIPT parameter (Section 4.8 of [RFC9554]) converts to the Name (Section 2.2.1 of [RFC9553]) or Address (Section 2.5.1 of [RFC9553]) objects' phoneticScript property.¶
Also see Section 2.3.15.¶
2.3.20. SERVICE-TYPE
The SERVICE-TYPE parameter (Section 4.9 of [RFC9554]) converts to the OnlineService object's service property (Section 2.3.2 of [RFC9553]).¶
2.3.21. SORT-AS
The SORT-AS parameter (Section 5.9 of [RFC6350]) converts to the Name, Organization, and OrgUnit objects' sortAs properties.¶
2.3.22. TYPE
The TYPE parameter (Section 5.6 of [RFC6350]) converts to either the contexts property or the kind property, as defined in later sections. If not otherwise specified, the vCard "home" and "work" parameter values convert to the JSContact "private" and "work" contexts, respectively.¶
2.3.23. TZ
The TZ parameter (Section 5.11 of [RFC6350]) on an ADR property converts to the Address object's timeZone property (Section 2.5.1.1 of [RFC9553]). Also see the conversion of the TZ property in Section 2.8.2.¶
2.3.24. USERNAME
The USERNAME parameter (Section 4.10 of [RFC9554]) converts to the OnlineService object's user property (Section 2.3.2 of [RFC9553]).¶
2.4. General Properties
2.4.1. BEGIN and END
The BEGIN and END properties do not convert to IANA-registered properties in JSContact.¶
2.4.2. KIND
The KIND property (Section 6.1.4 of [RFC6350]) converts to the kind property (Figure 7). Allowed values are those described in Section 6.1.4 of [RFC6350] and extended with the values declared in [RFC6473] and [RFC6869].¶
2.4.3. SOURCE
The SOURCE property (Section 6.1.3 of [RFC6350]) converts to a Directory object (Section 2.6.2 of [RFC9553]) in the Card object's directories property (Figure 8). The Directory object's kind property is set to "entry". The uri property is set to the SOURCE property value.¶
The PREF and MEDIATYPE parameters convert according to the rules defined in Section 2.3.¶
2.4.4. XML
The XML property (Section 6.1.5 of [RFC6350]) converts to the vCardProps property; see Section 2.15.1.¶
2.5. Identification Properties
2.5.1. ANNIVERSARY, BDAY, BIRTHPLACE, DEATHDATE, and DEATHPLACE
The following properties all convert to Anniversary objects in the Card object's anniversaries property (Figure 9):¶
BDAY and BIRTHPLACE convert to an Anniversary object (Section 2.8.1 of [RFC9553]) having the date and place properties set. The kind property is set to "birth".¶
DEATHDATE and DEATHPLACE convert to an Anniversary object having the date and place properties set. The Anniversary object's kind property is set to "death".¶
ANNIVERSARY converts to the Anniversary object's date property. The Anniversary object's kind property is set to "wedding".¶
If the BIRTHPLACE or DEATHPLACE property value is of type URI using the "geo:" URI scheme, then it converts to the Address object's coordinates property. If the value type is TEXT, then it converts to the Address object's full property. Otherwise, it converts to the vCardProps property; see Section 2.15.1.¶
The ALTID and LANGUAGE parameters of both the BIRTHPLACE and DEATHPLACE properties convert according to the rules defined in Section 2.3.¶
2.5.2. FN
The FN property (Section 6.2.1 of [RFC6350]) converts to the Name object's full property (Figure 10). If the LANGUAGE parameter is set, then the FN property converts as outlined in Section 2.3.11. In the unexpected case where the vCard contains more than one FN property without the LANGUAGE parameter, convert the FN property that has the least parameters. If multiple such FN properties are present, choose any of them. All other FN properties convert to the vCardProps (Section 2.15.1) property.¶
2.5.3. GENDER
The GENDER property (Section 6.2.7 of [RFC6350]) does not convert to an IANA-registered property in JSContact. To convert this property, see Section 2.15.1. Alternatively, the Card object's speakToAs property defines how to address and refer to an individual represented by the Card, as do the newly defined vCard GRAMGENDER and PRONOUNS properties of [RFC9554].¶
2.5.4. GRAMGENDER and PRONOUNS
The GRAMGENDER property (Section 3.2 of [RFC9554]) converts to the SpeakToAs object's grammatical
The PRONOUNS property (Section 3.4 of [RFC9554]) converts to the SpeakToAs object's pronouns property (Figure 11).¶
2.5.5. N
The N property (Section 6.2.2 of [RFC6350]) converts to a Name object (Section 2.2.1 of [RFC9553]) in the Card object's name property. Each component in the N property structured value converts to a NameComponent in the Name object's components property. The following table shows this relation:¶
If the JSCOMPS (Section 3.3.1) parameter is set, then the Name object's isOrdered property value is "true", and the default
If the JSCOMPS parameter is not set, then the Name object's isOrdered property value is "false", and the default
If the SORT-AS parameter is set, then its structured value converts to the Name object's sortAs property according to Table 1. An empty or non-existent component value indicates that no sort is defined for this kind.¶
See Section 3.3.1 for examples of using the JSCOMPS parameter for v
2.5.6. NICKNAME
The NICKNAME property (Section 6.2.3 of [RFC6350]) converts to a Nickname object (Section 2.2.2 of [RFC9553]) in the Card object's nicknames property (Figure 13). The name property is set to the NICKNAME property value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.5.7. PHOTO
The PHOTO property (Section 6.2.4 of [RFC6350]) converts to a Media object (Section 2.6.4 of [RFC9553]) in the Card object's media property (Figure 14). The Media object's kind property is set to "photo" and the uri property is set to the PHOTO value.¶
The PREF and MEDIATYPE parameters convert according to the rules defined in Section 2.3.¶
2.6. Delivery Addressing Properties
2.6.1. ADR
The ADR property (Section 6.3.1 of [RFC6350]) converts to an Address object (Section 2.5.1.1 of [RFC9553]) in the Card object's addresses property. Each component in the ADR-structured property value converts to an Address
[RFC9554] defines new components for the ADR property. Implementations SHOULD set these new components, even if all their values are the empty string.¶
The following table shows how the ADR component and Address
If the JSCOMPS (Section 3.3.1) parameter is set, then the Address object's isOrdered property value is "true", and the default
If the JSCOMPS parameter is not set, then the Address object's isOrdered property value is "false", and the default
The PREF and TYPE parameters convert according to the rules defined in Section 2.3. The ADR-specific values of the TYPE parameter defined in Sections 5.1 and 5.2 of [RFC9554] convert to the corresponding entries of the contexts property as defined in Section 2.5.1 of [RFC9553].¶
The ALTID and LANGUAGE parameters convert according to the rules defined in Section 2.3. Each possible language
See Section 3.3.1 for examples of using the JSCOMPS parameter for v
2.7. Communications Properties
2.7.1. EMAIL
The EMAIL property (Section 6.4.2 of [RFC6350]) converts to an EmailAddress object (Section 2.3.1 of [RFC9553]) in the Card object's emails property (Figure 16). The EmailAddress object's address property is set to the EMAIL value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.7.2. IMPP
The IMPP property (Section 6.4.3 of [RFC6350]) converts to an OnlineService object (Section 2.3.2 of [RFC9553]) in the Card object's onlineServices property (Figure 17). The vCardName property is set to "impp", and the uri property is set to the IMPP value.¶
The SERVICE-TYPE, USERNAME, PREF, and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.7.3. LANG
The LANG property (Section 6.4.4 of [RFC6350]) converts to a LanguagePref object (Section 2.3.4 of [RFC9553]) in the Card object's preferred
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.7.4. LANGUAGE
The LANGUAGE property (Section 3.3 of [RFC9554]) converts to the Card object's language property (Figure 19).¶
2.7.6. TEL
The TEL property (Section 6.4.1 of [RFC6350]) converts to a Phone object (Section 2.3.3 of [RFC9553]) in the Card object's phones property (Figure 21).¶
The TEL-specific values of the TYPE parameter convert to the features property keys as outlined in Table 3. Note that Section 6.4.1 of [RFC6350] defines the default type to be "voice", but the default Phone features property is absent by default. Accordingly, an implementation SHOULD only set the Phone object's features property if the TEL property actually has a TEL-specific TYPE parameter set.¶
The value of the TEL property converts to the Phone object's number property.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.8. Geographical Properties
2.8.1. GEO
The GEO property (Section 6.5.2 of [RFC6350]) converts to the Address object's coordinates property (Section 2.5.1 of [RFC9553]). Also see Section 2.8.3 to determine which Address object instance to convert to.¶
2.8.2. TZ
The TZ property (Section 6.5.1 of [RFC6350]) converts an Address object (Section 2.5.1 of [RFC9553]) in the Card object's addresses property.¶
A value of type TEXT converts to the Address object's timeZone property.¶
A value of type UTC-OFFSET converts to the Address object's timeZone property if the offset has zero minutes and the hour offset is between -12 and +14, both inclusively. Note that:¶
For such property values, also see Section 2.8.3 to determine which Address object instance to convert to.¶
Any other value of type UTC-OFFSET or URI does not convert to an IANA-registered property in JSContact. To convert such property, see Section 2.15.1.¶
2.8.3. Combining Geographical Properties
In vCard, the properties ADR, GEO, and TZ occur independently of each other. In JSContact, they all convert to properties of an Address object. It is implementation
2.9. Organizational Properties
2.9.1. CONTACT-URI
The CONTACT-URI property (Section 2.1 of [RFC8605]) converts to a Link object (Section 2.6.3 of [RFC9553]) in the Card object's links property (Figure 22). The Link object's kind property is set to "contact" and the uri property is set to the CONTACT-URI property value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.9.2. LOGO
The LOGO property (Section 6.6.3 of [RFC6350]) converts to a Media object (Section 2.6.4 of [RFC9553]) in the Card object's media property (Figure 23). The Media object's kind property is set to "logo" and the uri property is set to the LOGO property value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.9.3. MEMBER
The MEMBER property (Section 6.6.5 of [RFC6350]) converts to the Card object's members property (Figure 24). Each MEMBER property value is a key in the members property. The PREF parameter (Section 5.3 of [RFC6350]) does not convert to JSContact.¶
2.9.4. ORG
The ORG property (Section 6.6.4 of [RFC6350]) converts to an Organization object (Section 2.2.3 of [RFC9553]) in the Card object's organizations property (Figure 25). The Organization object's name property is set to the ORG property organizational name component. The Organization object's units property is an array of OrgUnit objects that each contain an organizational unit name component value of the ORG property value.¶
Implementations MAY allow representation of organizational units without the organizational name. In this case, the first component of the ORG value MUST be an empty string (e.g., ORG
The ALTID and LANGUAGE parameters convert according to the rules defined in Section 2.3.¶
The first item of the comma-separated SORT-AS parameter value converts to the sortAs property of the Organization object. The subsequent items convert to the sortAs property of the corresponding OrgUnit object.¶
The TYPE parameter converts according to the rules defined in Section 2.3.¶
2.9.6. TITLE and ROLE
The TITLE (Section 6.6.1 of [RFC6350]) and ROLE (Section 6.6.2 of [RFC6350]) properties convert to a Title object (Section 2.2.5 of [RFC9553]) in the Card object's titles property (Figure 27). The Title object's kind property is set to "title" or "role" for the TITLE and ROLE vCard properties, respectively. The name property is set to the vCard property value.¶
The value of the organizationId property can be derived if the TITLE or ROLE property is a member of a vCard property group and if exactly one other ORG property is also a part of that group.¶
The ALTID and LANGUAGE parameters convert according to the rules defined in Section 2.3.¶
2.10. Personal Information Properties
2.10.1. EXPERTISE
The EXPERTISE property (Section 2.1 of [RFC6715]) converts to a PersonalInfo object (Section 2.8.4 of [RFC9553]) in the Card object's personalInfo property (Figure 28). The PersonalInfo object's kind property is set to "expertise".¶
The INDEX and LEVEL parameters convert according to the rules defined in Section 2.3.¶
2.10.2. HOBBY
The HOBBY property (Section 2.2 of [RFC6715]) converts to a PersonalInfo object (Section 2.8.4 of [RFC9553]) in the Card object's personalInfo property (Figure 29). The PersonalInfo object's kind property is set to "hobby".¶
The INDEX and LEVEL parameters convert according to the rules defined in Section 2.3.¶
2.10.3. INTEREST
The INTEREST property (Section 2.3 of [RFC6715]) converts to a PersonalInfo object (Section 2.8.4 of [RFC9553]) in the Card object's personalInfo property (Figure 30). The PersonalInfo object's kind property is set to "interest".¶
The INDEX and LEVEL parameters convert according to the rules defined in Section 2.3.¶
2.10.4. ORG-DIRECTORY
The ORG-DIRECTORY property (Section 2.4 of [RFC6715]) [RFC6715] converts to a Directory object (Section 2.6.2 of [RFC9553]) in the Card object's directories property (Figure 31). The Directory object's kind property is set to "directory". The uri property is set to the ORG-DIRECTORY property value.¶
The INDEX, PREF, and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.11. Explanatory Properties
2.11.1. CATEGORIES
The CATEGORIES property (Section 6.7.1 of [RFC6350]) converts to a set of entries of the Card object's keywords property (Figure 32). The keys are the comma-separated text values of the CATEGORIES property.¶
In this case, the PREF parameter does not have a JSContact counterpart; however, the implementors MAY insert the entries by order of preference.¶
2.11.2. CLIENTPIDMAP
The CLIENTPIDMAP property (Section 6.7.7 of [RFC6350]) converts to the vCardProps (Section 2.15.1) property.¶
2.11.3. CREATED
The CREATED property (Section 3.1 of [RFC9554]) converts to the Card object's created property (Figure 33).¶
2.11.4. NOTE
The NOTE property (Section 6.7.2 of [RFC6350]) converts to a Note object (Section 2.8.3 of [RFC9553]) in the Card object's notes property (Figure 34).¶
The ALTID and LANGUAGE parameters convert according to the rules defined in Section 2.3.¶
2.11.5. PRODID
The PRODID property (Section 6.7.3 of [RFC6350]) converts to the Card object's prodId property (Figure 35).¶
2.11.6. REV
The REV property (Section 6.7.4 of [RFC6350]) converts to the Card object's updated property (Figure 36).¶
2.11.7. SOUND
The SOUND property (Section 6.7.5 of [RFC6350]) converts to a Media object (Section 2.6.4 of [RFC9553]) in the Card object's media property (Figure 37). The Media object's kind property is set to "sound" and the uri property is set to the SOUND value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.11.8. UID
The UID property (Section 6.7.6 of [RFC6350]) converts to the Card object's uid property (Figure 38).¶
2.11.9. URL
The URL property (Section 6.7.8 of [RFC6350]) converts to a Link object (Section 2.6.3 of [RFC9553]) in the Card object's links property (Figure 39). The Link object's uri property is set to the URL value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.11.10. VERSION
The VERSION property (Section 6.7.9 of [RFC6350]) converts to the vCardProps (Section 2.15.1) property.¶
2.11.11. X-ABLabel
The X-ABLabel property is experimental but widely in use in existing vCard data. It converts to the label property of a JSContact object. The X-ABLabel property is preceded by a vCard property group name, and the label converts to the JSContact object, which was converted from a vCard property of the same group.¶
The group name is not preserved; implementations are free to choose any unique group name when converting back to vCard. For an example on how to preserve the group name, see Section 2.3.9.¶
2.12. Security Properties
2.12.1. KEY
The KEY property (Section 6.8.1 of [RFC6350]) converts to a CryptoKey object (Section 2.6.1 of [RFC9553]) in the Card object's cryptoKeys property (Figure 41). The CryptoKey object's uri property is set to the KEY property value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.13. Calendar Properties
2.13.1. CALADRURI
The CALADRURI property (Section 6.9.2 of [RFC6350]) converts to a Scheduling
The PREF parameter (Section 5.3 of [RFC6350]) converts according to the rules defined in Section 2.3.¶
2.13.2. CALURI
The CALURI property (Section 6.9.3 of [RFC6350]) converts to a Calendar object (Section 2.4.1 of [RFC9553]) in the Card object's calendars property (Figure 43). The Calendar object's kind property is set to "calendar" and the uri property is set to the CALURI value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.13.3. FBURL
The FBURL property (Section 6.9.1 of [RFC6350]) converts to a Calendar object (Section 2.4.1 of [RFC9553]) in the Card object's calendars property (Figure 44). The Calendar object's kind property is set to "freeBusy" and the uri property is set to the FBURL value.¶
The PREF and TYPE parameters convert according to the rules defined in Section 2.3.¶
2.14. Extended Properties and Parameters
Extended properties and parameters convert as specified in Section 2.15.¶
2.15. New JSContact Properties
vCards may contain properties or parameters for which no IANA-registered JSContact property is defined. For example, a vCard may contain properties and parameters of which the semantics or purposes are unknown to the implementation; see Section 6.10 of [RFC6350].¶
This section defines JSContact properties by which such vCard properties and parameters MAY be represented in JSContact. Implementations MAY choose to convert differently if they deem that more appropriate.¶
2.15.1. vCardProps
- vCardProps: JCardProp[] (optional).
- Contains vCard properties that are set in the vCard represented by this JSContact object. The JCardProp type denotes a jCard-encoded vCard property as defined in Section 3.3 of [RFC7095].¶
- Example:
-
This illustrates how to convert a vCard extension property:¶
2.15.2. vCardParams
- vCardParams: String[String|S
tring[]] (optional). - Contains vCard parameters that are set on the vCard property represented by this JSContact object. The value MUST be a JSON object containing vCard property parameters as defined in Section 3.3 of [RFC7095]. Each entry represents a parameter of the vCard property that converts to the JSContact object.¶
- Example:
-
This illustrates how to convert a vCard extension parameter:¶
2.15.3. vCardName
- vCardName: String (optional).
- Contains the name of the vCard element that is represented by this JSContact object. For example, this allows to preserve the name of a vCard property when multiple vCard properties convert the same JSContact type. The case
-insensitive value MUST be valid according to the "name" ABNF defined in Section 3.3 of [RFC6350].¶ - Example:
-
Both vCard IMPP and SOCIALPROFILE convert to an OnlineService object (Section 2.3.2 of [RFC9553]) in JSContact. The vCardName property value indicates that the vCard source element was IMPP as follows:¶
3. Converting JSContact to vCard
3.1. Conversion Rules
A Card object converts to vCard by applying the reverse rules of converting vCard to JSContact. In addition to those listed in Appendix A, the following rules apply:¶
3.1.1. Converting Unknown Properties
JSContact objects may contain properties for which no IANA-registered vCard property is defined. For example, a JSContact object may contain vendor-specific properties of which the semantics or purpose are unknown.¶
This specification defines the new JSPROP (Section 3.2.1) vCard property and JSPTR (Section 3.3.2) vCard parameter by which such JSContact properties MAY be represented in vCard. Implementations MAY choose to convert differently if they deem that more appropriate.¶
3.2. New vCard Properties
3.2.1. JSPROP
- Property name:
- JSPROP¶
- Purpose:
- Represents a JSContact property in vCard.¶
- Value type:
- TEXT; also see "Format definition" below for value restrictions.¶
- Conformance:
- Can be specified multiple times in a vCard.¶
- Property parameters:
- The JSPTR parameter MUST be set for this property. Other IANA-registered and experimental property parameters can be specified on this property.¶
- Description:
-
This property converts an arbitrary JSContact property from and to vCard. The vCard property value is the JSON-encoded value of the JSContact property, represented as a TEXT value. The format of the JSON value MUST be compact, e.g., without insignificant whitespace as defined in Section 2 of [RFC8259]. The value of the JSPTR parameter points to the JSContact property within the Card.¶
The root of the JSON pointer is always the Card object that this vCard converts to, irrespective if the JSON pointer starts with the SOLIDUS (U+002F) character. The pointer MUST NOT reference into an array.¶
All JSPROP properties in a vCard together form a PatchObject as defined in [RFC9553]. The value of its JSPTR parameter corresponds to a key in the PatchObject; the value of the JSPROP property corresponds to the value for that key. When converting from vCard to JSContact, the PatchObject MUST only be applied after all other vCard properties have already been converted. The PatchObject MUST be valid, including the restriction that an invalid PatchObject MUST NOT be applied.¶
- Format definition:
-
This property is defined by the following notation:¶
-
Example(s):
-
This illustrates how to convert a property at the top level in a Card object that is unknown to the implementation.¶
This illustrates how to convert a vendor-specific property at the top level of a Card object. Note the required use of quoted string for the JSPTR value, which allows the path to include the COLON (U+003A) character.¶
This illustrates how to convert a vendor-specific property at a nested level in a Card object using a path relative to the Card object. Although not recommended, the property name includes the SOLIDUS (U+002F) character, which requires escaping in the JSON pointer.¶
3.3. New vCard Parameters
3.3.1. JSCOMPS
- Parameter name:
- JSCOMPS¶
- Purpose:
- Defines the order and separators for the elements of a structured property value.¶
- Description:
-
The JSCOMPS parameter value facilitates converting name and address components between JSContact and vCard. It preserves the order of the components of the JSContact property and contains the verbatim values of separator components.¶
If this parameter is set and its value is valid (see later), then implementations MUST set the isOrdered property of the Name or Address object to "true". Otherwise, they MUST set the isOrdered property value to "false".¶
The JSCOMPS parameter value is a structured type value. Its value MUST be quoted. The parameter value consists of a sequence of entries, separated by the SEMICOLON character (U+003B). The first entry defines the value of the default
Separator property. If it is the empty string, then no default separator is defined. Otherwise, the first entry MUST be a separator entry. All following entries processed in order result in an ordered list of JSContact components and MUST be one of the following two kinds:¶ A JSCOMPS parameter value is valid if and only if:¶
- Format definition:
-
Example(s):
-
The following example demonstrates the use of positional entries for the name "Jane Doe". The given name is ordered before the surname. No secondary index is required for either positional because both are zero.¶
The following example demonstrates a secondary positional index. The "Jr." generation marker only counts once because it occurs in both the designated generation component and the backwards
-compatible honorific suffixes component.¶ The following example demonstrates the use of separator entries for the (shortened for brevity) address "54321 Oak St, Reston". The first entry defines the default separator to be ", ". The second and fourth positional entries are separated with the separator value " ". For backwards compatibility, the street address component of the ADR property contains both the street number and name, but it is not referred to in the JSCOMPS parameter and does not contribute to the count of values.¶
3.3.2. JSPTR
- Parameter name:
- JSPTR¶
- Purpose:
- This parameter is set on a JSPROP (Section 3.2.1) property. Its value is a JSON pointer [RFC6901] that points to the JSContact property that has the value of the JSPROP property.¶
- Description:
-
This parameter has a single value that MUST be a valid JSON pointer as defined in [RFC6901]. Note that the value MUST be quoted according to the "param-value" ABNF in [RFC6350].¶
- Format definition:
- Example(s):
-
This illustrates a simple example. For further examples, see Section 3.2.1.¶
4. Security Considerations
This specification defines how to convert between the JSContact and vCard formats. The security considerations for parsing and formatting such data apply and are outlined in Section 4 of [RFC9553] and Section 9 of [RFC6350].¶
5. IANA Considerations
5.1. New vCard Property
IANA has added the following entry to the "vCard Properties" registry, as defined in Section 10.3.1 of [RFC6350].¶
5.2. New vCard Parameter
IANA has added the following entry to the "vCard Parameters" registry, as defined in Section 10.3.2 of [RFC6350].¶
5.3. New JSContact Properties
IANA has added the following entries to the "JSContact Properties" registry. Note that the Since Version is 1.0, the Until Version is not set, and the Change Controller is IETF for all of these properties.¶
5.4. New JSContact Type
IANA has added the following entry to the "JSContact Types" registry. Note that the Since Version is 1.0, the Until Version is not set, and the Change Controller is IETF for this type.¶
6. References
6.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC3986]
-
Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10
.17487 , , <https:///RFC3986 www >..rfc -editor .org /info /rfc3986 - [RFC5234]
-
Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10
.17487 , , <https:///RFC5234 www >..rfc -editor .org /info /rfc5234 - [RFC5646]
-
Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying Languages", BCP 47, RFC 5646, DOI 10
.17487 , , <https:///RFC5646 www >..rfc -editor .org /info /rfc5646 - [RFC6350]
-
Perreault, S., "vCard Format Specification", RFC 6350, DOI 10
.17487 , , <https:///RFC6350 www >..rfc -editor .org /info /rfc6350 - [RFC6473]
-
Saint-Andre, P., "vCard KIND
:application" , RFC 6473, DOI 10.17487 , , <https:///RFC6473 www >..rfc -editor .org /info /rfc6473 - [RFC6474]
-
Li, K. and B. Leiba, "vCard Format Extensions: Place of Birth, Place and Date of Death", RFC 6474, DOI 10
.17487 , , <https:///RFC6474 www >..rfc -editor .org /info /rfc6474 - [RFC6715]
-
Cauchie, D., Leiba, B., and K. Li, "vCard Format Extensions: Representing vCard Extensions Defined by the Open Mobile Alliance (OMA) Converged Address Book (CAB) Group", RFC 6715, DOI 10
.17487 , , <https:///RFC6715 www >..rfc -editor .org /info /rfc6715 - [RFC6869]
-
Salgueiro, G., Clarke, J., and P. Saint-Andre, "vCard KIND:device", RFC 6869, DOI 10
.17487 , , <https:///RFC6869 www >..rfc -editor .org /info /rfc6869 - [RFC6901]
-
Bryan, P., Ed., Zyp, K., and M. Nottingham, Ed., "JavaScript Object Notation (JSON) Pointer", RFC 6901, DOI 10
.17487 , , <https:///RFC6901 www >..rfc -editor .org /info /rfc6901 - [RFC7095]
-
Kewisch, P., "jCard: The JSON Format for vCard", RFC 7095, DOI 10
.17487 , , <https:///RFC7095 www >..rfc -editor .org /info /rfc7095 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8259]
-
Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10
.17487 , , <https:///RFC8259 www >..rfc -editor .org /info /rfc8259 - [RFC9553]
-
Stepanek, R. and M. Loffredo, "JSContact: A JSON Representation of Contact Data", RFC 9553, DOI 10
.17487 , , <https:///RFC9553 www >..rfc -editor .org /info /rfc9553 - [RFC9554]
-
Stepanek, R. and M. Loffredo, "vCard Format Extensions for JSContact", RFC 9554, DOI 10
.17487 , , <https:///RFC9554 www >..rfc -editor .org /info /rfc9554
6.2. Informative References
- [CLDRPersonName]
-
Davis, M., Edberg, P., Gillam, R., Kolisnychenko, A., McKenna, M., and other CLDR committee members, "Unicode Locale Data Markup Language (LDML) Part 8: Person Names", Unicode Technical Standard #35, Version 44.1, , <https://
www >..unicode .org /reports /tr35 /tr35 -person Names .html - [RFC8605]
-
Hollenbeck, S. and R. Carney, "vCard Format Extensions: ICANN Extensions for the Registration Data Access Protocol (RDAP)", RFC 8605, DOI 10
.17487 , , <https:///RFC8605 www >..rfc -editor .org /info /rfc8605 - [vOBJECT]
-
Tse, R., Tam, P., and M. Douglass, "vObject Internationaliz
ation" , Work in Progress, Internet-Draft, draft-calconnect , , <https://-vobject -i18n -00 datatracker >..ietf .org /doc /html /draft -calconnect -vobject -i18n -00
Appendix A. Reverse Rules of Converting a vCard to a JSContact Card
Table 8 lists the relevant document sections for each JSContact type and property.¶
Acknowledgements
The definition and examples of the PHONETIC (Section 2.3.15) and SCRIPT (Section 2.3.19) parameters are based on the initial draft version of [vOBJECT].¶
"onlineServices": { ... "OS-1": { "service": "Mastodon", "uri": "https://example.com/@foo" } }