Internet Engineering Task Force (IETF)                        P. Kewisch
Request for Comments: 7095                                       Mozilla
Category: Standards Track                                   January 2014
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                        P. Kewisch
Request for Comments: 7095                                       Mozilla
Category: Standards Track                                   January 2014
ISSN: 2070-1721
        

jCard: The JSON Format for vCard

jCard:vCard的JSON格式

Abstract

摘要

This specification defines "jCard", a JSON format for vCard data. The vCard data format is a text format for representing and exchanging information about individuals and other entities, for example, telephone numbers, email addresses, structured names, and delivery addresses. JSON is a lightweight, text-based, language-independent data interchange format commonly used in Internet applications.

本规范定义了“jCard”,这是vCard数据的JSON格式。vCard数据格式是一种文本格式,用于表示和交换有关个人和其他实体的信息,例如电话号码、电子邮件地址、结构化名称和递送地址。JSON是一种轻量级的、基于文本的、独立于语言的数据交换格式,常用于Internet应用程序。

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 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7095.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7095.

Copyright Notice

版权公告

Copyright (c) 2014 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2014 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  Converting from vCard to jCard  . . . . . . . . . . . . . . .   4
     3.1.  Pre-processing  . . . . . . . . . . . . . . . . . . . . .   4
     3.2.  jCard Object and Syntactic Entities (RFC 6350, Sections
           6.1.1 and 6.1.2)  . . . . . . . . . . . . . . . . . . . .   5
     3.3.  Properties (RFC 6350, Section 6)  . . . . . . . . . . . .   5
       3.3.1.  Special Cases for Properties  . . . . . . . . . . . .   7
         3.3.1.1.  The VERSION Property  . . . . . . . . . . . . . .   7
         3.3.1.2.  Grouping of Properties  . . . . . . . . . . . . .   7
         3.3.1.3.  Structured Property Values  . . . . . . . . . . .   8
     3.4.  Parameters (RFC 6350, Section 5)  . . . . . . . . . . . .  10
       3.4.1.  VALUE Parameter . . . . . . . . . . . . . . . . . . .  10
       3.4.2.  Multi-Valued Parameters . . . . . . . . . . . . . . .  11
     3.5.  Values (RFC 6350, Section 4)  . . . . . . . . . . . . . .  11
       3.5.1.  Text (RFC 6350, Section 4.1)  . . . . . . . . . . . .  12
       3.5.2.  URI (RFC 6350, Section 4.2) . . . . . . . . . . . . .  12
       3.5.3.  Date (RFC 6350, Section 4.3.1)  . . . . . . . . . . .  12
       3.5.4.  Time (RFC 6350, Section 4.3.2)  . . . . . . . . . . .  13
       3.5.5.  Date-Time (RFC 6350, Section 4.3.3) . . . . . . . . .  14
       3.5.6.  Date and/or Time (RFC 6350, Section 4.3.4)  . . . . .  16
       3.5.7.  Timestamp (RFC 6350, Section 4.3.5) . . . . . . . . .  16
       3.5.8.  Boolean (RFC 6350, Section 4.4) . . . . . . . . . . .  17
       3.5.9.  Integer (RFC 6350, Section 4.5) . . . . . . . . . . .  17
       3.5.10. Float (RFC 6350, Section 4.6) . . . . . . . . . . . .  17
       3.5.11. UTC Offset (RFC 6350, Section 4.7)  . . . . . . . . .  18
       3.5.12. Language Tag (RFC 6350, Section 4.8)  . . . . . . . .  18
     3.6.  Extensions (RFC 6350, Section 6.10) . . . . . . . . . . .  18
   4.  Converting from jCard into vCard  . . . . . . . . . . . . . .  19
   5.  Handling Unrecognized Properties or Parameters  . . . . . . .  19
     5.1.  Converting vCard into jCard . . . . . . . . . . . . . . .  19
     5.2.  Converting jCard into vCard . . . . . . . . . . . . . . .  20
     5.3.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .  20
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  21
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  22
     7.1.  GROUP vCard Parameter . . . . . . . . . . . . . . . . . .  23
     7.2.  UNKNOWN vCard Value Data Type . . . . . . . . . . . . . .  24
   8.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  24
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  24
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  24
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  25
   Appendix A.  ABNF Syntax  . . . . . . . . . . . . . . . . . . . .  26
   Appendix B.  Examples . . . . . . . . . . . . . . . . . . . . . .  27
     B.1.  Example: vCard of the Author of RFC 6350  . . . . . . . .  27
       B.1.1.  vCard Data  . . . . . . . . . . . . . . . . . . . . .  27
       B.1.2.  jCard Data  . . . . . . . . . . . . . . . . . . . . .  28
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
   3.  Converting from vCard to jCard  . . . . . . . . . . . . . . .   4
     3.1.  Pre-processing  . . . . . . . . . . . . . . . . . . . . .   4
     3.2.  jCard Object and Syntactic Entities (RFC 6350, Sections
           6.1.1 and 6.1.2)  . . . . . . . . . . . . . . . . . . . .   5
     3.3.  Properties (RFC 6350, Section 6)  . . . . . . . . . . . .   5
       3.3.1.  Special Cases for Properties  . . . . . . . . . . . .   7
         3.3.1.1.  The VERSION Property  . . . . . . . . . . . . . .   7
         3.3.1.2.  Grouping of Properties  . . . . . . . . . . . . .   7
         3.3.1.3.  Structured Property Values  . . . . . . . . . . .   8
     3.4.  Parameters (RFC 6350, Section 5)  . . . . . . . . . . . .  10
       3.4.1.  VALUE Parameter . . . . . . . . . . . . . . . . . . .  10
       3.4.2.  Multi-Valued Parameters . . . . . . . . . . . . . . .  11
     3.5.  Values (RFC 6350, Section 4)  . . . . . . . . . . . . . .  11
       3.5.1.  Text (RFC 6350, Section 4.1)  . . . . . . . . . . . .  12
       3.5.2.  URI (RFC 6350, Section 4.2) . . . . . . . . . . . . .  12
       3.5.3.  Date (RFC 6350, Section 4.3.1)  . . . . . . . . . . .  12
       3.5.4.  Time (RFC 6350, Section 4.3.2)  . . . . . . . . . . .  13
       3.5.5.  Date-Time (RFC 6350, Section 4.3.3) . . . . . . . . .  14
       3.5.6.  Date and/or Time (RFC 6350, Section 4.3.4)  . . . . .  16
       3.5.7.  Timestamp (RFC 6350, Section 4.3.5) . . . . . . . . .  16
       3.5.8.  Boolean (RFC 6350, Section 4.4) . . . . . . . . . . .  17
       3.5.9.  Integer (RFC 6350, Section 4.5) . . . . . . . . . . .  17
       3.5.10. Float (RFC 6350, Section 4.6) . . . . . . . . . . . .  17
       3.5.11. UTC Offset (RFC 6350, Section 4.7)  . . . . . . . . .  18
       3.5.12. Language Tag (RFC 6350, Section 4.8)  . . . . . . . .  18
     3.6.  Extensions (RFC 6350, Section 6.10) . . . . . . . . . . .  18
   4.  Converting from jCard into vCard  . . . . . . . . . . . . . .  19
   5.  Handling Unrecognized Properties or Parameters  . . . . . . .  19
     5.1.  Converting vCard into jCard . . . . . . . . . . . . . . .  19
     5.2.  Converting jCard into vCard . . . . . . . . . . . . . . .  20
     5.3.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .  20
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .  21
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  22
     7.1.  GROUP vCard Parameter . . . . . . . . . . . . . . . . . .  23
     7.2.  UNKNOWN vCard Value Data Type . . . . . . . . . . . . . .  24
   8.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  24
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  24
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  24
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  25
   Appendix A.  ABNF Syntax  . . . . . . . . . . . . . . . . . . . .  26
   Appendix B.  Examples . . . . . . . . . . . . . . . . . . . . . .  27
     B.1.  Example: vCard of the Author of RFC 6350  . . . . . . . .  27
       B.1.1.  vCard Data  . . . . . . . . . . . . . . . . . . . . .  27
       B.1.2.  jCard Data  . . . . . . . . . . . . . . . . . . . . .  28
        
1. Introduction
1. 介绍

The vCard data format [RFC6350] provides for the capture and exchange of information normally stored within an address book or directory application. The vCard format has gone through multiple revisions, most recently vCard 4.

vCard数据格式[RFC6350]用于捕获和交换通常存储在通讯簿或目录应用程序中的信息。vCard格式经过多次修订,最近的版本是vCard 4。

As certain similarities exist between vCard and the iCalendar data format [RFC5545], there is also an effort to define a JSON-based data format for calendar information called jCal [JCAL] that parallels the format defined in this specification. The term "JSON" describes the JavaScript Object Notation defined in [RFC4627].

由于vCard和iCalendar数据格式[RFC5545]之间存在某些相似之处,因此还需要为日历信息定义一种基于JSON的数据格式,称为jCal[jCal],与本规范中定义的格式平行。术语“JSON”描述了[RFC4627]中定义的JavaScript对象表示法。

The purpose of this specification is to define "jCard", a JSON format for vCard data. One main advantage to using a JSON-based format over the classic vCard format is easier processing for JavaScript-based widgets and libraries, especially in the scope of web-based applications.

本规范的目的是定义“jCard”,一种用于vCard数据的JSON格式。与传统vCard格式相比,使用基于JSON的格式的一个主要优势是更容易处理基于JavaScript的小部件和库,尤其是在基于web的应用程序范围内。

The key design considerations are essentially the same as those for [JCAL] and [RFC6321], that is:

关键设计考虑事项基本上与[JCAL]和[RFC6321]相同,即:

Round-tripping (converting a vCard instance to jCard and back) will give the same semantic result as the starting point. For example, all components, properties, and property parameters are guaranteed to be preserved.

往返(将vCard实例转换为jCard并返回)将给出与起点相同的语义结果。例如,保证保留所有组件、特性和特性参数。

The Ordering of elements and the case of property and parameter names will not necessarily be preserved.

元素的顺序以及属性和参数名称的大小写不一定会保留。

The vCard data semantics are to be preserved, allowing a simple consumer to easily browse the data in jCard. A full understanding of vCard is still required in order to modify and/or fully comprehend the directory data.

vCard数据语义将被保留,允许简单的使用者轻松浏览jCard中的数据。为了修改和/或完全理解目录数据,仍然需要完全理解vCard。

Extensions to the underlying vCard specification must not lead to requiring an update to jCard.

对基础vCard规范的扩展不得导致需要更新jCard。

2. Conventions Used in This Document
2. 本文件中使用的公约

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

The underlying format used for jCard is JSON. Consequently, the terms "object" and "array" as well as the four primitive types (strings, numbers, booleans, and null) are to be interpreted as described in Section 1 of [RFC4627].

