<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc iprnotified="no"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-ietf-calext-jscontact-vcard-02" ipr="trust200902" tocInclude="true" tocDepth="4" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.10 -->
  <front>
    <title abbrev="jscontact-vcard">JSContact: Converting from and to vCard</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-calext-jscontact-vcard-02"/>
    <author fullname="Mario Loffredo" initials="M." surname="Loffredo">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <code>56124</code>
        </postal>
        <email>mario.loffredo@iit.cnr.it</email>
        <uri>http://www.iit.cnr.it</uri>
      </address>
    </author>
    <author fullname="Robert Stepanek" initials="R." surname="Stepanek">
      <organization>FastMail</organization>
      <address>
        <postal>
          <street>PO Box 234, Collins St West</street>
          <city>Melbourne</city>
          <country>AU</country>
          <code>VIC 8007</code>
        </postal>
        <email>rsto@fastmailteam.com</email>
        <uri>https://www.fastmail.com</uri>
      </address>
    </author>
    <date year="2022" month="July" day="11"/>
    <area>Applications</area>
    <workgroup>calext</workgroup>
    <keyword>JSON</keyword>
    <keyword>contacts</keyword>
    <keyword>vCard</keyword>
    <keyword>jCard</keyword>
    <abstract>
      <t>This document defines how to convert contact information as defined in the JSContact <xref target="I-D.ietf-calext-jscontact"/> specification from and to vCard.</t>
    </abstract>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <section>
        <name>Motivation</name>
        <t>The JSContact format <xref target="I-D.ietf-calext-jscontact"/> represents contact card information as an alternative to vCard <xref target="RFC6350"/> and its JSON-based version named jCard <xref target="RFC7095"/>.</t>
        <t>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 only 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. For interoperability, this conversion needs to be standardized.</t>
        <t>To facilitate this, this document defines a standard how to convert contact information between the JSContact <xref target="I-D.ietf-calext-jscontact"/> and vCard formats.</t>
      </section>
      <section>
        <name>Scope and Caveats</name>
        <t>JSContact and vCard have a lot of semantics in common, however some differences must be outlined:
        </t>
        <ul spacing="compact">
          <li>
            <t>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.</t>
            <t/>
          </li>
          <li>The properties that can be present multiple times in a vCard are represented through different collections in JSContact; mainly as maps, sometimes as lists, in some cases condensed in a single value.</li>
        </ul>
      </section>
      <section>
        <name>Conventions Used in This Document</name>
        <t>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 <xref target="RFC2119"/>.</t>
        <t>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.</t>
      </section>
      <section>
        <name>Extensions</name>
        <t>While translating vCard 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:&lt;RFC defining the extension&gt;:" (e.g. "ietf.org:rfc6350:").</t>
        <t>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".</t>
        <t>Likewise, while translating JSContact to vCard, a JSContact property that doesn't have a direct counterpart in vCard MUST be converted into a property whose name is prefixed with "X-" as specified in Section 6.10 of <xref target="RFC6350"/>.</t>
      </section>
    </section>
    <section anchor="vcard-jscontact-translation">
      <name>Translating vCard properties to JSContact</name>
      <t>This section contains the translaiton rules from vCard to Card/CardGroup.  The vCard properties are grouped according to the categories as defined in <xref target="RFC6350"/>.</t>
      <t>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.</t>
      <section anchor="vcard-common-parameters">
        <name>Common vCard Parameters</name>
        <t>The following mapping rules apply to parameters that are common to most of the vCard properties:</t>
        <ul spacing="compact">
          <li>
            <t>The vCard specification defines the "work" and "home" values for the "TYPE" property, section 5.6. of <xref target="RFC6350"/> to indicate the context in which the respective property should be used. These map to the JSContact "context" property as defined in Section 1.5.1 of <xref target="I-D.ietf-calext-jscontact"/>.  The "home" value corresponds to the "private" key. Property-specific mappings of TYPE values for the TEL and RELATED properties are defined in <xref target="vCard-TEL"/> and <xref target="vCard-RELATED"/>.</t>
            <t/>
          </li>
          <li>
            <t>The PREF parameter is mapped to the "pref" property.</t>
            <t/>
          </li>
          <li>
            <t>The MEDIATYPE parameter is mapped to the "mediaType" property.  As described in Section 5.7 of <xref target="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.</t>
            <t/>
          </li>
          <li>
            <t>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 key in the "localizations" object is the LANGUAGE value, the key in the PatchObject points the JSContact property that corresponds to the vCard property. The value of the PatchObject entry contains the vCard property value.</t>
            <t/>
          </li>
        </ul>
      </section>
      <section anchor="unmapped-jscontact-information">
        <name>Unmapped JSContact Information</name>
        <t>The rules to generate a map key of type Id as well as "preferredContactMethod" properties are out of the scope of this document.</t>
      </section>
      <section>
        <name>General Properties</name>
        <section>
          <name>BEGIN and END</name>
          <t>The BEGIN and END properties don't have a direct match with a JSContact feature.</t>
        </section>
        <section>
          <name>SOURCE</name>
          <t>A SOURCE property is represented as an entry of the "resources" map (<xref target="source_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "directorySource" and the "resource" member is the SOURCE value.</t>
          <t>The PREF and MEDIATYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="source_mapping">
            <name>SOURCE mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    SOURCE:http://directory.example.com/addressbooks/jdoe/Jean%20Dupont.vcf
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
       ...
       "a-source":{
         "@type": "Resource",
         "type": "directorySource",
         "resource": "http://directory.example.com/addressbooks/jdoe/Jean%20Dupont.vcf"
       },
       ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>KIND</name>
          <t>The KIND property is mapped to the "kind" member (<xref target="kind_mapping"/>).  Allowed values are those described in Section 6.1.4 of <xref target="RFC6350"/> and extended with the values declared in <xref target="RFC6473"/> and <xref target="RFC6869"/>.  The value "group" is reserved for a CardGroup instance.</t>
          <figure anchor="kind_mapping">
            <name>KIND mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    KIND:individual
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "kind": "individual",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>XML</name>
          <t>The XML property doesn't have a direct match with a JSContact feature.</t>
        </section>
      </section>
      <section>
        <name>Identification Properties</name>
        <section>
          <name>FN</name>
          <t>All the FN instances are represented through the "fullName" member (<xref target="fn_n_nickname_mapping"/>).  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 <xref target="vcard-common-parameters"/>.</t>
          <t>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.</t>
        </section>
        <section>
          <name>N and NICKNAME</name>
          <t>The N instances are converted into equivalent items of the "components" array of the "name" property (<xref target="fn_n_nickname_mapping"/>): the N components are transformed into related "NameComponent" objects as presented in <xref target="n_components"/>.  Name components SHOULD be ordered such that their values joined by whitespace produce a valid full name of this entity.</t>
          <t>Each NICKNAME instance is mapped to an item of "nickNames" array.</t>
          <table anchor="n_components">
            <name>N components mapping</name>
            <thead>
              <tr>
                <th align="left">N component</th>
                <th align="left">"type" value</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">Honorific Prefixes</td>
                <td align="left">prefix</td>
              </tr>
              <tr>
                <td align="left">Given Names</td>
                <td align="left">personal</td>
              </tr>
              <tr>
                <td align="left">Family Names</td>
                <td align="left">surname</td>
              </tr>
              <tr>
                <td align="left">Additional Names</td>
                <td align="left">additional</td>
              </tr>
              <tr>
                <td align="left">Honorific Suffixes</td>
                <td align="left">suffix</td>
              </tr>
            </tbody>
          </table>
          <figure anchor="fn_n_nickname_mapping">
            <name>FN, N, NICKNAME mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    FN:Mr. John Q. Public\, Esq.
    N:Public;John;Quinlan;Mr.;Esq.
    NICKNAME:Johnny
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "fullName": "Mr. John Q. Public, Esq.",
    "name":{
        "@type": "Name",
        "components":[
          { "@type": "NameComponent", "type": "prefix", "value":"Mr."  },
          { "@type": "NameComponent", "type": "personal", "value":"John" },
          { "@type": "NameComponent", "type": "surname", "value":"Public" },
          { "@type": "NameComponent", "type": "additional", "value":"Quinlan" },
          { "@type": "NameComponent", "type": "suffix", "value":"Esq." }
        ]
    },
    "nickNames":[
      "Johnny"
    ],
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>PHOTO</name>
          <t>A PHOTO property is represented as an entry of the "photos" map (<xref target="photo_mapping"/>).  The entry value is a "File" object whose "href" member is the PHOTO value.</t>
          <t>The PREF and MEDIATYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="photo_mapping">
            <name>PHOTO mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    PHOTO:http://www.example.com/pub/photos/jqpublic.gif
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "photos":{
       ...
       "a-photo":{
         "@type": "File",
         "href": "http://www.example.com/pub/photos/jqpublic.gif"
       },
       ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>BDAY, BIRTHPLACE, DEATHDATE, DEATHPLACE, ANNIVERSARY</name>
          <t>The BDAY and ANNIVERSARY properties and the extensions BIRTHPLACE, DEATHDATE, DEATHPLACE described in <xref target="RFC6350"/> are represented as "Anniversary" objects included in the "anniversaries" map (<xref target="anniversary_mapping"/>):</t>
          <ul spacing="compact">
            <li>
              <t>BDAY and BIRTHPLACE are mapped to "date" and "place" where "type" is set to "birth";</t>
              <t/>
            </li>
            <li>
              <t>DEATHDATE and DEATHPLACE are mapped to "date" and "place" where "type" is set to "death";</t>
              <t/>
            </li>
            <li>ANNIVERSARY is mapped to "date" where "type" is empty and "label" is set to a value describing in detail the kind of anniversary (e.g. "marriage date" for the wedding anniversary).</li>
          </ul>
          <t>Both birth and death places are represented as instances of the "Address" object.</t>
          <t>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.</t>
          <t>The ALTID and LANGUAGE parameters of both BIRTHPLACE and DEATHPLACE properties are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="anniversary_mapping">
            <name>BDAY, BIRTHPLACE, DEATHDATE, DEATHPLACE, ANNIVERSARY mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    BDAY:19531015T231000Z
    BIRTHPLACE:Mail Drop: TNE QB\n123 Main Street\nAny Town, CA 91921-1234\nU.S.A.
    DEATHDATE:19960415
    DEATHPLACE:4445 Courtright Street\nNew England, ND 58647\nU.S.A.
    ANNIVERSARY:19860201
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "anniversaries": {
      "ANNIVERSARY-1" : {
        "@type": "Anniversary",
        "type": "birth",
        "date": "1953-10-15T23:10:00Z",
        "place":{
          "@type": "Address",
          "fullAddress": "Mail Drop: TNE QB\n123 Main Street\nAny Town, CA 91921-1234\nU.S.A."
        }
      },
      "ANNIVERSARY-2" : {
        "@type": "Anniversary",
        "type": "death",
        "date": "1996-04-15",
        "place":{
          "@type": "Address",
          "fullAddress": "4445 Courtright Street\nNew England, ND 58647\nU.S.A."
        }
      },
      "ANNIVERSARY-3" : {
        "@type": "Anniversary",
        "label": "marriage date",
        "date": "1986-02-01"
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>GENDER</name>
          <t>The GENDER property is a single structured value with two optional components: the biological sex and the gender information.  The former is represented as an enumerated value, while the latter as a free-form text.  As opposed to such a representation, the JSContact specification includes the "SpeakToAs" object just to represent how to address, speak to or refer to the contact.  In particular, some pre-defined values are allowed for the "grammaticalGender" member.</t>
          <t>For the reasons stated above, the GENDER property doesn't have a direct match with the "SpeakToAs" object.  However, on the assumption that the GENDER property doesn't store the actual biological sex of the contact, implementations MAY use the conversion rules shown in <xref target="gender-vs-speaktoas"/> and <xref target="speaktoas-vs-gender"/>.</t>
          <table anchor="gender-vs-speaktoas">
            <name>GENDER to SpeakToAs conversion</name>
            <thead>
              <tr>
                <th align="left">GENDER value</th>
                <th align="left">"SpeakToAs.grammaticalGender" value</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">M</td>
                <td align="left">male</td>
              </tr>
              <tr>
                <td align="left">F</td>
                <td align="left">female</td>
              </tr>
              <tr>
                <td align="left">N</td>
                <td align="left">neuter</td>
              </tr>
              <tr>
                <td align="left">O</td>
                <td align="left">animate</td>
              </tr>
              <tr>
                <td align="left">U</td>
                <td align="left">SpeakToAs = null</td>
              </tr>
            </tbody>
          </table>
          <table anchor="speaktoas-vs-gender">
            <name>SpeakToAs to GENDER conversion</name>
            <thead>
              <tr>
                <th align="left">"SpeakToAs.grammaticalGender" value</th>
                <th align="left">GENDER value</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">male</td>
                <td align="left">M</td>
              </tr>
              <tr>
                <td align="left">female</td>
                <td align="left">F</td>
              </tr>
              <tr>
                <td align="left">neuter</td>
                <td align="left">N</td>
              </tr>
              <tr>
                <td align="left">animate</td>
                <td align="left">O</td>
              </tr>
              <tr>
                <td align="left">inanimate</td>
                <td align="left">N;inanimate</td>
              </tr>
            </tbody>
          </table>
        </section>
      </section>
      <section>
        <name>Delivery Addressing Properties</name>
        <section>
          <name>ADR</name>
          <t>An ADR property is represented as an entry of the "addresses" map (<xref target="adr_mapping"/>).  The entry value is an "Address" object.</t>
          <t>The ADR components are transformed into the "Address" members as presented in <xref target="adr_components_vs_address_members"/> and <xref target="adr_components_vs_street_component_items"/>.</t>
          <t>The "street address" and "extended address" ADR components MAY be converted into either a single StreetComponent item or a combination of StreetComponent items.</t>
          <table anchor="adr_components_vs_address_members">
            <name>ADR components vs. Address members mapping</name>
            <thead>
              <tr>
                <th align="left">ADR component</th>
                <th align="left">Address member</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">locality</td>
                <td align="left">locality</td>
              </tr>
              <tr>
                <td align="left">region</td>
                <td align="left">region</td>
              </tr>
              <tr>
                <td align="left">postal code</td>
                <td align="left">postcode</td>
              </tr>
              <tr>
                <td align="left">country name</td>
                <td align="left">country</td>
              </tr>
            </tbody>
          </table>
          <table anchor="adr_components_vs_street_component_items">
            <name>ADR components vs. StreetComponent items mapping</name>
            <thead>
              <tr>
                <th align="left">ADR component</th>
                <th align="left">Single StreetComponent item</th>
                <th align="left">Combination of StreetComponent items</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">post office box</td>
                <td align="left">postOfficeBox</td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left">extended address</td>
                <td align="left">extension</td>
                <td align="left">extension, building, floor, room, apartment</td>
              </tr>
              <tr>
                <td align="left">street address</td>
                <td align="left">name</td>
                <td align="left">name, number, direction</td>
              </tr>
            </tbody>
          </table>
          <t>The LABEL parameter is converted into the "fullAddress" member.</t>
          <t>The GEO parameter is converted into the "coordinates" member.</t>
          <t>The TZ parameter is converted into the "timeZone" member.</t>
          <t>The CC parameter as defined in <xref target="RFC8605"/> is converted into the "countryCode" member.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <t>The ALTID and LANGUAGE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>. Each possible language-dependent alternative is represented as an entry of the PatchObject map where the key references the "fullAddress" member.</t>
          <figure anchor="adr_mapping">
            <name>ADR mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    ADR;TYPE=work;CC=US:;;54321 Oak St;Reston;VA;20190;USA
    ADR;TYPE=home;CC=US:;;12345 Elm St;Reston;VA;20190;USA
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "addresses":{
      "work-address" :{
        "@type": "Address",
        "contexts":{ "work": true },
        "fullAddress": "54321 Oak St\nReston\nVA\n20190\nUSA",
        "street": [
           { "@type": "StreetComponent", "type": "name", "value": "Oak St" },
           { "@type": "StreetComponent", "type": "number", "value": "54321" }
        ],
        "locality": "Reston",
        "region": "VA",
        "country": "USA",
        "postcode": "20190",
        "countryCode": "US"
      },
      "private-address":{
        "@type": "Address",
        "contexts":{ "private": true },
        "fullAddress":  "12345 Elm St\nReston\nVA\n20190\nUSA",
        "street": [
           { "@type": "StreetComponent", "type": "name", "value": "Elm St" },
           { "@type": "StreetComponent", "type": "number", "value": "12345" }
        ],
        "locality": "Reston",
        "region": "VA",
        "country": "USA",
        "postcode": "20190",
        "countryCode": "US"
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>Communications Properties</name>
        <section anchor="vCard-TEL">
          <name>TEL</name>
          <t>A TEL property is represented as an entry of the "phones" map (<xref target="tel_mapping"/>).  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.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="tel_mapping">
            <name>TEL mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    TEL;VALUE=uri;PREF=1;TYPE="voice,home":tel:+1-555-555-5555;ext=5555
    TEL;VALUE=uri;TYPE=home:tel:+33-01-23-45-67
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "phones":{
      "a-phone":{
        "@type": "Phone",
        "contexts":{ "private": true },
        "features":{ "voice": true },
        "phone": "tel:+1-555-555-5555;ext=5555",
        "pref": 1
      },
      "another-phone":{
        "@type": "Phone",
        "contexts":{ "private": true },
        "phone": "tel:+33-01-23-45-67"
      }
    ],
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>EMAIL</name>
          <t>An EMAIL property is represented as an entry of the "emails" map (<xref target="email_mapping"/>).  The entry value is an "EmailAddress" object.  The "email" member is set to the EMAIL value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="email_mapping">
            <name>EMAIL mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    EMAIL;TYPE=work:jqpublic@xyz.example.com
    EMAIL;PREF=1:jane_doe@example.com
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "emails":{
      "work-email":{
        "@type": "EmailAddress",
        "contexts":{ "work": true },
        "email": "jqpublic@xyz.example.com"
      },
      "private-email":{
        "@type": "EmailAddress",
        "email": "jane_doe@example.com",
        "pref": 1
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>IMPP</name>
          <t>An IMPP property is represented as an entry of the "onlineServices" map (<xref target="impp_mapping"/>).  The entry value is a "OnlineService" object and the "uri" member is the IMPP value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="impp_mapping">
            <name>IMPP mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    IMPP;PREF=1:xmpp:alice@example.com
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "onlineServices":{
      ...
      {
        "@type": "OnlineService",
        "uri": "xmpp:alice@example.com",
        "pref": 1
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>LANG</name>
          <t>A LANG property is represented as an entry of the "preferredContactLanguages" map (<xref target="lang_mapping"/>).  The entry keys correspond to the language tags, the corresponding entry values are arrays of "ContactLanguage" objects.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <t>If both PREF and TYPE parameters are missing, the array of "ContactLanguage" objects MUST be empty.</t>
          <figure anchor="lang_mapping">
            <name>LANG mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    LANG;TYPE=work;PREF=1:en
    LANG;TYPE=work;PREF=2:fr
    LANG;TYPE=home:fr
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "preferredContactLanguages":{
      "en":[
        {
          "@type": "ContactLanguage",
          "context": "work",
          "pref": 1
        }
      ],
      "fr":[
        {
          "@type": "ContactLanguage",
          "context": "work",
          "pref": 2
        },
        {
          "@type": "ContactLanguage",
          "context": "private"
        }
      ]
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>Geographical Properties</name>
        <t>The GEO and TZ properties are not directly mapped to topmost Card members because the same information is represented through equivalent "Address" members.</t>
        <t>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.</t>
        <section>
          <name>Time Zone Representation</name>
          <t>As specified in Section 6.5.1 of <xref target="RFC6350"/>, the time zone information can be represented as a time zone name, as a UTC offset or as a URI.
          </t>
          <ul spacing="compact">
            <li>
              <t>If the TZ value is defined in the IANA timezone database, it is directly matched by the "timeZone" member in JSContact.</t>
              <t/>
            </li>
            <li>
              <t>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.</t>
              <t/>
            </li>
            <li>Since there is no URI scheme defined for time zones <xref target="uri-schemes"/>, any implementation that does use some a custom URI for a time zone is not interoperable anyway.  In this case, if the URI corresponds to an IANA time zone <xref target="time-zones"/>, this latter SHOULD be used.  Otherwise, the URI value is dumped into a string.</li>
          </ul>
        </section>
      </section>
      <section>
        <name>Organizational Properties</name>
        <section>
          <name>TITLE and ROLE</name>
          <t>Both TITLE and ROLE properties are represented as entries of the "titles" map (<xref target="title_role_mapping"/>).  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.</t>
          <t>The ALTID and LANGUAGE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="title_role_mapping">
            <name>TITLE and ROLE mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    TITLE:Research Scientist
    ROLE:Project Leader
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "titles":{
      "a-title":{
        "@type": "Title",
        "title": "Project Leader"
      },
      "another-title":{
        "@type": "Title",
        "title": "Research Scientist"
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>LOGO</name>
          <t>A LOGO property is represented as an entry of the "resources" map (<xref target="logo_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "logo" and the "resource" member is the LOGO value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="logo_mapping">
            <name>LOGO mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    LOGO:http://www.example.com/pub/logos/abccorp.jpg
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "a-logo":{
        "@type": "Resource",
        "type": "logo",
        "resource": "http://www.example.com/pub/logos/abccorp.jpg"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>ORG</name>
          <t>An ORG property is represented as an entry of the "organizations" map (<xref target="org_mapping"/>).  The entry value is an "Organization" object whose "name" member contains the organizational name and the "units" member contains the organizational units.</t>
          <t>The ALTID and LANGUAGE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="org_mapping">
            <name>ORG mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    ORG:ABC\, Inc.;North American Division;Marketing
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "organizations":{
      "an-organization":{
        "@type": "Organization",
        "name": "ABC, Inc.",
        "units":[
          "North American Division",
          "Marketing"
        ]
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>MEMBER</name>
          <t>According to the JSContact specification, a group of contact cards is represented through a CardGroup (<xref target="group_example"/>).  The uids of the contact cards composing the group are included in the "members" map.</t>
          <t>In this case, the PREF parameter has not a JSContact counterpart; however, the implementers MAY insert the map entries by order of preference.</t>
          <figure anchor="group_example">
            <name>Group example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    KIND:group
    FN:The Doe family
    MEMBER:urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af
    MEMBER:urn:uuid:b8767877-b4a1-4c70-9acc-505d3819e519
    END:VCARD

      {
        "@type": "CardGroup",
        "kind": "group",
        "fullName": "The Doe family",
        "uid": "urn:uuid:ab4310aa-fa43-11e9-8f0b-362b9e155667",
        "members":{
          "urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af": true,
          "urn:uuid:b8767877-b4a1-4c70-9acc-505d3819e519": true
        }
      }
        ]]></artwork>
          </figure>
          <t>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.</t>
          <figure anchor="card_member_of_cardgroup_object">
            <name>card member of CardGroup object</name>
            <artwork><![CDATA[
    {
      "@type": "CardGroup",
      "name": "The Doe family",
      "uid": "urn:uuid:ab4310aa-fa43-11e9-8f0b-362b9e155667",
      "members":{
         "urn:uuid:03a0e51f-d1aa-4385-8a53-e29025acd8af": true,
         "urn:uuid:b8767877-b4a1-4c70-9acc-505d3819e519": true
      },
      "card": {
         "@type": "Card",
         "fullName": "The Doe family",
         "uid": "urn:uuid:ab4310aa-fa43-11e9-8f0b-362b9e155667",
         "photos":{
           "a-photo":{
             "@type": "File",
             "href": "http://www.example.com/pub/photos/jqpublic.gif"
           }
         }
      }
    }
    ]]></artwork>
          </figure>
        </section>
        <section anchor="vCard-RELATED">
          <name>RELATED</name>
          <t>All the RELATED instances are converted into the "relatedTo" map (<xref target="related_mapping"/>): 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.</t>
          <t>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 <xref target="RFC6350"/>.</t>
          <t>If the relation type is unspecified, the "relation" member MUST be empty.</t>
          <figure anchor="related_mapping">
            <name>RELATED mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    RELATED;TYPE=friend:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
    RELATED;TYPE=contact:http://example.com/directory/jdoe.vcf
    RELATED;VALUE=text:Please contact my assistant Jane Doe for any inquiries.
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "relatedTo":{
      {
        "@type": "Relation",
        "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6":{
          "relation":{ "friend": true }
        }
      },
      {
        "@type": "Relation",
        "http://example.com/directory/jdoe.vcf":{
          "relation":{ "contact": true }
        }
      },
      {
        "@type": "Relation",
        "Please contact my assistant Jane Doe for any inquiries.":{
          "relation":{ }
        }
      }
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>CONTACT-URI</name>
          <t>A CONTACT-URI property as defined in <xref target="RFC8605"/> is represented as an entry of the "resources" map (<xref target="contact_uri_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "contact" and the "resource" member is the CONTACT-URI value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="contact_uri_mapping">
            <name>CONTACT-URI mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    CONTACT-URI;PREF=1:mailto:contact@example.com
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "a-contact-uri":{
        "@type": "Resource",
        "type": "contact",
        "resource": "mailto:contact@example.com",
        "pref": 1
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>Personal Information Properties</name>
        <t>The LEVEL parameter as defined in <xref target="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:
        </t>
        <ul spacing="compact">
          <li>"beginner" is converted into "low";</li>
          <li>"average" is converted into "medium";</li>
          <li>"expert" is converted into "high".</li>
        </ul>
        <section>
          <name>EXPERTISE</name>
          <t>An EXPERTISE property as defined in <xref target="RFC6715"/> is represented as a "PersonalInformation" object in the "personalInfo" map (<xref target="expertise_mapping"/>).  The "type" member is set to "expertise".</t>
          <t>The INDEX parameter is represented as the index of the expertise among the declared expertises.</t>
          <figure anchor="expertise_mapping">
            <name>EXPERTISE mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    EXPERTISE;LEVEL=beginner;INDEX=2:chinese literature
    EXPERTISE;INDEX=1;LEVEL=expert:chemistry
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "personalInfo":{
      ...
      "PERSINFO-1" : {
        "@type": "PersonalInformation",
        "type": "expertise",
        "value": "chemistry",
        "level": "high"
      },
      "PERSINFO-2" : {
        "@type": "PersonalInformation",
        "type": "expertise",
        "value": "chinese literature",
         "level": "low"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>HOBBY</name>
          <t>A HOBBY property as defined in <xref target="RFC6715"/> is represented as a "PersonalInformation" object in the "personalInfo" map (<xref target="hobby_mapping"/>).  The "type" member is set to "hobby".</t>
          <t>The INDEX parameter is represented as the index of the hobby among the declared hobbies.</t>
          <figure anchor="hobby_mapping">
            <name>HOBBY mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    HOBBY;INDEX=1;LEVEL=high:reading
    HOBBY;INDEX=2;LEVEL=high:sewing
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "personalInfo":{
      ...
      "PERSINFO-1" : {
        "@type": "PersonalInformation",
        "type": "hobby",
        "value": "reading",
        "level": "high"
      },
      "PERSINFO-2" : {
        "@type": "PersonalInformation",
        "type": "hobby",
        "value": "sewing",
        "level": "high"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>INTEREST</name>
          <t>An INTEREST property as defined in <xref target="RFC6715"/> is represented as a "PersonalInformation" object in the "personalInfo" map (<xref target="interest_mapping"/>).  The "type" member is set to "interest".</t>
          <t>The INDEX parameter is represented as the index of the interest among the declared interests.</t>
          <figure anchor="interest_mapping">
            <name>INTEREST mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    INTEREST;INDEX=1;LEVEL=medium:r&b music
    INTEREST;INDEX=2;LEVEL=high:rock ’n’ roll music
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "personalInfo":{
      ...
      "PERSINFO-1" : {
        "@type": "PersonalInformation",
        "type": "interest",
        "value": "r&b music",
        "level": "medium"
      },
      "PERSINFO-2" : {
        "@type": "PersonalInformation",
        "type": "interest",
        "value": "rock ’n’ roll music",
        "level": "high"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>ORG-DIRECTORY</name>
          <t>An ORG-DIRECTORY property as defined in <xref target="RFC6715"/> is represented as an entry of the "resources" map (<xref target="org_directory_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "directory" and the "resource" member is the ORG-DIRECTORY value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <t>The INDEX parameter is represented as the index of the directory among the online resources with the "directory" type.</t>
          <figure anchor="org_directory_mapping">
            <name>ORG-DIRECTORY mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    ORG-DIRECTORY;INDEX=1:http://directory.mycompany.example.com
    ORG-DIRECTORY;PREF=1:ldap://ldap.tech.example/o=Example%20Tech,ou=Engineering
    ...
    END:VCARD

    {
    ...
    "resources":{
      "@type": "Card",
      ...
      "an-org-directory":{
        "@type": "Resource",
        "type": "directory",
        "resource": "http://directory.mycompany.example.com"
      },
      "another-org-directory":{
        "@type": "Resource",
        "type": "directory",
        "resource": "ldap://ldap.tech.example/o=Example%20Tech,ou=Engineering",
        "pref": 1
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>Explanatory Properties</name>
        <section>
          <name>CATEGORIES</name>
          <t>A CATEGORIES property is converted into a set of entries of the "categories" map (<xref target="categories_mapping"/>). The keys are the comma-separated text values of the CATEGORIES property.</t>
          <t>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.</t>
          <figure anchor="categories_mapping">
            <name>CATEGORIES mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "categories":{
      "INTERNET": true,
      "IETF": true,
      "INDUSTRY": true,
      "INFORMATION TECHNOLOGY": true
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>CREATED</name>
          <t>The CREATED property is transformed into the "created" member (<xref target="created_mapping"/>).</t>
          <figure anchor="created_mapping">
            <name>CREATED mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    CREATED:20210308T222710Z
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "created": "2021-03-08T22:27:10Z",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>LOCALE</name>
          <t>A LOCALE property is mapped to the "locale" property (<xref target="locale_mapping"/>).</t>
          <figure anchor="locale_mapping">
            <name>LOCALE mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    LOCALE:de-AT
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "locale": "de-AT",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>NOTE</name>
          <t>A NOTE property is mapped to the "notes" property (<xref target="notes_mapping"/>).  All the NOTE instances are condensed into a single note and separated by newline.</t>
          <t>The ALTID and LANGUAGE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="notes_mapping">
            <name>NOTE mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    NOTE:This fax number is operational 0800 to 1715 EST\, Mon-Fri.
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "notes": "This fax number is operational 0800 to 1715 EST, Mon-Fri.",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>PRODID</name>
          <t>The PRODID property is converted into the "prodId" member (<xref target="prodid_mapping"/>).</t>
          <figure anchor="prodid_mapping">
            <name>PRODID mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "prodId": "-//ONLINE DIRECTORY//NONSGML Version 1//EN",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>REV</name>
          <t>The REV property is transformed into the "updated" member (<xref target="rev_mapping"/>).</t>
          <figure anchor="rev_mapping">
            <name>REV mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    REV:19951031T222710Z
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "updated": "1995-10-31T22:27:10Z",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>SOUND</name>
          <t>A SOUND property is represented as an entry of the "resources" map (<xref target="sound_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "audio" and the "resource" member is the SOUND value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="sound_mapping">
            <name>SOUND mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    SOUND:CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "a-sound":{
        "@type": "Resource",
        "type": "audio",
        "resource": "CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@example.com"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>UID</name>
          <t>The UID property corresponds to the "uid" property (<xref target="uid_mapping"/>) in both Card and CardGroup.</t>
          <figure anchor="uid_mapping">
            <name>UID mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    UID:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "uid": "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>CLIENTPIDMAP and PID Parameter</name>
          <t>The CLIENTPIDMAP property and the PDI parameter don't have a direct match with a Card feature.</t>
        </section>
        <section>
          <name>URL</name>
          <t>An URL property is represented as an entry of the "resources" map (<xref target="url_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "uri" and the "resource" member is the URL value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="url_mapping">
            <name>URL mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    URL:http://example.org/restaurant.french/~chezchic.html
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "an-url":{
        "@type": "Resource",
        "type": "uri",
        "resource": "http://example.org/restaurant.french/~chezchic.html"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>VERSION</name>
          <t>The VERSION property doesn't have a direct match with a JSContact feature.</t>
        </section>
      </section>
      <section>
        <name>Security Properties</name>
        <section>
          <name>KEY</name>
          <t>A KEY property is represented as an entry of the "resources" map (<xref target="key_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "publicKey" and the "resource" member is the KEY value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="key_mapping">
            <name>KEY mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    KEY:http://www.example.com/keys/jdoe.cer
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "a-key":{
        "@type": "Resource",
        "type": "publicKey",
        "resource": "http://www.example.com/keys/jdoe.cer"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>Calendar Properties</name>
        <section>
          <name>FBURL</name>
          <t>An FBURL property is represented as an entry of the "resources" map (<xref target="fburl_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "freeBusy" and the "resource" member is the FBURL value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="fburl_mapping">
            <name>FBURL mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    FBURL;PREF=1:http://www.example.com/busy/janedoe
    FBURL;MEDIATYPE=text/calendar:ftp://example.com/busy/project-a.ifb
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "an-fburl":{
        "@type": "Resource",
        "type": "freeBusy",
        "resource": "http://www.example.com/busy/janedoe",
        "pref": 1
      },
      "another-fburl":{
        "@type": "Resource",
        "type": "freeBusy",
        "resource": "ftp://example.com/busy/project-a.ifb",
        "mediaType": "text/calendar"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>CALADRURI</name>
          <t>A CALADRURI property is represented as an entry of the "scheduling" map (<xref target="caladruri_mapping"/>).  The entry value is a "Scheduling" object whose "sendTo" map includes an entry whose key is set to "imip" and value is set to the CALADRURI value.</t>
          <t>The PREF parameter is mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="caladruri_mapping">
            <name>CALADRURI mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    CALADRURI;PREF=1:mailto:janedoe@example.com
    CALADRURI:http://example.com/calendar/jdoe
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "scheduling":{
      ...
      "a-caladruri":{
        "@type": "Scheduling",
        "sendTo": {
          "imip": "mailto:janedoe@example.com"
        },
        "pref": 1
      },
      "another-caladruri":{
        "@type": "Scheduling",
        "sendTo": {
            "imip": "http://example.com/calendar/jdoe"
        }
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
        <section>
          <name>CALURI</name>
          <t>A CALURI property is represented as an entry of the "resources" map (<xref target="caluri_mapping"/>).  The entry value is a "Resource" object whose "type" member is set to "calendar" and the "resource" member is the CALURI value.</t>
          <t>The PREF and TYPE parameters are mapped according to the rules as defined in <xref target="vcard-common-parameters"/>.</t>
          <figure anchor="caluri_mapping">
            <name>CALURI mapping example</name>
            <artwork><![CDATA[
    BEGIN:VCARD
    VERSION:4.0
    ...
    CALURI;PREF=1:http://cal.example.com/calA
    CALURI;MEDIATYPE=text/calendar:ftp://ftp.example.com/calA.ics
    ...
    END:VCARD

    {
    "@type": "Card",
    ...
    "resources":{
      ...
      "a-caluri":{
        "@type": "Resource",
        "type": "calendar",
        "resource": "http://cal.example.com/calA",
        "pref": 1
      },
      "another-caluri":{
        "@type": "Resource",
        "type": "calendar",
        "resource": "ftp://ftp.example.com/calA.ics",
        "mediaType": "text/calendar"
      },
      ...
    },
    ...
    }
        ]]></artwork>
          </figure>
        </section>
      </section>
      <section>
        <name>vCard Unmatched Properties</name>
        <t>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:CLIENTPIDMAP").</t>
      </section>
      <section>
        <name>Card Required Properties</name>
        <t>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.</t>
      </section>
    </section>
    <section>
      <name>Translating JSContact properties to vCard</name>
      <t>In most of the cases, the rules about the translation from Card/CardGroup to vCard can be derived by reversing the rules presented in <xref target="vcard-jscontact-translation"/>.  The remaining cases are treated in the following of this section.</t>
      <section>
        <name>Id</name>
        <t>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).</t>
      </section>
      <section>
        <name>Localizations</name>
        <t>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 group language-based alternatives of the same value.</t>
        <t>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 ";".</t>
      </section>
      <section>
        <name>Date and Time Representations</name>
        <t>The JSContact spec defines the "UTCDateTime" type to represent <xref target="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 <xref target="RFC6350"/> (i.e. "19961022T140000Z").</t>
        <t>In addition to such format, the "date" member of the "Anniversary" type allows to specify both dates without the time and partial dates.  In such cases, the corresponding vCard format is that defined in Section 4.3.1.</t>
      </section>
      <section>
        <name>Time Zone</name>
        <t>The time zone name as represented by the "timeZone" property is mapped to the TZ parameter.</t>
        <t>Implementers MAY map an "Etc/GMT" time zone either preserving the time zone name or converting it into a UTC offset.</t>
      </section>
      <section>
        <name>JSContact Types Matching Multiple vCard Properties</name>
        <section>
          <name>Title</name>
          <t>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 the ROLE properties.  This specification defines TITLE as the default target property when converting the "titles" property.</t>
        </section>
        <section>
          <name>Resource</name>
          <t>The "resources" 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 "type" member.</t>
          <t>Any resource included in the "resources" map that doesn't match a vCard property MAY be converted into a vCard extended property.</t>
        </section>
      </section>
      <section>
        <name>CardGroup</name>
        <t>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.</t>
      </section>
      <section>
        <name>Card Unmatched Properties</name>
        <t>Both the "preferredContactMethod" and "created" members don't match any vCard property.  Implementers MAY represent them as vCard extended properties.</t>
      </section>
      <section>
        <name>vCard Required Properties</name>
        <t>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.</t>
      </section>
    </section>
    <section anchor="IANA-considerations">
      <name>IANA Considerations</name>
      <t>This document has no actions for IANA.</t>
    </section>
    <section anchor="impl-status">
      <name>Implementation Status</name>
      <t>NOTE: Please remove this section and the reference to RFC 7942 prior to publication as an RFC.</t>
      <t>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 <xref target="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.</t>
      <t>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".</t>
      <section anchor="it-cnr-iit">
        <name>CNR</name>
        <ul spacing="compact">
          <li>Responsible Organization: National Research Council (CNR) of Italy</li>
          <li>Location: https://github.com/consiglionazionaledellericerche/jscontact-tools</li>
          <li>Description: This implementation includes tools for JSContact creation, validation, serialization/deserialization, and conversion from vCard, xCard and jCard.</li>
          <li>Level of Maturity: This is an "alpha" test implementation.</li>
          <li>Coverage: This implementation includes all of the features described in this specification.</li>
          <li>Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it</li>
        </ul>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document doesn't present any security consideration.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3339.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6350.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6473.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6474.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6715.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6869.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7095.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7942.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8605.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6901.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-ietf-calext-jscontact.xml"/>
        <reference anchor="time-zones" target="https://www.iana.org/time-zones">
          <front>
            <title>Time Zone Database</title>
            <author/>
            <date/>
          </front>
        </reference>
        <reference anchor="uri-schemes" target="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml">
          <front>
            <title>Uniform Resource Identifier (URI) Schemes</title>
            <author/>
            <date/>
          </front>
        </reference>
      </references>
    </references>

    <section anchor="appendix-property-groups">
      <name>Preserving vCard property groups</name>
      <t>
        The vCard format allows to define groups of properties in a vCard.
        To do so, implementation must prefix the content line of a property
        with a group identifier, as defined in <xref target="RFC6350" section="3.3"/>.
        There is no equivalent in JSContact, and it is up to further discussion in
        the working group if and how property groups should be defined. This section
        contains one possible mapping of vCard property groups in order to
        preserve them during conversion between the two formats.
      </t>
      <section anchor="propertyGroups" numbered="true" toc="default">
        <name>propertyGroups Property</name>
        <t>Type: String[PropertyGroup] (optional).</t>
        <t>This combines properties of a JSContact object into named groups. A client implementation can then display these properties together,
        such as group that combines an organization, address and photo property, shown together with a custom group label.</t>
        <t>
        The object keys <bcp14>MUST</bcp14> only contain ASCII alphanumeric characters (<tt>A-Za-z0-9</tt>) and hyphen (<tt>-</tt>) and <bcp14>MUST NOT</bcp14> be an empty string.
        A key identifies a group within a JSContact object but does not have any additional purpose. Specifically, the key is not meant to provide a human-readable
        name of the group. For this, use the PropertyGroup <tt>label</tt> property. A PropertyGroup object has the following properties:</t>
        <ul spacing="normal">
            <li>@type: <tt>String</tt> (mandatory).
                Specifies the type of this object. This <bcp14>MUST</bcp14> be <tt>PropertyGroup</tt>.
            </li>
            <li>label: <tt>String</tt> (optional).
                A human-readable label or name of this property group.
            </li>
            <li>members: <tt>String[Boolean]</tt> (optional).
                The set of property members of this property group. It <bcp14>MUST</bcp14> contain at least one member to be valid.
                The keys are the path to a property, encoded as a JSON pointer <xref target="RFC6901"/>
                where the leading <tt>/</tt> character is implicit (a pointer implicitly starts at the top-level of the Card or CardGroup).
                Any path that points at or into the <tt>propertyGroups</tt> property <bcp14>MUST</bcp14> be ignored.
                The values of the set <bcp14>MUST</bcp14> be <tt>true</tt>.
            </li>
        </ul>
      </section>
    </section>
  </back>
</rfc>