jCard使用的底层格式是JSON。因此,术语“对象”和“数组”以及四种基本类型(字符串、数字、布尔值和null)将按照[RFC4627]第1节中的描述进行解释。

Some examples in this document contain "partial" JSON documents used for illustrative purposes. In these examples, three periods "..." are used to indicate a portion of the document that has been removed for compactness.

本文档中的一些示例包含用于说明目的的“部分”JSON文档。在这些示例中,三个句号“…”用于表示文档中为紧凑而删除的部分。

3. Converting from vCard to jCard
3. 从vCard转换为jCard

This section describes how vCard objects are converted to jCard using a simple mapping between the vCard data model and JSON elements.

本节介绍如何使用vCard数据模型和JSON元素之间的简单映射将vCard对象转换为jCard。

In [RFC6350], vCard objects are comprised of a set of "properties", "parameters", and "values". The top level of a vCard object contains "properties". A "property" has a "value" and a set of zero or more "parameters". Each of these entities has a representation in jCard, defined in the following sections. The representation of a vCard object in JSON will be named "jCard object" throughout this document.

在[RFC6350]中,vCard对象由一组“属性”、“参数”和“值”组成。vCard对象的顶层包含“属性”。“属性”有一个“值”和一组零个或多个“参数”。这些实体中的每一个都在jCard中有一个表示,定义见以下部分。在本文档中,vCard对象在JSON中的表示形式将命名为“jCard对象”。

3.1. Pre-processing
3.1. 预处理

vCard uses a line-folding mechanism to limit lines of data to a maximum line length (typically 75 octets) to ensure maximum likelihood of preserving data integrity as it is transported via various means (e.g., email) -- see Section 3.2 of [RFC6350].

vCard使用折线机制将数据行限制在最大行长(通常为75个八位字节),以确保通过各种方式(如电子邮件)传输数据时最大可能保持数据完整性——请参见[RFC6350]第3.2节。

vCard data uses an "escape" character sequence for text values and property parameter values. See Section 3.4 of [RFC6350] as well as [RFC6868].

vCard数据对文本值和属性参数值使用“转义”字符序列。参见[RFC6350]第3.4节以及[RFC6868]。

When converting from vCard to jCard, first vCard lines MUST be unfolded. Afterwards, any vCard escaping MUST be unescaped. Finally, JSON escaping (e.g., for control characters) MUST be applied.

从vCard转换为jCard时,必须展开第一行vCard。之后,任何vCard逃逸都必须被清除。最后,必须应用JSON转义(例如,对于控制字符)。

The reverse order applies when converting from jCard to vCard. First, JSON escaping MUST be unescaped. Afterwards, vCard escaping MUST be applied. Finally, long lines SHOULD be folded as described in [RFC6350].

从jCard转换为vCard时,应用相反的顺序。首先,必须取消JSON转义。之后,必须使用vCard转义。最后,应按照[RFC6350]中的说明折叠长线。

One key difference in the formatting of values used in vCard and jCard is that in jCard the specification uses date/time values aligned with the extended format of [ISO.8601.2004], which is more commonly used in Internet applications that make use of the JSON format. The sections of this document describing the various date and time formats contain more information on the use of the complete representation, reduced accuracy, or truncated representation.

vCard和jCard中使用的值格式的一个关键区别是,在jCard中,规范使用与[ISO.8601.2004]扩展格式一致的日期/时间值,这在使用JSON格式的互联网应用程序中更常用。本文档中描述各种日期和时间格式的部分包含有关使用完整表示法、降低精度或截断表示法的更多信息。

3.2. jCard Object and Syntactic Entities (RFC 6350, Sections 6.1.1 and 6.1.2)

3.2. jCard对象和语法实体(RFC 6350,第6.1.1和6.1.2节)

In Sections 6.1.1 and 6.1.2 of [RFC6350], the BEGIN and END properties delimit a syntactic vCard entity. In jCard, each syntactic entity is represented by an array with two elements and is named "jCard object". The first element is the string "vcard", and the second element is an array of jCard properties as described in Section 3.3, belonging to the entity.

在[RFC6350]的第6.1.1节和第6.1.2节中,开始和结束属性定义了语法vCard实体。在jCard中,每个语法实体由一个包含两个元素的数组表示,并命名为“jCard对象”。第一个元素是字符串“vcard”,第二个元素是属于实体的jCard属性数组,如第3.3节所述。

Although [RFC6350] defines BEGIN and END to be properties, they MUST NOT appear as properties of the jCard. Instead, the jCard object is sufficient to define a vCard entity. When converting from jCard to vCard, the BEGIN and END properties MUST be added to enclose the properties of the jCard object.

尽管[RFC6350]将BEGIN和END定义为属性,但它们不能显示为jCard的属性。相反,jCard对象足以定义vCard实体。从jCard转换为vCard时,必须添加开始和结束属性以包含jCard对象的属性。

Example:

例子:

   ["vcard", [
     /* Add properties in place of this comment */
     ]
   ]
        
   ["vcard", [
     /* Add properties in place of this comment */
     ]
   ]
        

Consumers of this format wishing to define content that can represent multiple jCard objects within the same JSON document can use a simple JSON array, each element being a single jCard object.

这种格式的使用者希望定义可以在同一个JSON文档中表示多个jCard对象的内容,可以使用一个简单的JSON数组,每个元素都是一个jCard对象。

3.3. Properties (RFC 6350, Section 6)
3.3. 财产(RFC 6350,第6节)

Each individual vCard property is represented in jCard by an array with three fixed elements, followed by one or more additional elements, depending on if the property is a multi-valued property as described in Section 3.3 of [RFC6350].

根据[RFC6350]第3.3节所述的属性是否为多值属性,每个vCard属性在jCard中由一个包含三个固定元素的数组表示,后跟一个或多个附加元素。

The array consists of the following fixed elements:

阵列由以下固定元素组成:

1. The name of the property, as a lowercase string. The vCard format specifies that property names are case insensitive and recommends that they be rendered in uppercase. In jCard, they MUST be in lowercase.

1. 属性的名称,以小写字符串表示。vCard格式指定属性名称不区分大小写,并建议以大写形式呈现。在jCard中,它们必须是小写的。

2. An object containing the parameters as described in Section 3.4. If the property has no parameters, an empty object is used to represent that.

2. 包含第3.4节所述参数的对象。如果属性没有参数,则使用空对象表示该属性。

3. The type identifier string of the value, in lowercase. It is important that parsers check this to determine the data type of the value and that they do not rely on assumptions. For example, for structured values, the data type will be "array".

3. 值的类型标识符字符串,小写。重要的是,解析器检查这一点以确定值的数据类型,并且不依赖于假设。例如,对于结构化值,数据类型将是“数组”。

The remaining elements of the array are used for one or more values of the property. For single-value properties, the array has exactly four elements; for multi-valued properties, each value is another element, and there can be any number of additional elements.

数组的其余元素用于属性的一个或多个值。对于单值属性,数组正好有四个元素;对于多值属性,每个值都是另一个元素,可以有任意数量的附加元素。

In the following example, the "categories" property is multi-valued and has two values, while all other properties are single-valued:

在以下示例中,“类别”属性是多值的,有两个值,而所有其他属性都是单值的:

   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["fn", {}, "text", "John Doe"],
       ["gender", {}, "text", "M"],
       ["categories", {}, "text", "computers", "cameras"],
       ...
     ]
   ]
        
   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["fn", {}, "text", "John Doe"],
       ["gender", {}, "text", "M"],
       ["categories", {}, "text", "computers", "cameras"],
       ...
     ]
   ]
        

As described in Section 3.3.1.3, a property value may be a structured property value, in which case it is represented as an array encapsulated in the array that represents the overall property.

如第3.3.1.3节所述,属性值可以是结构化属性值,在这种情况下,它表示为封装在表示整体属性的数组中的数组。

Strictly speaking, this means that the property value is not represented in the format indicated by the type identifier but by an array instead. However, the values inside the encapsulated array are of the format identified by the type identifier.

严格来说,这意味着属性值不是用类型标识符指示的格式表示的,而是用数组表示的。但是,封装数组中的值是由类型标识符标识的格式。

The above also holds for multi-valued properties, where some of the values may be structured property values and therefore are represented as an encapsulated array.

上述内容也适用于多值属性,其中一些值可能是结构化属性值,因此表示为封装数组。

A special case is where a value in an encapsulated array consists of multiple components itself, in which case it is represented as yet another nested array, with elements matching the value type. Section 3.3.1.3 describes this in more detail.

一种特殊情况是,封装数组中的值本身由多个组件组成,在这种情况下,它表示为另一个嵌套数组,元素与值类型匹配。第3.3.1.3节对此进行了更详细的描述。

The above illustrates that it's important for the parser to check the format of each property value, as it might either directly match the value type, or it might be a structured value where nested subelements match the value type.

上面说明了解析器检查每个属性值的格式很重要,因为它可能直接匹配值类型,也可能是嵌套子元素匹配值类型的结构化值。

3.3.1. Special Cases for Properties
3.3.1. 财产的特殊情况

This section describes some properties that have special handling when converting to jCard.

本节介绍一些在转换为jCard时具有特殊处理的属性。

3.3.1.1. The VERSION Property
3.3.1.1. 版本属性

The vCard format specification [RFC6350] defines the "VERSION" property to be mandatory. The jCard "version" property MUST be represented in the corresponding jCard component, with the same value as in the vCard. vCards that conform to RFC 6350 will contain the value "4.0".

vCard格式规范[RFC6350]将“版本”属性定义为强制性。jCard“version”属性必须在相应的jCard组件中表示,其值与vCard中的值相同。符合RFC 6350的vCard将包含值“4.0”。

Also in accordance to [RFC6350], the "version" property MUST be the first element of the array containing the properties of a jCard.

同样根据[RFC6350],version属性必须是包含jCard属性的数组的第一个元素。

3.3.1.2. Grouping of Properties
3.3.1.2. 财产分组

In vCard [RFC6350], related properties can be grouped together using a grouping construct. The grouping is accomplished by adding a prefix (which consists of the group name followed by a dot) to the property name.

在vCard[RFC6350]中,可以使用分组构造将相关属性分组在一起。分组是通过在属性名中添加前缀(由组名后跟一个点组成)来完成的。

In jCard, the same grouping is achieved through a "group" parameter that holds the group name. In jCard, a property name therefore MUST NOT be prefixed by a group name.

在jCard中,通过保存组名的“group”参数实现相同的分组。因此,在jCard中,属性名不能以组名作为前缀。

The "GROUP" parameter MUST NOT be used in vCard; as per [RFC6350], it is merely registered to reserve the parameter, avoiding collisions. Formal registration of the "GROUP" parameter is described in Section 7.1.

vCard中不得使用“GROUP”参数;根据[RFC6350],它只是注册以保留参数,从而避免冲突。第7.1节描述了“组”参数的正式注册。

3.3.1.2.1. Group Conversion Rules
3.3.1.2.1. 组转换规则

In jCard, the parameter's value is a single opaque string. Conversion rules are as follows:

在jCard中,参数的值是一个不透明的字符串。转换规则如下:

o From vCard to jCard, the group construct (see [RFC6350], Section 3.3) is removed. In its place, the "group" parameter is used. Its value is a string corresponding to the group name, which is case insensitive both in vCard and jCard. The name's case SHOULD be converted into lowercase.

o 从vCard到jCard,删除了组结构(见[RFC6350],第3.3节)。取而代之的是“组”参数。它的值是与组名对应的字符串,在vCard和jCard中都不区分大小写。名称的大小写应转换为小写。

o When converting from jCard to vCard, the value of the "group" parameter followed by a dot is prefixed to the property name, and the "group" parameter is discarded. The "GROUP" parameter MUST NOT appear in the resulting vCard. Following the recommendations in [RFC6350], the name's case SHOULD be converted into uppercase.

o 从jCard转换为vCard时,“group”参数值后跟一个点将作为属性名称的前缀,而“group”参数将被丢弃。“GROUP”参数不得出现在生成的vCard中。按照[RFC6350]中的建议,名称的大小写应转换为大写。

Example:

例子:

CONTACT.FN:Mr. John Q. Public\, Esq.

联系人:John Q.Public先生,Esq。

is equivalent to:

相当于:

   [ "fn", { "group": "CONTACT" }, "text", "Mr. John Q. Public, Esq." ]
        
   [ "fn", { "group": "CONTACT" }, "text", "Mr. John Q. Public, Esq." ]
        
3.3.1.3. Structured Property Values
3.3.1.3. 结构化属性值

The vCard specification defines properties with structured values, for example, "GENDER" or "ADR". In vCard, a structured text value consists of one or multiple text components, delimited by the SEMICOLON character. Its equivalent in jCard is a structured property value, which is an array containing one element for each text component, with empty/missing text components represented by zero-length strings.

vCard规范使用结构化值定义属性,例如“性别”或“ADR”。在vCard中,结构化文本值由一个或多个文本组件组成,由分号字符分隔。它在jCard中的等价物是一个结构化属性值,它是一个数组,每个文本组件包含一个元素,空/缺失的文本组件由零长度字符串表示。

vCard Example:

vCard示例:

ADR:;;123 Main Street;Any Town;CA;91921-1234;U.S.A.

药品不良反应:;;主街123号;;任何城镇;钙;91921-1234;美国

jCard Example:

jCard示例:

["adr", {}, "text", [ "", "", "123 Main Street", "Any Town", "CA", "91921-1234", "U.S.A." ] ]

[“adr”、{}、“text”、[“”、“”、“、123大街”、“任何城镇”、“CA”、“91921-1234”、“美国”]

Some vCard properties, for example, ADR, also allow a structured value element that itself has multiple values. In this case, the element of the array describing the structured value is itself an array with one element for each of the component's multiple values.

某些vCard属性(例如ADR)还允许一个本身具有多个值的结构化值元素。在这种情况下,描述结构化值的数组元素本身就是一个数组,每个组件的多个值对应一个元素。

vCard Example:

vCard示例:

ADR:;;My Street,Left Side,Second Shack;Hometown;PA;18252;U.S.A.

药品不良反应:;;我的街道,左边,第二间小屋;家乡帕18252;美国

jCard Example:

jCard示例:

   ["adr", {}, "text",
     [
     "", "",
     ["My Street", "Left Side", "Second Shack"],
     "Hometown", "PA", "18252", "U.S.A."
     ]
   ]
        
   ["adr", {}, "text",
     [
     "", "",
     ["My Street", "Left Side", "Second Shack"],
     "Hometown", "PA", "18252", "U.S.A."
     ]
   ]
        

In both cases, the array element values MUST have the primitive type that matches the jCard type identifier. In [RFC6350], there are only structured text values and thus only JSON strings are used. For example, extensions may define structured number or boolean values, where JSON number or boolean types MUST be used.

在这两种情况下,数组元素值必须具有与jCard类型标识符匹配的基元类型。在[RFC6350]中,只有结构化文本值,因此只使用JSON字符串。例如,扩展可以定义结构化数字或布尔值,其中必须使用JSON数字或布尔类型。

Although it is allowed for a structured property value to hold just one component, it is RECOMMENDED to represent it as a single text value instead, omitting the array completely. Nevertheless, a simple implementation MAY choose to retain the array, with a single text value as its element.

虽然允许结构化属性值仅包含一个组件,但建议将其表示为单个文本值,完全忽略数组。然而,一个简单的实现可能会选择保留数组,使用单个文本值作为其元素。

Similarly, structured values that consist of two text components with one being optional (for example, "GENDER") can be represented as a single text value. Therefore, parsers of jCard data SHOULD check even known property values for structured information by considering the JSON data type of the value, which can be an array or a primitive value. This is especially important for languages where accessing array members is done by the same construct as accessing characters of a string.

类似地,由两个文本组件组成的结构化值(其中一个是可选的)(例如,“性别”)可以表示为单个文本值。因此,jCard数据的解析器应该通过考虑值的JSON数据类型(可以是数组或原语值)来检查结构化信息的已知属性值。这对于访问数组成员与访问字符串字符的构造相同的语言尤其重要。

Examples:

示例:

   ["gender", {}, "text", ["F", "grrrl"] ],
   ["gender", {}, "text", "M" ]
        
   ["gender", {}, "text", ["F", "grrrl"] ],
   ["gender", {}, "text", "M" ]
        

Per Section 6.3.1 of [RFC6350], the component separator MUST be specified even if the component value is missing. Similarly, the jCard array containing the structured data MUST contain all required elements, even if they are empty.

根据[RFC6350]第6.3.1节,即使缺少组件值,也必须指定组件分隔符。类似地,包含结构化数据的jCard数组必须包含所有必需的元素,即使它们是空的。

vCard Example:

vCard示例:

   ADR;LABEL="123 Maple Ave\nSuite 901\nVancouver BC\nA1B 2C9\nCan
    ada":;;;;;;
        
   ADR;LABEL="123 Maple Ave\nSuite 901\nVancouver BC\nA1B 2C9\nCan
    ada":;;;;;;
        

jCard Example:

jCard示例:

["adr", {"label":"123 Maple Ave\nSuite 901\nVancouver BC\nA1B 2C9\nCanada"}, "text", ["", "", "", "", "", "", ""] ]

[“adr”,{“标签”:“枫叶大道123号\n安苏特901\n安古弗公元前\nA1B 2C9\nCanada”},“文本”,[“”,“”,“”,“”,“”,“”,“”,“”,“”]

3.4. Parameters (RFC 6350, Section 5)
3.4. 参数(RFC 6350,第5节)

Property parameters are represented as a JSON object where each key-value pair represents the vCard parameter name and its value. The name of the parameter MUST be in lowercase; the original case of the parameter value MUST be preserved. For example, the "LANGUAGE" property parameter is represented in jCard by the "language" key. Any new vCard parameters added in the future will be converted in the same way.

属性参数表示为JSON对象,其中每个键值对表示vCard参数名称及其值。参数名称必须为小写;必须保留参数值的原始大小写。例如,“LANGUAGE”属性参数在jCard中由“LANGUAGE”键表示。将来添加的任何新vCard参数都将以相同的方式进行转换。

Example:

例子:

   ["role", { "language": "tr" }, "text", "roca"],
        
   ["role", { "language": "tr" }, "text", "roca"],
        
3.4.1. VALUE Parameter
3.4.1. 值参数

vCard defines a "VALUE" property parameter (Section 5.2 of [RFC6350]). This property parameter MUST NOT be added to the parameters object. Instead, the value type is signaled through the type identifier in the third element of the array describing the property. When converting a property from vCard to jCard, the value type is determined as follows:

vCard定义了一个“值”属性参数(见[RFC6350]第5.2节)。不得将此属性参数添加到parameters对象中。相反,值类型通过描述属性的数组的第三个元素中的类型标识符发出信号。将特性从vCard转换为jCard时,值类型确定如下:

1. If the property has a "VALUE" parameter, that parameter's value is used as the value type.

1. 如果属性具有“值”参数,则该参数的值将用作值类型。

2. If the property has no "VALUE" parameter but has a default value type, the default value type is used.

2. 如果属性没有“值”参数,但具有默认值类型,则使用默认值类型。

3. If the property has no "VALUE" parameter and has no default value type, "unknown" is used.

3. 如果属性没有“VALUE”参数,也没有默认值类型,则使用“unknown”。

Converting from jCard into vCard is done as follows:

从jCard转换为vCard的过程如下:

1. If the property's value type is "unknown", no "VALUE" parameter is included.

1. 如果属性的值类型为“未知”,则不包括“值”参数。

2. If the property's value type is the default type for that property, no "VALUE" parameter is included.

2. 如果属性的值类型是该属性的默认类型,则不包括“值”参数。

3. Otherwise, a "VALUE" parameter is included, and the value type is used as the parameter value.

3. 否则,将包含一个“值”参数,并将值类型用作参数值。

See Section 5 for information on handling unknown value types.

有关处理未知值类型的信息,请参见第5节。

3.4.2. Multi-Valued Parameters
3.4.2. 多值参数

In [RFC6350], some parameters allow using a comma-separated list of values. To ease processing in jCard, the value for such parameters MUST be represented in an array containing the separated values. The array elements MUST be string values. Single-value parameters SHOULD be represented using a single string value, although a more simple implementation might prefer an array with one string element. An example of such a parameter is the vCard "SORT-AS" parameter; more such parameters may be added in extensions.

在[RFC6350]中,一些参数允许使用逗号分隔的值列表。为了简化jCard中的处理,这些参数的值必须在包含分隔值的数组中表示。数组元素必须是字符串值。单值参数应该使用单个字符串值来表示,尽管更简单的实现可能更喜欢具有一个字符串元素的数组。此类参数的一个示例是vCard“SORT-AS”参数;可以在扩展中添加更多这样的参数。

The vCard specification requires encapsulation between DQUOTE characters if a parameter value contains a colon, a semicolon, or a comma. These extra DQUOTE characters do not belong to the actual parameter value and hence are not included when the parameter is converted to jCard.

如果参数值包含冒号、分号或逗号,vCard规范要求在DQUOTE字符之间进行封装。这些额外的DQUOTE字符不属于实际参数值,因此在将参数转换为jCard时不包括在内。

Example:

例子:

   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["n",
        { "sort-as": ["Harten", "Rene"] },
        "text",
        ["van der Harten", "Rene", "J.", "Sir", "R.D.O.N."]
       ],
       ["fn", {}, "text", "Rene van der Harten"]
       ...
     ]
   ]
        
   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["n",
        { "sort-as": ["Harten", "Rene"] },
        "text",
        ["van der Harten", "Rene", "J.", "Sir", "R.D.O.N."]
       ],
       ["fn", {}, "text", "Rene van der Harten"]
       ...
     ]
   ]
        
3.5. Values (RFC 6350, Section 4)
3.5. 数值(RFC 6350,第4节)

The following subsections specify how vCard property value data types (which are defined in Section 4 of [RFC6350]) are represented in jCard.

以下小节指定如何在jCard中表示vCard属性值数据类型(在[RFC6350]第4节中定义)。

3.5.1. Text (RFC 6350, Section 4.1)
3.5.1. 文本(RFC 6350,第4.1节)

Description: vCard "TEXT" property values are represented by a property with the type identifier "text". The value elements are JSON strings. For details on structured text values, see Section 3.3.1.3.

说明:vCard“TEXT”属性值由类型标识符为“TEXT”的属性表示。值元素是JSON字符串。有关结构化文本值的详细信息,请参见第3.3.1.3节。

Example:

例子:

["kind", {}, "text", "group"]

[“种类”、{}、“文本”、“组”]

3.5.2. URI (RFC 6350, Section 4.2)
3.5.2. URI(RFC 6350,第4.2节)

Description: vCard "URI" property values are represented by a property with the type identifier "uri". The value elements are JSON strings.

描述:vCard“URI”属性值由类型标识符为“URI”的属性表示。值元素是JSON字符串。

Example:

例子:

   ["source", {}, "uri", "ldap://ldap.example.com/cn=babs%20jensen"]
        
   ["source", {}, "uri", "ldap://ldap.example.com/cn=babs%20jensen"]
        
3.5.3. Date (RFC 6350, Section 4.3.1)
3.5.3. 日期(RFC 6350,第4.3.1节)

Description: vCard "DATE" property values are represented by a property with the type identifier "date". The value elements are JSON strings with the same date value specified by [RFC6350], but represented using the extended format specified in [ISO.8601.2004], Section 4.1.2. If the complete representation is not used, the same date format restrictions regarding reduced accuracy, truncated representation, and expanded representation noted in [RFC6350], Section 4.3.1 apply. Whenever the extended format is not applicable, the basic format MUST be used.

说明:vCard“DATE”属性值由类型标识符为“DATE”的属性表示。值元素是JSON字符串,具有[RFC6350]指定的相同日期值,但使用[ISO.8601.2004]第4.1.2节中指定的扩展格式表示。如果未使用完整的表示法,则[RFC6350]第4.3.1节中关于精度降低、表示法截断和表示法扩展的相同日期格式限制适用。当扩展格式不适用时,必须使用基本格式。

ABNF syntax:

ABNF语法:

date-complete = year "-" month "-" day ;YYYY-MM-DD

完成日期=年“-”月“-”日;YYYY-MM-DD

   date-noreduc = date-complete
              / "--" month "-" day ; --MM-DD
              / "---" day          ; ---DDD
        
   date-noreduc = date-complete
              / "--" month "-" day ; --MM-DD
              / "---" day          ; ---DDD
        
   date = date-noreduc
      / year; YYYY
      / year "-" month ; YYYY-MM
      / "--" month     ; --MM
        
   date = date-noreduc
      / year; YYYY
      / year "-" month ; YYYY-MM
      / "--" month     ; --MM
        

Examples:

示例:

   ["bday", {}, "date", "1985-04-12"],
   ["bday", {}, "date", "1985-04"],
   ["bday", {}, "date", "1985"],
   ["bday", {}, "date", "--04-12"],
   ["bday", {}, "date", "---12"]
        
   ["bday", {}, "date", "1985-04-12"],
   ["bday", {}, "date", "1985-04"],
   ["bday", {}, "date", "1985"],
   ["bday", {}, "date", "--04-12"],
   ["bday", {}, "date", "---12"]
        

This table contains possible conversions between the vCard DATE format and jCard date. This information is just an example and not a formal specification of the syntax. The specification can be found in [ISO.8601.2000] and [ISO.8601.2004].

此表包含vCard日期格式和jCard日期之间可能的转换。这些信息只是一个示例,而不是语法的正式规范。该规范可在[ISO.8601.2000]和[ISO.8601.2004]中找到。

                   +-----------+----------+------------+
                   |           | vCard    | jCard      |
                   +-----------+----------+------------+
                   | Complete  | 19850412 | 1985-04-12 |
                   |           |          |            |
                   | Reduced   | 1985-04  | 1985-04    |
                   |           |          |            |
                   | Reduced   | 1985     | 1985       |
                   |           |          |            |
                   | Truncated | --0412   | --04-12    |
                   |           |          |            |
                   | Truncated | --04     | --04       |
                   |           |          |            |
                   | Truncated | ---12    | ---12      |
                   +-----------+----------+------------+
        
                   +-----------+----------+------------+
                   |           | vCard    | jCard      |
                   +-----------+----------+------------+
                   | Complete  | 19850412 | 1985-04-12 |
                   |           |          |            |
                   | Reduced   | 1985-04  | 1985-04    |
                   |           |          |            |
                   | Reduced   | 1985     | 1985       |
                   |           |          |            |
                   | Truncated | --0412   | --04-12    |
                   |           |          |            |
                   | Truncated | --04     | --04       |
                   |           |          |            |
                   | Truncated | ---12    | ---12      |
                   +-----------+----------+------------+
        
3.5.4. Time (RFC 6350, Section 4.3.2)
3.5.4. 时间(RFC 6350,第4.3.2节)

Description: vCard "TIME" property values are represented by a property with the type identifier "time". The value elements are JSON strings with the same time value specified by [RFC6350], but represented using the extended format specified in [ISO.8601.2004], Section 4.2. If the complete representation is not used, the same time format restrictions regarding reduced accuracy, decimal fraction, and truncated representation noted in [RFC6350], Section 4.3.2 apply. Whenever the extended format is not applicable, the basic format MUST be used. The seconds value of 60 MUST only be used to account for positive "leap" seconds, and the midnight hour is always represented by 00, never 24. Fractions of a second are not supported by this format. In jCard, UTC offsets are permitted within a time value; note that this differs from jCal [JCAL], where they are not permitted.

说明:vCard“TIME”属性值由类型标识符为“TIME”的属性表示。值元素是JSON字符串,具有[RFC6350]指定的相同时间值,但使用[ISO.8601.2004]第4.2节中指定的扩展格式表示。如果未使用完整表示法,则[RFC6350]第4.3.2节中所述的关于精度降低、小数点和截断表示法的相同时间格式限制适用。当扩展格式不适用时,必须使用基本格式。秒值60只能用于说明正“闰”秒,并且午夜小时始终由00表示,而不是24。此格式不支持几分之一秒。在jCard中,允许UTC偏移在时间值内;请注意,这与jCal[jCal]不同,后者是不允许的。

ABNF syntax:

ABNF语法:

   time-notrunc =  hour [":" minute [":" second]] [zone]
        
   time-notrunc =  hour [":" minute [":" second]] [zone]
        
   time = time-notrunc
      / "-" minute ":" second [zone]; -mm:ss
      / "-" minute [zone]; -mm
      / "--" second [zone]; --ss
        
   time = time-notrunc
      / "-" minute ":" second [zone]; -mm:ss
      / "-" minute [zone]; -mm
      / "--" second [zone]; --ss
        

Examples:

示例:

   ["x-time-local", {}, "time", "12:30:00"],
   ["x-time-utc", {}, "time", "12:30:00Z"],
   ["x-time-offset", {}, "time", "12:30:00-08:00"],
   ["x-time-reduced", {}, "time", "23"],
   ["x-time-truncated", {}, "time", "-30"]
        
   ["x-time-local", {}, "time", "12:30:00"],
   ["x-time-utc", {}, "time", "12:30:00Z"],
   ["x-time-offset", {}, "time", "12:30:00-08:00"],
   ["x-time-reduced", {}, "time", "23"],
   ["x-time-truncated", {}, "time", "-30"]
        

This table contains possible conversions between the vCard TIME format and jCard time. This information is just an example and not a formal specification of the syntax. The specification can be found in [ISO.8601.2000] and [ISO.8601.2004].

此表包含vCard时间格式和jCard时间之间可能的转换。这些信息只是一个示例,而不是语法的正式规范。该规范可在[ISO.8601.2000]和[ISO.8601.2004]中找到。

                     +-----------+--------+----------+
                     |           | vCard  | jCard    |
                     +-----------+--------+----------+
                     | Complete  | 232050 | 23:20:50 |
                     |           |        |          |
                     | Reduced   | 2320   | 23:20    |
                     |           |        |          |
                     | Reduced   | 23     | 23       |
                     |           |        |          |
                     | Truncated | -2050  | -20:50   |
                     |           |        |          |
                     | Truncated | -20    | -20      |
                     |           |        |          |
                     | Truncated | --50   | --50     |
                     +-----------+--------+----------+
        
                     +-----------+--------+----------+
                     |           | vCard  | jCard    |
                     +-----------+--------+----------+
                     | Complete  | 232050 | 23:20:50 |
                     |           |        |          |
                     | Reduced   | 2320   | 23:20    |
                     |           |        |          |
                     | Reduced   | 23     | 23       |
                     |           |        |          |
                     | Truncated | -2050  | -20:50   |
                     |           |        |          |
                     | Truncated | -20    | -20      |
                     |           |        |          |
                     | Truncated | --50   | --50     |
                     +-----------+--------+----------+
        

Also, all combinations may have any zone designator appended, as in the complete representation.

此外,所有组合可以附加任何区域指示符,如在完整表示中。

3.5.5. Date-Time (RFC 6350, Section 4.3.3)
3.5.5. 日期时间(RFC 6350,第4.3.3节)

Description: vCard "DATE-TIME" property values are represented by a property with the type identifier "date-time". The value elements are JSON strings with the same date value specified by [RFC6350], but represented using the extended format specified in [ISO.8601.2004], Section 4.3. If the complete representation is

说明:vCard“DATE-TIME”属性值由类型标识符为“DATE-TIME”的属性表示。值元素是JSON字符串,具有[RFC6350]指定的相同日期值,但使用[ISO.8601.2004]第4.3节中指定的扩展格式表示。如果完整的表示是

not used, the same date and time format restrictions noted in Sections 3.5.3 and 3.5.4 apply. Just as described in [RFC6350], truncation of the date part is permitted.

未使用,第3.5.3节和第3.5.4节中注明的相同日期和时间格式限制适用。正如[RFC6350]中所述,允许截断日期部分。

Example:

例子:

   ["anniversary", {}, "date-time", "2013-02-14T12:30:00"],
   ["anniversary", {}, "date-time", "2013-01-10T19:00:00Z"],
   ["anniversary", {}, "date-time", "2013-08-15T09:45:00+01:00"],
   ["anniversary", {}, "date-time", "---15T09:45:00+01:00"]
        
   ["anniversary", {}, "date-time", "2013-02-14T12:30:00"],
   ["anniversary", {}, "date-time", "2013-01-10T19:00:00Z"],
   ["anniversary", {}, "date-time", "2013-08-15T09:45:00+01:00"],
   ["anniversary", {}, "date-time", "---15T09:45:00+01:00"]
        

This table contains possible conversions between the vCard DATE-TIME format and jCard date-time. This information is just an example and not a formal specification of the syntax. The specification can be found in [ISO.8601.2000] and [ISO.8601.2004].

此表包含vCard日期时间格式和jCard日期时间格式之间可能的转换。这些信息只是一个示例,而不是语法的正式规范。该规范可在[ISO.8601.2000]和[ISO.8601.2004]中找到。

   +----------------+----------------------+---------------------------+
   | Representation | vCard                | jCard                     |
   +----------------+----------------------+---------------------------+
   | Complete       | 19850412T232050      | 1985-04-12T23:20:50       |
   |                |                      |                           |
   | Complete       | 19850412T232050Z     | 1985-04-12T23:20:50Z      |
   |                |                      |                           |
   | Complete       | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
   |                |                      |                           |
   | Complete       | 19850412T232050+04   | 1985-04-12T23:20:50+04    |
   |                |                      |                           |
   | Reduced        | 19850412T2320        | 1985-04-12T23:20          |
   |                |                      |                           |
   | Reduced        | 19850412T23          | 1985-04-12T23             |
   |                |                      |                           |
   | Truncated and  | --0412T2320          | --04-12T23:20             |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --04T2320            | --04T23:20                |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | ---12T2320           | ---12T23:20               |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --0412T2320          | --04-12T23:20             |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --04T23              | --04T23                   |
   | Reduced        |                      |                           |
   +----------------+----------------------+---------------------------+
        
   +----------------+----------------------+---------------------------+
   | Representation | vCard                | jCard                     |
   +----------------+----------------------+---------------------------+
   | Complete       | 19850412T232050      | 1985-04-12T23:20:50       |
   |                |                      |                           |
   | Complete       | 19850412T232050Z     | 1985-04-12T23:20:50Z      |
   |                |                      |                           |
   | Complete       | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
   |                |                      |                           |
   | Complete       | 19850412T232050+04   | 1985-04-12T23:20:50+04    |
   |                |                      |                           |
   | Reduced        | 19850412T2320        | 1985-04-12T23:20          |
   |                |                      |                           |
   | Reduced        | 19850412T23          | 1985-04-12T23             |
   |                |                      |                           |
   | Truncated and  | --0412T2320          | --04-12T23:20             |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --04T2320            | --04T23:20                |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | ---12T2320           | ---12T23:20               |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --0412T2320          | --04-12T23:20             |
   | Reduced        |                      |                           |
   |                |                      |                           |
   | Truncated and  | --04T23              | --04T23                   |
   | Reduced        |                      |                           |
   +----------------+----------------------+---------------------------+
        

As specified in [ISO.8601.2000], the lower-order components may not be omitted in the date part (reduced accuracy) and the higher-order components may not be omitted in the time part (truncation). Also, all combinations may have any zone designator appended, as in the complete representation.

如[ISO.8601.2000]所述,日期部分(精度降低)中不得省略低阶分量,时间部分(截断)中不得省略高阶分量。此外,所有组合可以附加任何区域指示符,如在完整表示中。

3.5.6. Date and/or Time (RFC 6350, Section 4.3.4)
3.5.6. 日期和/或时间(RFC 6350,第4.3.4节)

Description: vCard "DATE-AND-OR-TIME" property values are represented by a property with the type identifier "date-and-or-time". The value elements are either a date-time (Section 3.5.5), a date (Section 3.5.3), or a time (Section 3.5.4) value. Just as described in Section 4.3.4 of [RFC6350], a stand-alone time value MUST always be preceded by a "T".

说明:vCard“DATE-AND-OR-TIME”属性值由类型标识符为“DATE-AND-OR-TIME”的属性表示。值元素为日期时间(第3.5.5节)、日期(第3.5.3节)或时间(第3.5.4节)值。正如[RFC6350]第4.3.4节所述,独立时间值必须始终以“T”开头。

Example:

例子:

   ["bday", {}, "date-and-or-time", "2013-02-14T12:30:00"],
   ["bday", {}, "date-and-or-time", "---22T14:00"]
   ["bday", {}, "date-and-or-time", "1985"],
   ["bday", {}, "date-and-or-time", "T12:30"]
        
   ["bday", {}, "date-and-or-time", "2013-02-14T12:30:00"],
   ["bday", {}, "date-and-or-time", "---22T14:00"]
   ["bday", {}, "date-and-or-time", "1985"],
   ["bday", {}, "date-and-or-time", "T12:30"]
        
3.5.7. Timestamp (RFC 6350, Section 4.3.5)
3.5.7. 时间戳(RFC 6350,第4.3.5节)

Description: vCard "TIMESTAMP" property values are represented by a property with the type identifier "timestamp". The value elements are JSON strings with the same timestamp value specified by [RFC6350], but represented using the extended format and complete representation specified in [ISO.8601.2004], Section 4.3.2.

描述:vCard“TIMESTAMP”属性值由类型标识符为“TIMESTAMP”的属性表示。值元素是JSON字符串,具有[RFC6350]指定的相同时间戳值,但使用[ISO.8601.2004]第4.3.2节中指定的扩展格式和完整表示进行表示。

Example:

例子:

   ["rev", {}, "timestamp", "2013-02-14T12:30:00"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00Z"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00-05"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00-05:00"]
        
   ["rev", {}, "timestamp", "2013-02-14T12:30:00"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00Z"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00-05"],
   ["rev", {}, "timestamp", "2013-02-14T12:30:00-05:00"]
        

This table contains possible conversions between the vCard TIMESTAMP format and jCard timestamp. This information is just an example and not a formal specification of the syntax. The specification can be found in [ISO.8601.2000] and [ISO.8601.2004].

此表包含vCard时间戳格式和jCard时间戳之间的可能转换。这些信息只是一个示例,而不是语法的正式规范。该规范可在[ISO.8601.2000]和[ISO.8601.2004]中找到。

   +----------------+----------------------+---------------------------+
   | Representation | vCard                | jCard                     |
   +----------------+----------------------+---------------------------+
   | Complete       | 19850412T232050      | 1985-04-12T23:20:50       |
   |                |                      |                           |
   | Complete       | 19850412T232050Z     | 1985-04-12T23:20:50Z      |
   |                |                      |                           |
   | Complete       | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
   |                |                      |                           |
   | Complete       | 19850412T232050+04   | 1985-04-12T23:20:50+04    |
   +----------------+----------------------+---------------------------+
        
   +----------------+----------------------+---------------------------+
   | Representation | vCard                | jCard                     |
   +----------------+----------------------+---------------------------+
   | Complete       | 19850412T232050      | 1985-04-12T23:20:50       |
   |                |                      |                           |
   | Complete       | 19850412T232050Z     | 1985-04-12T23:20:50Z      |
   |                |                      |                           |
   | Complete       | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
   |                |                      |                           |
   | Complete       | 19850412T232050+04   | 1985-04-12T23:20:50+04    |
   +----------------+----------------------+---------------------------+
        
3.5.8. Boolean (RFC 6350, Section 4.4)
3.5.8. 布尔值(RFC 6350,第4.4节)

Description: vCard "BOOLEAN" property values are represented by a property with the type identifier "boolean". The value element is a JSON boolean value.

说明:vCard“BOOLEAN”属性值由类型标识符为“BOOLEAN”的属性表示。value元素是一个JSON布尔值。

Example:

例子:

["x-non-smoking", {}, "boolean", true]

[“x-非吸烟区,{},“布尔”,真]

3.5.9. Integer (RFC 6350, Section 4.5)
3.5.9. 整数(RFC 6350,第4.5节)

Description: vCard "INTEGER" property values are represented by a property with the type identifier "integer". The value elements are JSON primitive number values.

说明:vCard“INTEGER”属性值由类型标识符为“INTEGER”的属性表示。value元素是JSON原语数字值。

Examples:

示例:

["x-karma-points", {}, "integer", 42]

[“x-karma-points”,{},“integer”,42]

JSON allows decimals (e.g., 3.14) and exponents (e.g., 2e10) to be used in numeric values. jCard does not prohibit this for "integer" property values. However, since vCard does not support decimals or exponents in integers, any decimals and exponents MUST be eliminated when converting an "integer" value type property from jCard to vCard.

JSON允许在数值中使用小数(如3.14)和指数(如2e10)。jCard不禁止对“整数”属性值执行此操作。但是,由于vCard不支持整数中的小数或指数,因此在将“整型”值类型属性从jCard转换为vCard时,必须消除任何小数和指数。

3.5.10. Float (RFC 6350, Section 4.6)
3.5.10. 浮子(RFC 6350,第4.6节)

Description: vCard "FLOAT" property values are represented by a property with the type identifier "float". The value elements are JSON primitive number values.

说明:vCard“FLOAT”属性值由类型标识符为“FLOAT”的属性表示。value元素是JSON原语数字值。

Example:

例子:

["x-grade", {}, "float", 1.3]

[“x级”,{},“浮动”,1.3]

JSON allows exponents (e.g., 2e10) to be used in numeric values. jCard does not prohibit this for "float" property values. However, since vCard does not support exponents in floats, any exponents MUST be eliminated when converting a "float" value type property from jCard to vCard.

JSON允许在数值中使用指数(例如2e10)。jCard不禁止对“float”属性值执行此操作。但是,由于vCard不支持浮点中的指数,因此在将“float”值类型属性从jCard转换为vCard时,必须消除任何指数。

3.5.11. UTC Offset (RFC 6350, Section 4.7)
3.5.11. UTC偏移量(RFC 6350,第4.7节)

Description: vCard "UTC-OFFSET" property values are represented by a property with the type identifier "utc-offset". The value elements are JSON strings with the same UTC offset value specified by [RFC6350], with the exception that the hour and minute components are separated by a ":" character, for consistency with the [ISO.8601.2004] timezone offset, extended format.

说明:vCard“UTC-OFFSET”属性值由类型标识符为“UTC OFFSET”的属性表示。值元素是JSON字符串,具有与[RFC6350]指定的UTC偏移值相同的UTC偏移值,但小时和分钟分量由“:”字符分隔,以与[ISO.8601.2004]时区偏移保持一致,扩展格式除外。

Example:

例子:

   // Note: [RFC6350] mentions use of utc-offset
   // for the TZ property as NOT RECOMMENDED
   ["tz", {}, "utc-offset", "-05:00"]
        
   // Note: [RFC6350] mentions use of utc-offset
   // for the TZ property as NOT RECOMMENDED
   ["tz", {}, "utc-offset", "-05:00"]
        
3.5.12. Language Tag (RFC 6350, Section 4.8)
3.5.12. 语言标签(RFC 6350,第4.8节)

Description: vCard "LANGUAGE-TAG" property values are represented by a property with the type identifier "language-tag". The value elements are JSON strings containing a single language-tag, as defined in [RFC5646].

说明:vCard“LANGUAGE-TAG”属性值由类型标识符为“LANGUAGE-TAG”的属性表示。值元素是包含单个语言标记的JSON字符串,如[RFC5646]中所定义。

Example:

例子:

["lang", {}, "language-tag", "de"]

[“lang”,{},“语言标记”,“de”]

3.6. Extensions (RFC 6350, Section 6.10)
3.6. 扩展(RFC 6350,第6.10节)

vCard extension properties and property parameters (those with an "X-" prefix in their name) are handled in the same way as other properties and property parameters: the property is represented by an array, the property parameter represented by an object. The property or parameter name uses the same name as for the vCard extension, but in lowercase. For example, the "X-FOO" property in vCard turns into the "x-foo" jCard property. See Section 5 for how to deal with default values for unrecognized extension properties or property parameters.

vCard扩展属性和属性参数(名称中带有“X-”前缀的属性和参数)的处理方式与其他属性和属性参数相同:属性由数组表示,属性参数由对象表示。属性或参数名称使用与vCard扩展名相同的名称,但使用小写形式。例如,vCard中的“X-FOO”属性变为“X-FOO”jCard属性。有关如何处理无法识别的扩展属性或属性参数的默认值,请参见第5节。

4. Converting from jCard into vCard
4. 从jCard转换为vCard

When converting property and property parameter values, the names SHOULD be converted to uppercase. Although vCard names are case insensitive, common practice is to keep them all uppercase following the actual definitions in [RFC6350].

转换属性和属性参数值时,名称应转换为大写。尽管vCard名称不区分大小写,但通常的做法是按照[RFC6350]中的实际定义将它们全部大写。

Character escaping and line folding MUST be applied to the resulting vCard data as required by [RFC6350] and [RFC6868].

按照[RFC6350]和[RFC6868]的要求,必须对生成的vCard数据应用字符转义和行折叠。

When converting to vCard, the "VALUE" parameter MUST be added to properties whose default value type is unknown but do not have a jCard type identifier "unknown". The "VALUE" parameter MAY be omitted for properties using the default value type. The "VALUE" parameter MUST be omitted for properties that have the jCard type identifier "unknown".

转换为vCard时,必须将“VALUE”参数添加到默认值类型未知但没有jCard类型标识符“unknown”的属性中。对于使用默认值类型的属性,可以省略“VALUE”参数。对于jCard类型标识符为“未知”的属性,必须省略“VALUE”参数。

5. Handling Unrecognized Properties or Parameters
5. 处理无法识别的属性或参数

In vCard, properties can have one or more value types as specified by their definition, with one of those values being defined as the default. When a property uses its default value type, the "VALUE" property parameter does not need to be specified on the property. For example, "BDAY"'s default value type is "date-and-or-time", so "VALUE=date-and-or-time" need not be set as a property parameter. However, "BDAY" also allows a "text" value to be specified, and if that is used, "VALUE=text" has to be set as a property parameter.

在vCard中,属性可以有一个或多个由其定义指定的值类型,其中一个值定义为默认值。当属性使用其默认值类型时,不需要在属性上指定“value”属性参数。例如,“BDAY”的默认值类型是“date and or time”,因此“value=date and or time”不需要设置为属性参数。但是,“BDAY”还允许指定“text”值,如果使用该值,“value=text”必须设置为属性参数。

When new properties are defined or "X-" properties used, a vCard-to-jCard converter might not recognize them, and not know what the appropriate default value types are, yet it needs to be able to preserve the values. A similar issue arises for unrecognized property parameters.

当定义新属性或使用“X-”属性时,vCard到jCard转换器可能无法识别它们,并且不知道适当的默认值类型是什么,但它需要能够保留这些值。对于无法识别的属性参数,也会出现类似的问题。

In jCard, a new "unknown" property value type is introduced. Its purpose is to allow preserving unknown property values when round-tripping between jCard and vCard. To avoid collisions, this specification reserves the "UNKNOWN" property value type in vCard. It MUST NOT be used in any vCard as specified by [RFC6350], nor any extensions to it. The type is hence registered to the "vCard Value Data Types" registry; see Section 7.2.

在jCard中,引入了一种新的“未知”属性值类型。其目的是允许在jCard和vCard之间往返时保留未知的属性值。为避免冲突,本规范在vCard中保留“未知”属性值类型。不得在[RFC6350]规定的任何vCard中使用,也不得在其任何扩展中使用。因此,该类型被注册到“vCard值数据类型”注册表中;见第7.2节。

5.1. Converting vCard into jCard
5.1. 将vCard转换为jCard

Any property that does not include a "VALUE" property parameter and whose default value type is not known MUST be converted to a primitive JSON string. The content of that string is the unprocessed value text. Also, value type MUST be set to "unknown".

任何不包含“VALUE”属性参数且其默认值类型未知的属性都必须转换为基本JSON字符串。该字符串的内容是未处理的值文本。此外,值类型必须设置为“未知”。

To correctly implement this format, it's critical to use the value type "unknown" when the default value type is not known. If this requirement is ignored and, for example, "text" is used, additional escaping may occur that breaks round-tripping values.

要正确实现此格式,当默认值类型未知时,使用值类型“unknown”至关重要。如果忽略此要求,例如使用“文本”,则可能会发生额外的转义,从而中断往返值。

Any unrecognized property parameter MUST be converted to a string value, with its content set to the property parameter value text, treated as if it were a "TEXT" value.

任何无法识别的属性参数必须转换为字符串值,其内容设置为属性参数值文本,并将其视为“文本”值。

5.2. Converting jCard into vCard
5.2. 将jCard转换为vCard

In jCard, the value type is always explicitly specified. It is converted to vCard using the vCard "VALUE" parameter, except in the following two cases:

在jCard中,值类型总是显式指定的。使用vCard“VALUE”参数将其转换为vCard,以下两种情况除外:

o If the value type specified in jCard matches the default value type in vCard, the "VALUE" parameter MAY be omitted.

o 如果jCard中指定的值类型与vCard中的默认值类型匹配,则可以省略“value”参数。

o If the value type specified in jCard is set to "unknown", the "VALUE" parameter MUST NOT be specified. The value MUST be taken over in vCard without processing.

o 如果jCard中指定的值类型设置为“未知”,则不得指定“值”参数。必须在vCard中接收该值而不进行处理。

5.3. Examples
5.3. 例子

The following is an example of an unrecognized vCard property (that uses a "URI" value as its default), and the equivalent jCard representation of that property.

以下是无法识别的vCard属性(使用“URI”值作为其默认值)的示例,以及该属性的等效jCard表示形式。

vCard:

vCard:

   X-COMPLAINT-URI:mailto:abuse@example.org
        
   X-COMPLAINT-URI:mailto:abuse@example.org
        

jCard:

jCard:

   ["x-complaint-uri", {}, "unknown", "mailto:abuse@example.org"]
        
   ["x-complaint-uri", {}, "unknown", "mailto:abuse@example.org"]
        

The following is an example of how to cope with jCard data where the parser was unable to identify the value type. Note how the "unknown" value type is not added to the vCard data, and escaping, aside from standard JSON string escaping, is not processed.

下面是一个示例,说明如何处理解析器无法识别值类型的jCard数据。请注意,“未知”值类型是如何不添加到vCard数据的,并且除了标准JSON字符串转义之外,转义也不会被处理。

jCard:

jCard:

   ["x-coffee-data", {}, "unknown", "Stenophylla;Guinea\\,Africa"]
        
   ["x-coffee-data", {}, "unknown", "Stenophylla;Guinea\\,Africa"]
        

vCard:

vCard:

X-COFFEE-DATA:Stenophylla;Guinea\,Africa

X-咖啡-数据:狭叶藻;几内亚\非洲

There are no standard properties in [RFC6350] that have a default type of integer. Consequently, this example uses the following extended property that we treat as having a default type (namely, integer) known to the parser in order to illustrate how a property with a known default type would be transformed.

[RFC6350]中没有默认类型为整数的标准属性。因此,本例使用以下扩展属性,我们将其视为解析器已知的默认类型(即整数),以说明如何转换具有已知默认类型的属性。

jCard:

jCard:

["x-karma-points", {}, "integer", 95]

[“x-karma-points”,{},“整数”,95]

vCard:

vCard:

X-KARMA-POINTS:95

X-业力积分:95

The following is an example of an unrecognized vCard property parameter (that uses a "FLOAT" value as its default) specified on a recognized vCard property, and the equivalent jCard representation of that property and property parameter.

以下是在已识别vCard属性上指定的未识别vCard属性参数(使用“FLOAT”值作为其默认值)的示例,以及该属性和属性参数的等效jCard表示形式。

vCard:

vCard:

   GENDER;X-PROBABILITY=0.8:M
        
   GENDER;X-PROBABILITY=0.8:M
        

jCard:

jCard:

   ["gender", { "x-probability": "0.8" }, "text", "M"]
        
   ["gender", { "x-probability": "0.8" }, "text", "M"]
        
6. Security Considerations
6. 安全考虑

This specification defines how vCard data can be "translated" between two different data formats -- the original text format and JSON -- with a one-to-one mapping to ensure all the semantic data in one format (properties, parameters, and values) are preserved in the other. It does not change the semantic meaning of the underlying data itself, or impose or remove any security considerations that apply to the underlying data.

本规范定义了vCard数据如何在两种不同的数据格式(原始文本格式和JSON)之间进行“转换”,并通过一对一的映射确保一种格式(属性、参数和值)中的所有语义数据都保留在另一种格式中。它不会更改基础数据本身的语义,也不会强加或删除适用于基础数据的任何安全注意事项。

The use of JSON as a format does have its own inherent security risks as discussed in Section 7 of [RFC4627]. Even though JSON is considered a safe subset of JavaScript, it should be kept in mind that a flaw in the parser for JSON data could still impose a threat that doesn't arise with conventional vCard data.

如[RFC4627]第7节所述,使用JSON作为格式确实有其固有的安全风险。尽管JSON被认为是JavaScript的一个安全子集,但应该记住,JSON数据解析器中的一个缺陷仍然可能带来传统vCard数据所没有的威胁。

With this in mind when using jCard, the parser for JSON data should be aware of the security implications. For example, the use of JavaScript's eval() function is only allowed using the regular expression in Section 6 of [RFC4627]. A native parser with full awareness of the JSON format should be preferred.

在使用jCard时,考虑到这一点,JSON数据的解析器应该知道安全含义。例如,仅允许使用[RFC4627]第6节中的正则表达式使用JavaScript的eval()函数。最好使用完全了解JSON格式的本机解析器。

In addition, it is expected that this new format will result in vCard data being more widely disseminated (e.g., with use in web applications rather than just dedicated "contact managers").

此外,预计这种新格式将使vCard数据得到更广泛的传播(例如,在web应用程序中使用,而不仅仅是专门的“联系人经理”)。

In all cases, application developers have to conform to the semantics of the vCard data as defined by [RFC6350] and associated extensions, and all of the security considerations described in Section 9 of [RFC6350], or any associated extensions, are applicable.

在所有情况下,应用程序开发人员必须遵守[RFC6350]和相关扩展定义的vCard数据语义,并且[RFC6350]第9节或任何相关扩展中描述的所有安全注意事项都适用。

7. IANA Considerations
7. IANA考虑

This document defines a MIME media type for use with vCard in JSON data. This media type SHOULD be used for the transfer of calendaring data in JSON.

本文档定义了用于JSON数据中vCard的MIME媒体类型。此媒体类型应用于传输JSON中的日历数据。

Type name: application

类型名称:应用程序

Subtype name: vcard+json

子类型名称:vcard+json

Required parameters: none

所需参数:无

Optional parameters: "version", as defined for the text/vcard media type in [RFC6350], Section 10.1.

可选参数:“版本”,如[RFC6350]第10.1节中文本/vcard介质类型所定义。

Encoding considerations: Same as encoding considerations of application/json as specified in [RFC4627], Section 6.

编码注意事项:与[RFC4627]第6节中指定的应用程序/json的编码注意事项相同。

Security considerations: See Section 6.

安全注意事项:见第6节。

Interoperability considerations: This media type provides an alternative format for vCard data based on JSON.

互操作性注意事项:这种媒体类型为基于JSON的vCard数据提供了另一种格式。

Published specification: This specification.

已发布规范:本规范。

Applications which use this media type: Applications that currently make use of the text/vcard media type can use this as an alternative. Similarly, applications that use the application/ json media type to transfer directory data can use this to further specify the content.

使用此媒体类型的应用程序:当前使用text/vcard媒体类型的应用程序可以使用此作为替代。类似地,使用application/json媒体类型传输目录数据的应用程序可以使用它来进一步指定内容。

Fragment identifier considerations: N/A

片段标识符注意事项:不适用

Additional information:

其他信息:

Deprecated alias names for this type: N/A

此类型的已弃用别名:不适用

      Magic number(s):  N/A
        
      Magic number(s):  N/A
        
      File extension(s):  N/A
        
      File extension(s):  N/A
        
      Macintosh file type code(s):  N/A
        
      Macintosh file type code(s):  N/A
        

Person & email address to contact for further information: vcarddav@ietf.org

Person & email address to contact for further information: vcarddav@ietf.orgtranslate error, please retry

Intended usage: COMMON

预期用途:普通

Restrictions on usage: There are no restrictions on where this media type can be used.

使用限制:此媒体类型的使用位置没有限制。

Author: See the "Author's Address" section of this document.

作者:请参阅本文件的“作者地址”部分。

Change controller: IETF

更改控制器:IETF

7.1. GROUP vCard Parameter
7.1. 组vCard参数

IANA has added the "GROUP" parameter to the "vCard Parameters" registry, initialized in Section 10.3.2 of [RFC6350]. Usage of the "GROUP" parameter is further described in Section 3.3.1.2 of this document.

IANA已将“组”参数添加到“vCard参数”注册表中,并在[RFC6350]第10.3.2节中进行了初始化。本文件第3.3.1.2节进一步说明了“组”参数的用法。

   Namespace:  <empty>
        
   Namespace:  <empty>
        

Parameter name: GROUP

参数名称:组

Purpose: To simplify the jCard format.

目的:简化jCard格式。

Description: The "GROUP" parameter is reserved for the exclusive use of the jCard format described in this document. It MUST NOT be used in plain vCard [RFC6350], nor in xCard [RFC6351].

说明:“GROUP”参数仅供本文档中描述的jCard格式使用。不得在普通vCard[RFC6350]或xCard[RFC6351]中使用。

Format definition: When converting from jCard to vCard, the value of the "GROUP" parameter is used as part of the property name. Therefore, the value is restricted to characters allowed in property names, namely ALPHA, DIGIT, and "-" characters. When used, the "GROUP" parameter MUST NOT be empty.

格式定义:从jCard转换为vCard时,“GROUP”参数的值用作属性名称的一部分。因此,该值仅限于属性名称中允许的字符,即字母、数字和“-”字符。使用时,“GROUP”参数不得为空。

Example: As this registration serves as a reservation of the "GROUP" parameter so that it is not used in vCard, there is no applicable vCard example. Examples of its usage in jCard can be found in this document.

示例:由于此注册作为“GROUP”参数的保留,因此不在vCard中使用,因此没有适用的vCard示例。在jCard中使用它的示例可以在本文档中找到。

7.2. UNKNOWN vCard Value Data Type
7.2. 未知vCard值数据类型

IANA has added the "UNKNOWN" value data type to the "vCard Value Data Types" registry, initialized in Section 10.3.3 of [RFC6350]. Usage of the "UNKNOWN" type is further described in Section 5 of this document.

IANA已将“未知”值数据类型添加到“vCard值数据类型”注册表中,并在[RFC6350]第10.3.3节中进行了初始化。本文件第5节进一步说明了“未知”类型的用法。

Value name: UNKNOWN

值名称:未知

Purpose: To allow preserving property values whose default value type is not known during round-tripping between jCard and vCard.

目的:允许在jCard和vCard之间的往返过程中保留默认值类型未知的属性值。

Format definition: (Not applicable)

格式定义:(不适用)

Description: The "UNKNOWN" value data type is reserved for the exclusive use of the jCard format. It MUST NOT be used in plain vCard [RFC6350].

说明:“未知”值数据类型保留为jCard格式的专用数据类型。不得在普通vCard[RFC6350]中使用。

Example: As this registration serves as a reservation of the "UNKNOWN" type so that it is not used in vCard, there is no applicable vCard example. Examples of its usage in jCard can be found in this document.

示例:由于此注册作为“未知”类型的保留,因此不在vCard中使用,因此没有适用的vCard示例。在jCard中使用它的示例可以在本文档中找到。

8. Acknowledgments
8. 致谢

The author would like to thank the following for their valuable contributions: Cyrus Daboo, Mike Douglass, William Gill, Erwin Rehme, Dave Thewlis, Simon Perreault, Michael Angstadt, Peter Saint-Andre, Bert Greevenbosch, and Javier Godoy. This specification originated from the work of the XML-JSON technical committee of the Calendaring and Scheduling Consortium.

作者要感谢以下人士的宝贵贡献:赛勒斯·达布、迈克·道格拉斯、威廉·吉尔、欧文·雷姆、戴夫·泰利斯、西蒙·佩雷尔特、迈克尔·安斯塔特、彼得·圣安德烈、伯特·格里文博什和哈维尔·戈多伊。本规范源于日历和调度联盟XML-JSON技术委员会的工作。

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[ISO.8601.2000] International Organization for Standardization, "Data elements and interchange formats -- Information interchange -- Representation of dates and times", ISO 8601, December 2000.

[ISO.8601.2000]国际标准化组织,“数据元素和交换格式——信息交换——日期和时间的表示”,ISO 8601,2000年12月。

[ISO.8601.2004] International Organization for Standardization, "Data elements and interchange formats -- Information interchange -- Representation of dates and times", ISO 8601, December 2004.

[ISO.8601.2004]国际标准化组织,“数据元素和交换格式——信息交换——日期和时间的表示”,ISO 8601,2004年12月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC4627] Crockford, D., "The application/json Media Type for JavaScript Object Notation (JSON)", RFC 4627, July 2006.

[RFC4627]Crockford,D.,“JavaScript对象表示法(json)的应用程序/json媒体类型”,RFC4627,2006年7月。

[RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,2008年1月。

[RFC5646] Phillips, A. and M. Davis, "Tags for Identifying Languages", BCP 47, RFC 5646, September 2009.

[RFC5646]Phillips,A.和M.Davis,“识别语言的标记”,BCP 47,RFC 5646,2009年9月。

[RFC6350] Perreault, S., "vCard Format Specification", RFC 6350, August 2011.

[RFC6350]Perreault,S.,“vCard格式规范”,RFC 63502011年8月。

[RFC6868] Daboo, C., "Parameter Value Encoding in iCalendar and vCard", RFC 6868, February 2013.

[RFC6868]Daboo,C.,“iCalendar和vCard中的参数值编码”,RFC 6868,2013年2月。

9.2. Informative References
9.2. 资料性引用

[JCAL] Kewisch, P., Daboo, C., and M. Douglass, "jCal: The JSON format for iCalendar", Work in Progress, December 2013.

[JCAL]Kewisch,P.,Daboo,C.,和M.Douglass,“JCAL:iCalendar的JSON格式”,正在进行的工作,2013年12月。

[RFC5545] Desruisseaux, B., "Internet Calendaring and Scheduling Core Object Specification (iCalendar)", RFC 5545, September 2009.

[RFC5545]Desruisseaux,B.“互联网日历和调度核心对象规范(iCalendar)”,RFC 55452009年9月。

[RFC6321] Daboo, C., Douglass, M., and S. Lees, "xCal: The XML Format for iCalendar", RFC 6321, August 2011.

[RFC6321]Daboo,C.,Douglass,M.,和S.Lees,“xCal:iCalendar的XML格式”,RFC 63212011年8月。

[RFC6351] Perreault, S., "xCard: vCard XML Representation", RFC 6351, August 2011.

[RFC6351]Perreault,S.,“xCard:vCard XML表示”,RFC6351,2011年8月。

[calconnect-artifacts] The Calendaring and Scheduling Consortium, "Code Artifacts and Schemas", <http://www.calconnect.org/artifacts.shtml>.

[calconnect artifacts]日历和调度联盟,“代码工件和模式”<http://www.calconnect.org/artifacts.shtml>.

Appendix A. ABNF Syntax
附录A.ABNF语法

Below is the ABNF syntax as per [RFC5234] for vCard in JSON. ABNF symbols not described here are taken from [RFC4627]. The syntax is non-normative and given for reference only.

以下是JSON中vCard的[RFC5234]ABNF语法。此处未描述的ABNF符号取自[RFC4627]。语法不规范,仅供参考。

The numeric section numbers given in the comments refer to sections in [RFC6350]. Additional semantic restrictions apply, especially regarding the allowed properties and subcomponents per component. Details on these restrictions can be found in this document and [RFC6350].

注释中给出的数字章节号参考[RFC6350]中的章节。附加语义限制适用,特别是关于每个组件允许的属性和子组件。有关这些限制的详细信息,请参见本文件和[RFC6350]。

Additional ABNF syntax may be available on the Internet at [calconnect-artifacts].

其他ABNF语法可在互联网[calconnect artifacts]上获得。

   ; A jCard object uses the name "vcard" and a properties array.
   ; Restrictions to which properties may be specified are to
   ; be taken from RFC 6350.
   jcardobject = begin-array
                 DQUOTE component-name DQUOTE value-separator
                 properties-array
                 end-array
        
   ; A jCard object uses the name "vcard" and a properties array.
   ; Restrictions to which properties may be specified are to
   ; be taken from RFC 6350.
   jcardobject = begin-array
                 DQUOTE component-name DQUOTE value-separator
                 properties-array
                 end-array
        

; A jCard property consists of the name string, parameters object, ; type string, and one or more values as specified in this document. property = begin-array DQUOTE property-name DQUOTE value-separator params-object value-separator DQUOTE type-name DQUOTE property-value *(value-separator property-value) end-array properties-array = begin-array [ property *(value-separator property) ] end-array

; jCard属性由名称字符串、参数对象和;键入字符串和本文档中指定的一个或多个值。属性=开始数组DQUOTE属性名称DQUOTE值分隔符参数对象值分隔符DQUOTE类型名称DQUOTE属性值*(值分隔符属性值)结束数组属性数组=开始数组[属性*(值分隔符属性)]结束数组

   ; Property values depend on the type-name. Aside from the value types
   ; mentioned here, extensions may make use of other JSON value types.
   property-value = simple-prop-value / structured-prop-value
   simple-prop-value = string / number / true / false
   structured-prop-value =
       begin-array
       [ structured-element *(value-separator structured-element) ]
       end-array
        
   ; Property values depend on the type-name. Aside from the value types
   ; mentioned here, extensions may make use of other JSON value types.
   property-value = simple-prop-value / structured-prop-value
   simple-prop-value = string / number / true / false
   structured-prop-value =
       begin-array
       [ structured-element *(value-separator structured-element) ]
       end-array
        

; Each structured element may have multiple values if ; semantically allowed. structured-element = simple-prop-value / structured-multi-prop

; 每个结构化元素可能有多个值,如果:;语义上允许的。结构化元素=简单属性值/结构化多属性

structured-multi-prop = begin-array [ simple-prop-value *(value-separator simple-prop-value) ] end-array

结构化多属性=开始数组[简单属性值*(值分隔符简单属性值)]结束数组

; The jCard params-object is a JSON object that follows the semantic ; guidelines described in this document. params-object = begin-object [ params-member *(value-separator params-member) ] end-object params-member = DQUOTE param-name DQUOTE name-separator param-value param-value = string / param-multi param-multi = begin-array [ string *(value-separator string) ] end-array

; jCard params对象是遵循语义的JSON对象;本文件中描述的指南。params object=begin object[params member*(值分隔符params member)]end object params member=DQUOTE参数名称DQUOTE名称分隔符param value param value=string/param multi=begin数组[string*(值分隔符string)]end数组

   ; The type MUST be a valid type as described by this document. New
   ; value types can be added by extensions.
   type-name = "text" / "uri" / "date" / "time" / "date-time" /
               "boolean" / "integer" / "float" / "utc-offset" /
               "language-tag" / x-type
        
   ; The type MUST be a valid type as described by this document. New
   ; value types can be added by extensions.
   type-name = "text" / "uri" / "date" / "time" / "date-time" /
               "boolean" / "integer" / "float" / "utc-offset" /
               "language-tag" / x-type
        
   ; Property, parameter, and type names MUST be lowercase. Additional
   ; semantic restrictions apply as described by this document and
   ; RFC 6350.
   component-name = lowercase-name
   property-name = lowercase-name
   param-name = lowercase-name
   x-type = lowercase-name
   lowercase-name = 1*(%x61-7A / DIGIT / "-")
        
   ; Property, parameter, and type names MUST be lowercase. Additional
   ; semantic restrictions apply as described by this document and
   ; RFC 6350.
   component-name = lowercase-name
   property-name = lowercase-name
   param-name = lowercase-name
   x-type = lowercase-name
   lowercase-name = 1*(%x61-7A / DIGIT / "-")
        
Appendix B. Examples
附录B.示例

This section contains an example of a vCard object with its jCard representation.

本节包含vCard对象及其jCard表示的示例。

B.1. Example: vCard of the Author of RFC 6350
B.1. 示例:RFC6350作者的vCard
B.1.1. vCard Data
B.1.1. vCard数据
   BEGIN:VCARD
   VERSION:4.0
   FN:Simon Perreault
   N:Perreault;Simon;;;ing. jr,M.Sc.
   BDAY:--0203
   ANNIVERSARY:20090808T1430-0500
   GENDER:M
   LANG;PREF=1:fr
        
   BEGIN:VCARD
   VERSION:4.0
   FN:Simon Perreault
   N:Perreault;Simon;;;ing. jr,M.Sc.
   BDAY:--0203
   ANNIVERSARY:20090808T1430-0500
   GENDER:M
   LANG;PREF=1:fr
        
   LANG;PREF=2:en
   ORG;TYPE=work:Viagenie
   ADR;TYPE=work:;Suite D2-630;2875 Laurier;
    Quebec;QC;G1V 2M2;Canada
   TEL;VALUE=uri;TYPE="work,voice";PREF=1:tel:+1-418-656-9254;ext=102
   TEL;VALUE=uri;TYPE="work,cell,voice,video,text":tel:+1-418-262-6501
   EMAIL;TYPE=work:simon.perreault@viagenie.ca
   GEO;TYPE=work:geo:46.772673,-71.282945
   KEY;TYPE=work;VALUE=uri:
    http://www.viagenie.ca/simon.perreault/simon.asc
   TZ:-0500
   URL;TYPE=home:http://nomis80.org
   END:VCARD
        
   LANG;PREF=2:en
   ORG;TYPE=work:Viagenie
   ADR;TYPE=work:;Suite D2-630;2875 Laurier;
    Quebec;QC;G1V 2M2;Canada
   TEL;VALUE=uri;TYPE="work,voice";PREF=1:tel:+1-418-656-9254;ext=102
   TEL;VALUE=uri;TYPE="work,cell,voice,video,text":tel:+1-418-262-6501
   EMAIL;TYPE=work:simon.perreault@viagenie.ca
   GEO;TYPE=work:geo:46.772673,-71.282945
   KEY;TYPE=work;VALUE=uri:
    http://www.viagenie.ca/simon.perreault/simon.asc
   TZ:-0500
   URL;TYPE=home:http://nomis80.org
   END:VCARD
        
B.1.2. jCard Data
B.1.2. jCard数据
   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["fn", {}, "text", "Simon Perreault"],
       ["n",
         {},
         "text",
         ["Perreault", "Simon", "", "", ["ing. jr", "M.Sc."]]
       ],
       ["bday", {}, "date-and-or-time", "--02-03"],
       ["anniversary",
         {},
         "date-and-or-time",
         "2009-08-08T14:30:00-05:00"
       ],
       ["gender", {}, "text", "M"],
       ["lang", { "pref": "1" }, "language-tag", "fr"],
       ["lang", { "pref": "2" }, "language-tag", "en"],
       ["org", { "type": "work" }, "text", "Viagenie"],
       ["adr",
          { "type": "work" },
          "text",
          [
           "",
           "Suite D2-630",
           "2875 Laurier",
           "Quebec",
           "QC",
           "G1V 2M2",
           "Canada"
          ]
       ],
        
   ["vcard",
     [
       ["version", {}, "text", "4.0"],
       ["fn", {}, "text", "Simon Perreault"],
       ["n",
         {},
         "text",
         ["Perreault", "Simon", "", "", ["ing. jr", "M.Sc."]]
       ],
       ["bday", {}, "date-and-or-time", "--02-03"],
       ["anniversary",
         {},
         "date-and-or-time",
         "2009-08-08T14:30:00-05:00"
       ],
       ["gender", {}, "text", "M"],
       ["lang", { "pref": "1" }, "language-tag", "fr"],
       ["lang", { "pref": "2" }, "language-tag", "en"],
       ["org", { "type": "work" }, "text", "Viagenie"],
       ["adr",
          { "type": "work" },
          "text",
          [
           "",
           "Suite D2-630",
           "2875 Laurier",
           "Quebec",
           "QC",
           "G1V 2M2",
           "Canada"
          ]
       ],
        
       ["tel",
         { "type": ["work", "voice"], "pref": "1" },
         "uri",
         "tel:+1-418-656-9254;ext=102"
       ],
       ["tel",
         { "type": ["work", "cell", "voice", "video", "text"] },
         "uri",
         "tel:+1-418-262-6501"
       ],
       ["email",
         { "type": "work" },
         "text",
         "simon.perreault@viagenie.ca"
       ],
       ["geo", { "type": "work" }, "uri", "geo:46.772673,-71.282945"],
       ["key",
         { "type": "work" },
         "uri",
         "http://www.viagenie.ca/simon.perreault/simon.asc"
       ],
       ["tz", {}, "utc-offset", "-05:00"],
       ["url", { "type": "home" }, "uri", "http://nomis80.org"]
     ]
   ]
        
       ["tel",
         { "type": ["work", "voice"], "pref": "1" },
         "uri",
         "tel:+1-418-656-9254;ext=102"
       ],
       ["tel",
         { "type": ["work", "cell", "voice", "video", "text"] },
         "uri",
         "tel:+1-418-262-6501"
       ],
       ["email",
         { "type": "work" },
         "text",
         "simon.perreault@viagenie.ca"
       ],
       ["geo", { "type": "work" }, "uri", "geo:46.772673,-71.282945"],
       ["key",
         { "type": "work" },
         "uri",
         "http://www.viagenie.ca/simon.perreault/simon.asc"
       ],
       ["tz", {}, "utc-offset", "-05:00"],
       ["url", { "type": "home" }, "uri", "http://nomis80.org"]
     ]
   ]
        

Author's Address

作者地址

Philipp Kewisch Mozilla Corporation 650 Castro Street, Suite 300 Mountain View, CA 94041 USA

美国加利福尼亚州山景城卡斯特罗街650号300室Philipp Kewisch Mozilla Corporation 94041

   EMail: mozilla@kewis.ch
   URI:   http://www.mozilla.org/
        
   EMail: mozilla@kewis.ch
   URI:   http://www.mozilla.org/