1
2
3
4
5
6
7Internet Engineering Task Force (IETF) P. Kewisch
8Request for Comments: 7095 Mozilla
9Category: Standards Track January 2014
10ISSN: 2070-1721
11
12
13 jCard: The JSON Format for vCard
14
15Abstract
16
17 This specification defines "jCard", a JSON format for vCard data.
18 The vCard data format is a text format for representing and
19 exchanging information about individuals and other entities, for
20 example, telephone numbers, email addresses, structured names, and
21 delivery addresses. JSON is a lightweight, text-based, language-
22 independent data interchange format commonly used in Internet
23 applications.
24
25Status of This Memo
26
27 This is an Internet Standards Track document.
28
29 This document is a product of the Internet Engineering Task Force
30 (IETF). It represents the consensus of the IETF community. It has
31 received public review and has been approved for publication by the
32 Internet Engineering Steering Group (IESG). Further information on
33 Internet Standards is available in Section 2 of RFC 5741.
34
35 Information about the current status of this document, any errata,
36 and how to provide feedback on it may be obtained at
37 http://www.rfc-editor.org/info/rfc7095.
38
39Copyright Notice
40
41 Copyright (c) 2014 IETF Trust and the persons identified as the
42 document authors. All rights reserved.
43
44 This document is subject to BCP 78 and the IETF Trust's Legal
45 Provisions Relating to IETF Documents
46 (http://trustee.ietf.org/license-info) in effect on the date of
47 publication of this document. Please review these documents
48 carefully, as they describe your rights and restrictions with respect
49 to this document. Code Components extracted from this document must
50 include Simplified BSD License text as described in Section 4.e of
51 the Trust Legal Provisions and are provided without warranty as
52 described in the Simplified BSD License.
53
54
55
56
57
58Kewisch Standards Track [Page 1]
59
60RFC 7095 jCard January 2014
61
62
63Table of Contents
64
65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
66 2. Conventions Used in This Document . . . . . . . . . . . . . . 3
67 3. Converting from vCard to jCard . . . . . . . . . . . . . . . 4
68 3.1. Pre-processing . . . . . . . . . . . . . . . . . . . . . 4
69 3.2. jCard Object and Syntactic Entities (RFC 6350, Sections
70 6.1.1 and 6.1.2) . . . . . . . . . . . . . . . . . . . . 5
71 3.3. Properties (RFC 6350, Section 6) . . . . . . . . . . . . 5
72 3.3.1. Special Cases for Properties . . . . . . . . . . . . 7
73 3.3.1.1. The VERSION Property . . . . . . . . . . . . . . 7
74 3.3.1.2. Grouping of Properties . . . . . . . . . . . . . 7
75 3.3.1.3. Structured Property Values . . . . . . . . . . . 8
76 3.4. Parameters (RFC 6350, Section 5) . . . . . . . . . . . . 10
77 3.4.1. VALUE Parameter . . . . . . . . . . . . . . . . . . . 10
78 3.4.2. Multi-Valued Parameters . . . . . . . . . . . . . . . 11
79 3.5. Values (RFC 6350, Section 4) . . . . . . . . . . . . . . 11
80 3.5.1. Text (RFC 6350, Section 4.1) . . . . . . . . . . . . 12
81 3.5.2. URI (RFC 6350, Section 4.2) . . . . . . . . . . . . . 12
82 3.5.3. Date (RFC 6350, Section 4.3.1) . . . . . . . . . . . 12
83 3.5.4. Time (RFC 6350, Section 4.3.2) . . . . . . . . . . . 13
84 3.5.5. Date-Time (RFC 6350, Section 4.3.3) . . . . . . . . . 14
85 3.5.6. Date and/or Time (RFC 6350, Section 4.3.4) . . . . . 16
86 3.5.7. Timestamp (RFC 6350, Section 4.3.5) . . . . . . . . . 16
87 3.5.8. Boolean (RFC 6350, Section 4.4) . . . . . . . . . . . 17
88 3.5.9. Integer (RFC 6350, Section 4.5) . . . . . . . . . . . 17
89 3.5.10. Float (RFC 6350, Section 4.6) . . . . . . . . . . . . 17
90 3.5.11. UTC Offset (RFC 6350, Section 4.7) . . . . . . . . . 18
91 3.5.12. Language Tag (RFC 6350, Section 4.8) . . . . . . . . 18
92 3.6. Extensions (RFC 6350, Section 6.10) . . . . . . . . . . . 18
93 4. Converting from jCard into vCard . . . . . . . . . . . . . . 19
94 5. Handling Unrecognized Properties or Parameters . . . . . . . 19
95 5.1. Converting vCard into jCard . . . . . . . . . . . . . . . 19
96 5.2. Converting jCard into vCard . . . . . . . . . . . . . . . 20
97 5.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 20
98 6. Security Considerations . . . . . . . . . . . . . . . . . . . 21
99 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22
100 7.1. GROUP vCard Parameter . . . . . . . . . . . . . . . . . . 23
101 7.2. UNKNOWN vCard Value Data Type . . . . . . . . . . . . . . 24
102 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 24
103 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 24
104 9.1. Normative References . . . . . . . . . . . . . . . . . . 24
105 9.2. Informative References . . . . . . . . . . . . . . . . . 25
106 Appendix A. ABNF Syntax . . . . . . . . . . . . . . . . . . . . 26
107 Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 27
108 B.1. Example: vCard of the Author of RFC 6350 . . . . . . . . 27
109 B.1.1. vCard Data . . . . . . . . . . . . . . . . . . . . . 27
110 B.1.2. jCard Data . . . . . . . . . . . . . . . . . . . . . 28
111
112
113
114Kewisch Standards Track [Page 2]
115
116RFC 7095 jCard January 2014
117
118
1191. Introduction
120
121 The vCard data format [RFC6350] provides for the capture and exchange
122 of information normally stored within an address book or directory
123 application. The vCard format has gone through multiple revisions,
124 most recently vCard 4.
125
126 As certain similarities exist between vCard and the iCalendar data
127 format [RFC5545], there is also an effort to define a JSON-based data
128 format for calendar information called jCal [JCAL] that parallels the
129 format defined in this specification. The term "JSON" describes the
130 JavaScript Object Notation defined in [RFC4627].
131
132 The purpose of this specification is to define "jCard", a JSON format
133 for vCard data. One main advantage to using a JSON-based format over
134 the classic vCard format is easier processing for JavaScript-based
135 widgets and libraries, especially in the scope of web-based
136 applications.
137
138 The key design considerations are essentially the same as those for
139 [JCAL] and [RFC6321], that is:
140
141 Round-tripping (converting a vCard instance to jCard and back)
142 will give the same semantic result as the starting point. For
143 example, all components, properties, and property parameters are
144 guaranteed to be preserved.
145
146 The Ordering of elements and the case of property and parameter
147 names will not necessarily be preserved.
148
149 The vCard data semantics are to be preserved, allowing a simple
150 consumer to easily browse the data in jCard. A full understanding
151 of vCard is still required in order to modify and/or fully
152 comprehend the directory data.
153
154 Extensions to the underlying vCard specification must not lead to
155 requiring an update to jCard.
156
1572. Conventions Used in This Document
158
159 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
160 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
161 document are to be interpreted as described in [RFC2119].
162
163 The underlying format used for jCard is JSON. Consequently, the
164 terms "object" and "array" as well as the four primitive types
165 (strings, numbers, booleans, and null) are to be interpreted as
166 described in Section 1 of [RFC4627].
167
168
169
170Kewisch Standards Track [Page 3]
171
172RFC 7095 jCard January 2014
173
174
175 Some examples in this document contain "partial" JSON documents used
176 for illustrative purposes. In these examples, three periods "..."
177 are used to indicate a portion of the document that has been removed
178 for compactness.
179
1803. Converting from vCard to jCard
181
182 This section describes how vCard objects are converted to jCard using
183 a simple mapping between the vCard data model and JSON elements.
184
185 In [RFC6350], vCard objects are comprised of a set of "properties",
186 "parameters", and "values". The top level of a vCard object contains
187 "properties". A "property" has a "value" and a set of zero or more
188 "parameters". Each of these entities has a representation in jCard,
189 defined in the following sections. The representation of a vCard
190 object in JSON will be named "jCard object" throughout this document.
191
1923.1. Pre-processing
193
194 vCard uses a line-folding mechanism to limit lines of data to a
195 maximum line length (typically 75 octets) to ensure maximum
196 likelihood of preserving data integrity as it is transported via
197 various means (e.g., email) -- see Section 3.2 of [RFC6350].
198
199 vCard data uses an "escape" character sequence for text values and
200 property parameter values. See Section 3.4 of [RFC6350] as well as
201 [RFC6868].
202
203 When converting from vCard to jCard, first vCard lines MUST be
204 unfolded. Afterwards, any vCard escaping MUST be unescaped.
205 Finally, JSON escaping (e.g., for control characters) MUST be
206 applied.
207
208 The reverse order applies when converting from jCard to vCard.
209 First, JSON escaping MUST be unescaped. Afterwards, vCard escaping
210 MUST be applied. Finally, long lines SHOULD be folded as described
211 in [RFC6350].
212
213 One key difference in the formatting of values used in vCard and
214 jCard is that in jCard the specification uses date/time values
215 aligned with the extended format of [ISO.8601.2004], which is more
216 commonly used in Internet applications that make use of the JSON
217 format. The sections of this document describing the various date
218 and time formats contain more information on the use of the complete
219 representation, reduced accuracy, or truncated representation.
220
221
222
223
224
225
226Kewisch Standards Track [Page 4]
227
228RFC 7095 jCard January 2014
229
230
2313.2. jCard Object and Syntactic Entities (RFC 6350, Sections 6.1.1 and
232 6.1.2)
233
234 In Sections 6.1.1 and 6.1.2 of [RFC6350], the BEGIN and END
235 properties delimit a syntactic vCard entity. In jCard, each
236 syntactic entity is represented by an array with two elements and is
237 named "jCard object". The first element is the string "vcard", and
238 the second element is an array of jCard properties as described in
239 Section 3.3, belonging to the entity.
240
241 Although [RFC6350] defines BEGIN and END to be properties, they MUST
242 NOT appear as properties of the jCard. Instead, the jCard object is
243 sufficient to define a vCard entity. When converting from jCard to
244 vCard, the BEGIN and END properties MUST be added to enclose the
245 properties of the jCard object.
246
247 Example:
248
249 ["vcard", [
250 /* Add properties in place of this comment */
251 ]
252 ]
253
254 Consumers of this format wishing to define content that can represent
255 multiple jCard objects within the same JSON document can use a simple
256 JSON array, each element being a single jCard object.
257
2583.3. Properties (RFC 6350, Section 6)
259
260 Each individual vCard property is represented in jCard by an array
261 with three fixed elements, followed by one or more additional
262 elements, depending on if the property is a multi-valued property as
263 described in Section 3.3 of [RFC6350].
264
265 The array consists of the following fixed elements:
266
267 1. The name of the property, as a lowercase string. The vCard
268 format specifies that property names are case insensitive and
269 recommends that they be rendered in uppercase. In jCard, they
270 MUST be in lowercase.
271
272 2. An object containing the parameters as described in Section 3.4.
273 If the property has no parameters, an empty object is used to
274 represent that.
275
276
277
278
279
280
281
282Kewisch Standards Track [Page 5]
283
284RFC 7095 jCard January 2014
285
286
287 3. The type identifier string of the value, in lowercase. It is
288 important that parsers check this to determine the data type of
289 the value and that they do not rely on assumptions. For example,
290 for structured values, the data type will be "array".
291
292 The remaining elements of the array are used for one or more values
293 of the property. For single-value properties, the array has exactly
294 four elements; for multi-valued properties, each value is another
295 element, and there can be any number of additional elements.
296
297 In the following example, the "categories" property is multi-valued
298 and has two values, while all other properties are single-valued:
299
300 ["vcard",
301 [
302 ["version", {}, "text", "4.0"],
303 ["fn", {}, "text", "John Doe"],
304 ["gender", {}, "text", "M"],
305 ["categories", {}, "text", "computers", "cameras"],
306 ...
307 ]
308 ]
309
310 As described in Section 3.3.1.3, a property value may be a structured
311 property value, in which case it is represented as an array
312 encapsulated in the array that represents the overall property.
313
314 Strictly speaking, this means that the property value is not
315 represented in the format indicated by the type identifier but by an
316 array instead. However, the values inside the encapsulated array are
317 of the format identified by the type identifier.
318
319 The above also holds for multi-valued properties, where some of the
320 values may be structured property values and therefore are
321 represented as an encapsulated array.
322
323 A special case is where a value in an encapsulated array consists of
324 multiple components itself, in which case it is represented as yet
325 another nested array, with elements matching the value type.
326 Section 3.3.1.3 describes this in more detail.
327
328 The above illustrates that it's important for the parser to check the
329 format of each property value, as it might either directly match the
330 value type, or it might be a structured value where nested
331 subelements match the value type.
332
333
334
335
336
337
338Kewisch Standards Track [Page 6]
339
340RFC 7095 jCard January 2014
341
342
3433.3.1. Special Cases for Properties
344
345 This section describes some properties that have special handling
346 when converting to jCard.
347
3483.3.1.1. The VERSION Property
349
350 The vCard format specification [RFC6350] defines the "VERSION"
351 property to be mandatory. The jCard "version" property MUST be
352 represented in the corresponding jCard component, with the same value
353 as in the vCard. vCards that conform to RFC 6350 will contain the
354 value "4.0".
355
356 Also in accordance to [RFC6350], the "version" property MUST be the
357 first element of the array containing the properties of a jCard.
358
3593.3.1.2. Grouping of Properties
360
361 In vCard [RFC6350], related properties can be grouped together using
362 a grouping construct. The grouping is accomplished by adding a
363 prefix (which consists of the group name followed by a dot) to the
364 property name.
365
366 In jCard, the same grouping is achieved through a "group" parameter
367 that holds the group name. In jCard, a property name therefore MUST
368 NOT be prefixed by a group name.
369
370 The "GROUP" parameter MUST NOT be used in vCard; as per [RFC6350], it
371 is merely registered to reserve the parameter, avoiding collisions.
372 Formal registration of the "GROUP" parameter is described in
373 Section 7.1.
374
3753.3.1.2.1. Group Conversion Rules
376
377 In jCard, the parameter's value is a single opaque string.
378 Conversion rules are as follows:
379
380 o From vCard to jCard, the group construct (see [RFC6350],
381 Section 3.3) is removed. In its place, the "group" parameter is
382 used. Its value is a string corresponding to the group name,
383 which is case insensitive both in vCard and jCard. The name's
384 case SHOULD be converted into lowercase.
385
386 o When converting from jCard to vCard, the value of the "group"
387 parameter followed by a dot is prefixed to the property name, and
388 the "group" parameter is discarded. The "GROUP" parameter MUST
389 NOT appear in the resulting vCard. Following the recommendations
390 in [RFC6350], the name's case SHOULD be converted into uppercase.
391
392
393
394Kewisch Standards Track [Page 7]
395
396RFC 7095 jCard January 2014
397
398
399 Example:
400
401 CONTACT.FN:Mr. John Q. Public\, Esq.
402
403 is equivalent to:
404
405 [ "fn", { "group": "CONTACT" }, "text", "Mr. John Q. Public, Esq." ]
406
4073.3.1.3. Structured Property Values
408
409 The vCard specification defines properties with structured values,
410 for example, "GENDER" or "ADR". In vCard, a structured text value
411 consists of one or multiple text components, delimited by the
412 SEMICOLON character. Its equivalent in jCard is a structured
413 property value, which is an array containing one element for each
414 text component, with empty/missing text components represented by
415 zero-length strings.
416
417 vCard Example:
418
419 ADR:;;123 Main Street;Any Town;CA;91921-1234;U.S.A.
420
421 jCard Example:
422
423 ["adr", {}, "text",
424 [
425 "", "", "123 Main Street",
426 "Any Town", "CA", "91921-1234", "U.S.A."
427 ]
428 ]
429
430 Some vCard properties, for example, ADR, also allow a structured
431 value element that itself has multiple values. In this case, the
432 element of the array describing the structured value is itself an
433 array with one element for each of the component's multiple values.
434
435 vCard Example:
436
437 ADR:;;My Street,Left Side,Second Shack;Hometown;PA;18252;U.S.A.
438
439
440
441
442
443
444
445
446
447
448
449
450Kewisch Standards Track [Page 8]
451
452RFC 7095 jCard January 2014
453
454
455 jCard Example:
456
457 ["adr", {}, "text",
458 [
459 "", "",
460 ["My Street", "Left Side", "Second Shack"],
461 "Hometown", "PA", "18252", "U.S.A."
462 ]
463 ]
464
465 In both cases, the array element values MUST have the primitive type
466 that matches the jCard type identifier. In [RFC6350], there are only
467 structured text values and thus only JSON strings are used. For
468 example, extensions may define structured number or boolean values,
469 where JSON number or boolean types MUST be used.
470
471 Although it is allowed for a structured property value to hold just
472 one component, it is RECOMMENDED to represent it as a single text
473 value instead, omitting the array completely. Nevertheless, a simple
474 implementation MAY choose to retain the array, with a single text
475 value as its element.
476
477 Similarly, structured values that consist of two text components with
478 one being optional (for example, "GENDER") can be represented as a
479 single text value. Therefore, parsers of jCard data SHOULD check
480 even known property values for structured information by considering
481 the JSON data type of the value, which can be an array or a primitive
482 value. This is especially important for languages where accessing
483 array members is done by the same construct as accessing characters
484 of a string.
485
486 Examples:
487
488 ["gender", {}, "text", ["F", "grrrl"] ],
489 ["gender", {}, "text", "M" ]
490
491 Per Section 6.3.1 of [RFC6350], the component separator MUST be
492 specified even if the component value is missing. Similarly, the
493 jCard array containing the structured data MUST contain all required
494 elements, even if they are empty.
495
496 vCard Example:
497
498 ADR;LABEL="123 Maple Ave\nSuite 901\nVancouver BC\nA1B 2C9\nCan
499 ada":;;;;;;
500
501
502
503
504
505
506Kewisch Standards Track [Page 9]
507
508RFC 7095 jCard January 2014
509
510
511 jCard Example:
512
513 ["adr",
514 {"label":"123 Maple Ave\nSuite 901\nVancouver BC\nA1B 2C9\nCanada"},
515 "text",
516 ["", "", "", "", "", "", ""]
517 ]
518
5193.4. Parameters (RFC 6350, Section 5)
520
521 Property parameters are represented as a JSON object where each key-
522 value pair represents the vCard parameter name and its value. The
523 name of the parameter MUST be in lowercase; the original case of the
524 parameter value MUST be preserved. For example, the "LANGUAGE"
525 property parameter is represented in jCard by the "language" key.
526 Any new vCard parameters added in the future will be converted in the
527 same way.
528
529 Example:
530
531 ["role", { "language": "tr" }, "text", "roca"],
532
5333.4.1. VALUE Parameter
534
535 vCard defines a "VALUE" property parameter (Section 5.2 of
536 [RFC6350]). This property parameter MUST NOT be added to the
537 parameters object. Instead, the value type is signaled through the
538 type identifier in the third element of the array describing the
539 property. When converting a property from vCard to jCard, the value
540 type is determined as follows:
541
542 1. If the property has a "VALUE" parameter, that parameter's value
543 is used as the value type.
544
545 2. If the property has no "VALUE" parameter but has a default value
546 type, the default value type is used.
547
548 3. If the property has no "VALUE" parameter and has no default value
549 type, "unknown" is used.
550
551 Converting from jCard into vCard is done as follows:
552
553 1. If the property's value type is "unknown", no "VALUE" parameter
554 is included.
555
556 2. If the property's value type is the default type for that
557 property, no "VALUE" parameter is included.
558
559
560
561
562Kewisch Standards Track [Page 10]
563
564RFC 7095 jCard January 2014
565
566
567 3. Otherwise, a "VALUE" parameter is included, and the value type is
568 used as the parameter value.
569
570 See Section 5 for information on handling unknown value types.
571
5723.4.2. Multi-Valued Parameters
573
574 In [RFC6350], some parameters allow using a comma-separated list of
575 values. To ease processing in jCard, the value for such parameters
576 MUST be represented in an array containing the separated values. The
577 array elements MUST be string values. Single-value parameters SHOULD
578 be represented using a single string value, although a more simple
579 implementation might prefer an array with one string element. An
580 example of such a parameter is the vCard "SORT-AS" parameter; more
581 such parameters may be added in extensions.
582
583 The vCard specification requires encapsulation between DQUOTE
584 characters if a parameter value contains a colon, a semicolon, or a
585 comma. These extra DQUOTE characters do not belong to the actual
586 parameter value and hence are not included when the parameter is
587 converted to jCard.
588
589 Example:
590
591 ["vcard",
592 [
593 ["version", {}, "text", "4.0"],
594 ["n",
595 { "sort-as": ["Harten", "Rene"] },
596 "text",
597 ["van der Harten", "Rene", "J.", "Sir", "R.D.O.N."]
598 ],
599 ["fn", {}, "text", "Rene van der Harten"]
600 ...
601 ]
602 ]
603
6043.5. Values (RFC 6350, Section 4)
605
606 The following subsections specify how vCard property value data types
607 (which are defined in Section 4 of [RFC6350]) are represented in
608 jCard.
609
610
611
612
613
614
615
616
617
618Kewisch Standards Track [Page 11]
619
620RFC 7095 jCard January 2014
621
622
6233.5.1. Text (RFC 6350, Section 4.1)
624
625 Description: vCard "TEXT" property values are represented by a
626 property with the type identifier "text". The value elements are
627 JSON strings. For details on structured text values, see
628 Section 3.3.1.3.
629
630 Example:
631
632 ["kind", {}, "text", "group"]
633
6343.5.2. URI (RFC 6350, Section 4.2)
635
636 Description: vCard "URI" property values are represented by a
637 property with the type identifier "uri". The value elements are
638 JSON strings.
639
640 Example:
641
642 ["source", {}, "uri", "ldap://ldap.example.com/cn=babs%20jensen"]
643
6443.5.3. Date (RFC 6350, Section 4.3.1)
645
646 Description: vCard "DATE" property values are represented by a
647 property with the type identifier "date". The value elements are
648 JSON strings with the same date value specified by [RFC6350], but
649 represented using the extended format specified in
650 [ISO.8601.2004], Section 4.1.2. If the complete representation is
651 not used, the same date format restrictions regarding reduced
652 accuracy, truncated representation, and expanded representation
653 noted in [RFC6350], Section 4.3.1 apply. Whenever the extended
654 format is not applicable, the basic format MUST be used.
655
656 ABNF syntax:
657
658 date-complete = year "-" month "-" day ;YYYY-MM-DD
659
660 date-noreduc = date-complete
661 / "--" month "-" day ; --MM-DD
662 / "---" day ; ---DDD
663
664 date = date-noreduc
665 / year; YYYY
666 / year "-" month ; YYYY-MM
667 / "--" month ; --MM
668
669
670
671
672
673
674Kewisch Standards Track [Page 12]
675
676RFC 7095 jCard January 2014
677
678
679 Examples:
680
681 ["bday", {}, "date", "1985-04-12"],
682 ["bday", {}, "date", "1985-04"],
683 ["bday", {}, "date", "1985"],
684 ["bday", {}, "date", "--04-12"],
685 ["bday", {}, "date", "---12"]
686
687 This table contains possible conversions between the vCard DATE
688 format and jCard date. This information is just an example and not a
689 formal specification of the syntax. The specification can be found
690 in [ISO.8601.2000] and [ISO.8601.2004].
691
692 +-----------+----------+------------+
693 | | vCard | jCard |
694 +-----------+----------+------------+
695 | Complete | 19850412 | 1985-04-12 |
696 | | | |
697 | Reduced | 1985-04 | 1985-04 |
698 | | | |
699 | Reduced | 1985 | 1985 |
700 | | | |
701 | Truncated | --0412 | --04-12 |
702 | | | |
703 | Truncated | --04 | --04 |
704 | | | |
705 | Truncated | ---12 | ---12 |
706 +-----------+----------+------------+
707
7083.5.4. Time (RFC 6350, Section 4.3.2)
709
710 Description: vCard "TIME" property values are represented by a
711 property with the type identifier "time". The value elements are
712 JSON strings with the same time value specified by [RFC6350], but
713 represented using the extended format specified in
714 [ISO.8601.2004], Section 4.2. If the complete representation is
715 not used, the same time format restrictions regarding reduced
716 accuracy, decimal fraction, and truncated representation noted in
717 [RFC6350], Section 4.3.2 apply. Whenever the extended format is
718 not applicable, the basic format MUST be used. The seconds value
719 of 60 MUST only be used to account for positive "leap" seconds,
720 and the midnight hour is always represented by 00, never 24.
721 Fractions of a second are not supported by this format. In jCard,
722 UTC offsets are permitted within a time value; note that this
723 differs from jCal [JCAL], where they are not permitted.
724
725
726
727
728
729
730Kewisch Standards Track [Page 13]
731
732RFC 7095 jCard January 2014
733
734
735 ABNF syntax:
736
737 time-notrunc = hour [":" minute [":" second]] [zone]
738
739 time = time-notrunc
740 / "-" minute ":" second [zone]; -mm:ss
741 / "-" minute [zone]; -mm
742 / "--" second [zone]; --ss
743
744 Examples:
745
746 ["x-time-local", {}, "time", "12:30:00"],
747 ["x-time-utc", {}, "time", "12:30:00Z"],
748 ["x-time-offset", {}, "time", "12:30:00-08:00"],
749 ["x-time-reduced", {}, "time", "23"],
750 ["x-time-truncated", {}, "time", "-30"]
751
752 This table contains possible conversions between the vCard TIME
753 format and jCard time. This information is just an example and not a
754 formal specification of the syntax. The specification can be found
755 in [ISO.8601.2000] and [ISO.8601.2004].
756
757 +-----------+--------+----------+
758 | | vCard | jCard |
759 +-----------+--------+----------+
760 | Complete | 232050 | 23:20:50 |
761 | | | |
762 | Reduced | 2320 | 23:20 |
763 | | | |
764 | Reduced | 23 | 23 |
765 | | | |
766 | Truncated | -2050 | -20:50 |
767 | | | |
768 | Truncated | -20 | -20 |
769 | | | |
770 | Truncated | --50 | --50 |
771 +-----------+--------+----------+
772
773 Also, all combinations may have any zone designator appended, as in
774 the complete representation.
775
7763.5.5. Date-Time (RFC 6350, Section 4.3.3)
777
778 Description: vCard "DATE-TIME" property values are represented by a
779 property with the type identifier "date-time". The value elements
780 are JSON strings with the same date value specified by [RFC6350],
781 but represented using the extended format specified in
782 [ISO.8601.2004], Section 4.3. If the complete representation is
783
784
785
786Kewisch Standards Track [Page 14]
787
788RFC 7095 jCard January 2014
789
790
791 not used, the same date and time format restrictions noted in
792 Sections 3.5.3 and 3.5.4 apply. Just as described in [RFC6350],
793 truncation of the date part is permitted.
794
795 Example:
796
797 ["anniversary", {}, "date-time", "2013-02-14T12:30:00"],
798 ["anniversary", {}, "date-time", "2013-01-10T19:00:00Z"],
799 ["anniversary", {}, "date-time", "2013-08-15T09:45:00+01:00"],
800 ["anniversary", {}, "date-time", "---15T09:45:00+01:00"]
801
802 This table contains possible conversions between the vCard DATE-TIME
803 format and jCard date-time. This information is just an example and
804 not a formal specification of the syntax. The specification can be
805 found in [ISO.8601.2000] and [ISO.8601.2004].
806
807 +----------------+----------------------+---------------------------+
808 | Representation | vCard | jCard |
809 +----------------+----------------------+---------------------------+
810 | Complete | 19850412T232050 | 1985-04-12T23:20:50 |
811 | | | |
812 | Complete | 19850412T232050Z | 1985-04-12T23:20:50Z |
813 | | | |
814 | Complete | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
815 | | | |
816 | Complete | 19850412T232050+04 | 1985-04-12T23:20:50+04 |
817 | | | |
818 | Reduced | 19850412T2320 | 1985-04-12T23:20 |
819 | | | |
820 | Reduced | 19850412T23 | 1985-04-12T23 |
821 | | | |
822 | Truncated and | --0412T2320 | --04-12T23:20 |
823 | Reduced | | |
824 | | | |
825 | Truncated and | --04T2320 | --04T23:20 |
826 | Reduced | | |
827 | | | |
828 | Truncated and | ---12T2320 | ---12T23:20 |
829 | Reduced | | |
830 | | | |
831 | Truncated and | --0412T2320 | --04-12T23:20 |
832 | Reduced | | |
833 | | | |
834 | Truncated and | --04T23 | --04T23 |
835 | Reduced | | |
836 +----------------+----------------------+---------------------------+
837
838
839
840
841
842Kewisch Standards Track [Page 15]
843
844RFC 7095 jCard January 2014
845
846
847 As specified in [ISO.8601.2000], the lower-order components may not
848 be omitted in the date part (reduced accuracy) and the higher-order
849 components may not be omitted in the time part (truncation). Also,
850 all combinations may have any zone designator appended, as in the
851 complete representation.
852
8533.5.6. Date and/or Time (RFC 6350, Section 4.3.4)
854
855 Description: vCard "DATE-AND-OR-TIME" property values are
856 represented by a property with the type identifier "date-and-or-
857 time". The value elements are either a date-time (Section 3.5.5),
858 a date (Section 3.5.3), or a time (Section 3.5.4) value. Just as
859 described in Section 4.3.4 of [RFC6350], a stand-alone time value
860 MUST always be preceded by a "T".
861
862 Example:
863
864 ["bday", {}, "date-and-or-time", "2013-02-14T12:30:00"],
865 ["bday", {}, "date-and-or-time", "---22T14:00"]
866 ["bday", {}, "date-and-or-time", "1985"],
867 ["bday", {}, "date-and-or-time", "T12:30"]
868
8693.5.7. Timestamp (RFC 6350, Section 4.3.5)
870
871 Description: vCard "TIMESTAMP" property values are represented by a
872 property with the type identifier "timestamp". The value elements
873 are JSON strings with the same timestamp value specified by
874 [RFC6350], but represented using the extended format and complete
875 representation specified in [ISO.8601.2004], Section 4.3.2.
876
877 Example:
878
879 ["rev", {}, "timestamp", "2013-02-14T12:30:00"],
880 ["rev", {}, "timestamp", "2013-02-14T12:30:00Z"],
881 ["rev", {}, "timestamp", "2013-02-14T12:30:00-05"],
882 ["rev", {}, "timestamp", "2013-02-14T12:30:00-05:00"]
883
884 This table contains possible conversions between the vCard TIMESTAMP
885 format and jCard timestamp. This information is just an example and
886 not a formal specification of the syntax. The specification can be
887 found in [ISO.8601.2000] and [ISO.8601.2004].
888
889
890
891
892
893
894
895
896
897
898Kewisch Standards Track [Page 16]
899
900RFC 7095 jCard January 2014
901
902
903 +----------------+----------------------+---------------------------+
904 | Representation | vCard | jCard |
905 +----------------+----------------------+---------------------------+
906 | Complete | 19850412T232050 | 1985-04-12T23:20:50 |
907 | | | |
908 | Complete | 19850412T232050Z | 1985-04-12T23:20:50Z |
909 | | | |
910 | Complete | 19850412T232050+0400 | 1985-04-12T23:20:50+04:00 |
911 | | | |
912 | Complete | 19850412T232050+04 | 1985-04-12T23:20:50+04 |
913 +----------------+----------------------+---------------------------+
914
9153.5.8. Boolean (RFC 6350, Section 4.4)
916
917 Description: vCard "BOOLEAN" property values are represented by a
918 property with the type identifier "boolean". The value element is
919 a JSON boolean value.
920
921 Example:
922
923 ["x-non-smoking", {}, "boolean", true]
924
9253.5.9. Integer (RFC 6350, Section 4.5)
926
927 Description: vCard "INTEGER" property values are represented by a
928 property with the type identifier "integer". The value elements
929 are JSON primitive number values.
930
931 Examples:
932
933 ["x-karma-points", {}, "integer", 42]
934
935 JSON allows decimals (e.g., 3.14) and exponents (e.g., 2e10) to be
936 used in numeric values. jCard does not prohibit this for "integer"
937 property values. However, since vCard does not support decimals or
938 exponents in integers, any decimals and exponents MUST be eliminated
939 when converting an "integer" value type property from jCard to vCard.
940
9413.5.10. Float (RFC 6350, Section 4.6)
942
943 Description: vCard "FLOAT" property values are represented by a
944 property with the type identifier "float". The value elements are
945 JSON primitive number values.
946
947 Example:
948
949 ["x-grade", {}, "float", 1.3]
950
951
952
953
954Kewisch Standards Track [Page 17]
955
956RFC 7095 jCard January 2014
957
958
959 JSON allows exponents (e.g., 2e10) to be used in numeric values.
960 jCard does not prohibit this for "float" property values. However,
961 since vCard does not support exponents in floats, any exponents MUST
962 be eliminated when converting a "float" value type property from
963 jCard to vCard.
964
9653.5.11. UTC Offset (RFC 6350, Section 4.7)
966
967 Description: vCard "UTC-OFFSET" property values are represented by a
968 property with the type identifier "utc-offset". The value
969 elements are JSON strings with the same UTC offset value specified
970 by [RFC6350], with the exception that the hour and minute
971 components are separated by a ":" character, for consistency with
972 the [ISO.8601.2004] timezone offset, extended format.
973
974 Example:
975
976 // Note: [RFC6350] mentions use of utc-offset
977 // for the TZ property as NOT RECOMMENDED
978 ["tz", {}, "utc-offset", "-05:00"]
979
9803.5.12. Language Tag (RFC 6350, Section 4.8)
981
982 Description: vCard "LANGUAGE-TAG" property values are represented by
983 a property with the type identifier "language-tag". The value
984 elements are JSON strings containing a single language-tag, as
985 defined in [RFC5646].
986
987 Example:
988
989 ["lang", {}, "language-tag", "de"]
990
9913.6. Extensions (RFC 6350, Section 6.10)
992
993 vCard extension properties and property parameters (those with an
994 "X-" prefix in their name) are handled in the same way as other
995 properties and property parameters: the property is represented by an
996 array, the property parameter represented by an object. The property
997 or parameter name uses the same name as for the vCard extension, but
998 in lowercase. For example, the "X-FOO" property in vCard turns into
999 the "x-foo" jCard property. See Section 5 for how to deal with
1000 default values for unrecognized extension properties or property
1001 parameters.
1002
1003
1004
1005
1006
1007
1008
1009
1010Kewisch Standards Track [Page 18]
1011
1012RFC 7095 jCard January 2014
1013
1014
10154. Converting from jCard into vCard
1016
1017 When converting property and property parameter values, the names
1018 SHOULD be converted to uppercase. Although vCard names are case
1019 insensitive, common practice is to keep them all uppercase following
1020 the actual definitions in [RFC6350].
1021
1022 Character escaping and line folding MUST be applied to the resulting
1023 vCard data as required by [RFC6350] and [RFC6868].
1024
1025 When converting to vCard, the "VALUE" parameter MUST be added to
1026 properties whose default value type is unknown but do not have a
1027 jCard type identifier "unknown". The "VALUE" parameter MAY be
1028 omitted for properties using the default value type. The "VALUE"
1029 parameter MUST be omitted for properties that have the jCard type
1030 identifier "unknown".
1031
10325. Handling Unrecognized Properties or Parameters
1033
1034 In vCard, properties can have one or more value types as specified by
1035 their definition, with one of those values being defined as the
1036 default. When a property uses its default value type, the "VALUE"
1037 property parameter does not need to be specified on the property.
1038 For example, "BDAY"'s default value type is "date-and-or-time", so
1039 "VALUE=date-and-or-time" need not be set as a property parameter.
1040 However, "BDAY" also allows a "text" value to be specified, and if
1041 that is used, "VALUE=text" has to be set as a property parameter.
1042
1043 When new properties are defined or "X-" properties used, a vCard-to-
1044 jCard converter might not recognize them, and not know what the
1045 appropriate default value types are, yet it needs to be able to
1046 preserve the values. A similar issue arises for unrecognized
1047 property parameters.
1048
1049 In jCard, a new "unknown" property value type is introduced. Its
1050 purpose is to allow preserving unknown property values when round-
1051 tripping between jCard and vCard. To avoid collisions, this
1052 specification reserves the "UNKNOWN" property value type in vCard.
1053 It MUST NOT be used in any vCard as specified by [RFC6350], nor any
1054 extensions to it. The type is hence registered to the "vCard Value
1055 Data Types" registry; see Section 7.2.
1056
10575.1. Converting vCard into jCard
1058
1059 Any property that does not include a "VALUE" property parameter and
1060 whose default value type is not known MUST be converted to a
1061 primitive JSON string. The content of that string is the unprocessed
1062 value text. Also, value type MUST be set to "unknown".
1063
1064
1065
1066Kewisch Standards Track [Page 19]
1067
1068RFC 7095 jCard January 2014
1069
1070
1071 To correctly implement this format, it's critical to use the value
1072 type "unknown" when the default value type is not known. If this
1073 requirement is ignored and, for example, "text" is used, additional
1074 escaping may occur that breaks round-tripping values.
1075
1076 Any unrecognized property parameter MUST be converted to a string
1077 value, with its content set to the property parameter value text,
1078 treated as if it were a "TEXT" value.
1079
10805.2. Converting jCard into vCard
1081
1082 In jCard, the value type is always explicitly specified. It is
1083 converted to vCard using the vCard "VALUE" parameter, except in the
1084 following two cases:
1085
1086 o If the value type specified in jCard matches the default value
1087 type in vCard, the "VALUE" parameter MAY be omitted.
1088
1089 o If the value type specified in jCard is set to "unknown", the
1090 "VALUE" parameter MUST NOT be specified. The value MUST be taken
1091 over in vCard without processing.
1092
10935.3. Examples
1094
1095 The following is an example of an unrecognized vCard property (that
1096 uses a "URI" value as its default), and the equivalent jCard
1097 representation of that property.
1098
1099 vCard:
1100
1101 X-COMPLAINT-URI:mailto:abuse@example.org
1102
1103 jCard:
1104
1105 ["x-complaint-uri", {}, "unknown", "mailto:abuse@example.org"]
1106
1107 The following is an example of how to cope with jCard data where the
1108 parser was unable to identify the value type. Note how the "unknown"
1109 value type is not added to the vCard data, and escaping, aside from
1110 standard JSON string escaping, is not processed.
1111
1112 jCard:
1113
1114 ["x-coffee-data", {}, "unknown", "Stenophylla;Guinea\\,Africa"]
1115
1116 vCard:
1117
1118 X-COFFEE-DATA:Stenophylla;Guinea\,Africa
1119
1120
1121
1122Kewisch Standards Track [Page 20]
1123
1124RFC 7095 jCard January 2014
1125
1126
1127 There are no standard properties in [RFC6350] that have a default
1128 type of integer. Consequently, this example uses the following
1129 extended property that we treat as having a default type (namely,
1130 integer) known to the parser in order to illustrate how a property
1131 with a known default type would be transformed.
1132
1133 jCard:
1134
1135 ["x-karma-points", {}, "integer", 95]
1136
1137 vCard:
1138
1139 X-KARMA-POINTS:95
1140
1141 The following is an example of an unrecognized vCard property
1142 parameter (that uses a "FLOAT" value as its default) specified on a
1143 recognized vCard property, and the equivalent jCard representation of
1144 that property and property parameter.
1145
1146 vCard:
1147
1148 GENDER;X-PROBABILITY=0.8:M
1149
1150 jCard:
1151
1152 ["gender", { "x-probability": "0.8" }, "text", "M"]
1153
11546. Security Considerations
1155
1156 This specification defines how vCard data can be "translated" between
1157 two different data formats -- the original text format and JSON --
1158 with a one-to-one mapping to ensure all the semantic data in one
1159 format (properties, parameters, and values) are preserved in the
1160 other. It does not change the semantic meaning of the underlying
1161 data itself, or impose or remove any security considerations that
1162 apply to the underlying data.
1163
1164 The use of JSON as a format does have its own inherent security risks
1165 as discussed in Section 7 of [RFC4627]. Even though JSON is
1166 considered a safe subset of JavaScript, it should be kept in mind
1167 that a flaw in the parser for JSON data could still impose a threat
1168 that doesn't arise with conventional vCard data.
1169
1170 With this in mind when using jCard, the parser for JSON data should
1171 be aware of the security implications. For example, the use of
1172 JavaScript's eval() function is only allowed using the regular
1173 expression in Section 6 of [RFC4627]. A native parser with full
1174 awareness of the JSON format should be preferred.
1175
1176
1177
1178Kewisch Standards Track [Page 21]
1179
1180RFC 7095 jCard January 2014
1181
1182
1183 In addition, it is expected that this new format will result in vCard
1184 data being more widely disseminated (e.g., with use in web
1185 applications rather than just dedicated "contact managers").
1186
1187 In all cases, application developers have to conform to the semantics
1188 of the vCard data as defined by [RFC6350] and associated extensions,
1189 and all of the security considerations described in Section 9 of
1190 [RFC6350], or any associated extensions, are applicable.
1191
11927. IANA Considerations
1193
1194 This document defines a MIME media type for use with vCard in JSON
1195 data. This media type SHOULD be used for the transfer of calendaring
1196 data in JSON.
1197
1198 Type name: application
1199
1200 Subtype name: vcard+json
1201
1202 Required parameters: none
1203
1204 Optional parameters: "version", as defined for the text/vcard media
1205 type in [RFC6350], Section 10.1.
1206
1207 Encoding considerations: Same as encoding considerations of
1208 application/json as specified in [RFC4627], Section 6.
1209
1210 Security considerations: See Section 6.
1211
1212 Interoperability considerations: This media type provides an
1213 alternative format for vCard data based on JSON.
1214
1215 Published specification: This specification.
1216
1217 Applications which use this media type: Applications that currently
1218 make use of the text/vcard media type can use this as an
1219 alternative. Similarly, applications that use the application/
1220 json media type to transfer directory data can use this to further
1221 specify the content.
1222
1223 Fragment identifier considerations: N/A
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234Kewisch Standards Track [Page 22]
1235
1236RFC 7095 jCard January 2014
1237
1238
1239 Additional information:
1240
1241 Deprecated alias names for this type: N/A
1242
1243 Magic number(s): N/A
1244
1245 File extension(s): N/A
1246
1247 Macintosh file type code(s): N/A
1248
1249 Person & email address to contact for further information:
1250 vcarddav@ietf.org
1251
1252 Intended usage: COMMON
1253
1254 Restrictions on usage: There are no restrictions on where this media
1255 type can be used.
1256
1257 Author: See the "Author's Address" section of this document.
1258
1259 Change controller: IETF
1260
12617.1. GROUP vCard Parameter
1262
1263 IANA has added the "GROUP" parameter to the "vCard Parameters"
1264 registry, initialized in Section 10.3.2 of [RFC6350]. Usage of the
1265 "GROUP" parameter is further described in Section 3.3.1.2 of this
1266 document.
1267
1268 Namespace: <empty>
1269
1270 Parameter name: GROUP
1271
1272 Purpose: To simplify the jCard format.
1273
1274 Description: The "GROUP" parameter is reserved for the exclusive use
1275 of the jCard format described in this document. It MUST NOT be
1276 used in plain vCard [RFC6350], nor in xCard [RFC6351].
1277
1278 Format definition: When converting from jCard to vCard, the value of
1279 the "GROUP" parameter is used as part of the property name.
1280 Therefore, the value is restricted to characters allowed in
1281 property names, namely ALPHA, DIGIT, and "-" characters. When
1282 used, the "GROUP" parameter MUST NOT be empty.
1283
1284
1285
1286
1287
1288
1289
1290Kewisch Standards Track [Page 23]
1291
1292RFC 7095 jCard January 2014
1293
1294
1295 Example: As this registration serves as a reservation of the "GROUP"
1296 parameter so that it is not used in vCard, there is no applicable
1297 vCard example. Examples of its usage in jCard can be found in
1298 this document.
1299
13007.2. UNKNOWN vCard Value Data Type
1301
1302 IANA has added the "UNKNOWN" value data type to the "vCard Value Data
1303 Types" registry, initialized in Section 10.3.3 of [RFC6350]. Usage
1304 of the "UNKNOWN" type is further described in Section 5 of this
1305 document.
1306
1307 Value name: UNKNOWN
1308
1309 Purpose: To allow preserving property values whose default value
1310 type is not known during round-tripping between jCard and vCard.
1311
1312 Format definition: (Not applicable)
1313
1314 Description: The "UNKNOWN" value data type is reserved for the
1315 exclusive use of the jCard format. It MUST NOT be used in plain
1316 vCard [RFC6350].
1317
1318 Example: As this registration serves as a reservation of the
1319 "UNKNOWN" type so that it is not used in vCard, there is no
1320 applicable vCard example. Examples of its usage in jCard can be
1321 found in this document.
1322
13238. Acknowledgments
1324
1325 The author would like to thank the following for their valuable
1326 contributions: Cyrus Daboo, Mike Douglass, William Gill, Erwin Rehme,
1327 Dave Thewlis, Simon Perreault, Michael Angstadt, Peter Saint-Andre,
1328 Bert Greevenbosch, and Javier Godoy. This specification originated
1329 from the work of the XML-JSON technical committee of the Calendaring
1330 and Scheduling Consortium.
1331
13329. References
1333
13349.1. Normative References
1335
1336 [ISO.8601.2000]
1337 International Organization for Standardization, "Data
1338 elements and interchange formats -- Information
1339 interchange -- Representation of dates and times", ISO
1340 8601, December 2000.
1341
1342
1343
1344
1345
1346Kewisch Standards Track [Page 24]
1347
1348RFC 7095 jCard January 2014
1349
1350
1351 [ISO.8601.2004]
1352 International Organization for Standardization, "Data
1353 elements and interchange formats -- Information
1354 interchange -- Representation of dates and times", ISO
1355 8601, December 2004.
1356
1357 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
1358 Requirement Levels", BCP 14, RFC 2119, March 1997.
1359
1360 [RFC4627] Crockford, D., "The application/json Media Type for
1361 JavaScript Object Notation (JSON)", RFC 4627, July 2006.
1362
1363 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax
1364 Specifications: ABNF", STD 68, RFC 5234, January 2008.
1365
1366 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying
1367 Languages", BCP 47, RFC 5646, September 2009.
1368
1369 [RFC6350] Perreault, S., "vCard Format Specification", RFC 6350,
1370 August 2011.
1371
1372 [RFC6868] Daboo, C., "Parameter Value Encoding in iCalendar and
1373 vCard", RFC 6868, February 2013.
1374
13759.2. Informative References
1376
1377 [JCAL] Kewisch, P., Daboo, C., and M. Douglass, "jCal: The JSON
1378 format for iCalendar", Work in Progress, December 2013.
1379
1380 [RFC5545] Desruisseaux, B., "Internet Calendaring and Scheduling
1381 Core Object Specification (iCalendar)", RFC 5545,
1382 September 2009.
1383
1384 [RFC6321] Daboo, C., Douglass, M., and S. Lees, "xCal: The XML
1385 Format for iCalendar", RFC 6321, August 2011.
1386
1387 [RFC6351] Perreault, S., "xCard: vCard XML Representation", RFC
1388 6351, August 2011.
1389
1390 [calconnect-artifacts]
1391 The Calendaring and Scheduling Consortium, "Code Artifacts
1392 and Schemas", <http://www.calconnect.org/artifacts.shtml>.
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402Kewisch Standards Track [Page 25]
1403
1404RFC 7095 jCard January 2014
1405
1406
1407Appendix A. ABNF Syntax
1408
1409 Below is the ABNF syntax as per [RFC5234] for vCard in JSON. ABNF
1410 symbols not described here are taken from [RFC4627]. The syntax is
1411 non-normative and given for reference only.
1412
1413 The numeric section numbers given in the comments refer to sections
1414 in [RFC6350]. Additional semantic restrictions apply, especially
1415 regarding the allowed properties and subcomponents per component.
1416 Details on these restrictions can be found in this document and
1417 [RFC6350].
1418
1419 Additional ABNF syntax may be available on the Internet at
1420 [calconnect-artifacts].
1421
1422 ; A jCard object uses the name "vcard" and a properties array.
1423 ; Restrictions to which properties may be specified are to
1424 ; be taken from RFC 6350.
1425 jcardobject = begin-array
1426 DQUOTE component-name DQUOTE value-separator
1427 properties-array
1428 end-array
1429
1430 ; A jCard property consists of the name string, parameters object,
1431 ; type string, and one or more values as specified in this document.
1432 property = begin-array
1433 DQUOTE property-name DQUOTE value-separator
1434 params-object value-separator
1435 DQUOTE type-name DQUOTE
1436 property-value *(value-separator property-value)
1437 end-array
1438 properties-array = begin-array
1439 [ property *(value-separator property) ]
1440 end-array
1441
1442 ; Property values depend on the type-name. Aside from the value types
1443 ; mentioned here, extensions may make use of other JSON value types.
1444 property-value = simple-prop-value / structured-prop-value
1445 simple-prop-value = string / number / true / false
1446 structured-prop-value =
1447 begin-array
1448 [ structured-element *(value-separator structured-element) ]
1449 end-array
1450
1451 ; Each structured element may have multiple values if
1452 ; semantically allowed.
1453 structured-element = simple-prop-value / structured-multi-prop
1454
1455
1456
1457
1458Kewisch Standards Track [Page 26]
1459
1460RFC 7095 jCard January 2014
1461
1462
1463 structured-multi-prop =
1464 begin-array
1465 [ simple-prop-value *(value-separator simple-prop-value) ]
1466 end-array
1467
1468 ; The jCard params-object is a JSON object that follows the semantic
1469 ; guidelines described in this document.
1470 params-object = begin-object
1471 [ params-member *(value-separator params-member) ]
1472 end-object
1473 params-member = DQUOTE param-name DQUOTE name-separator param-value
1474 param-value = string / param-multi
1475 param-multi = begin-array
1476 [ string *(value-separator string) ]
1477 end-array
1478
1479 ; The type MUST be a valid type as described by this document. New
1480 ; value types can be added by extensions.
1481 type-name = "text" / "uri" / "date" / "time" / "date-time" /
1482 "boolean" / "integer" / "float" / "utc-offset" /
1483 "language-tag" / x-type
1484
1485 ; Property, parameter, and type names MUST be lowercase. Additional
1486 ; semantic restrictions apply as described by this document and
1487 ; RFC 6350.
1488 component-name = lowercase-name
1489 property-name = lowercase-name
1490 param-name = lowercase-name
1491 x-type = lowercase-name
1492 lowercase-name = 1*(%x61-7A / DIGIT / "-")
1493
1494Appendix B. Examples
1495
1496 This section contains an example of a vCard object with its jCard
1497 representation.
1498
1499B.1. Example: vCard of the Author of RFC 6350
1500
1501B.1.1. vCard Data
1502
1503 BEGIN:VCARD
1504 VERSION:4.0
1505 FN:Simon Perreault
1506 N:Perreault;Simon;;;ing. jr,M.Sc.
1507 BDAY:--0203
1508 ANNIVERSARY:20090808T1430-0500
1509 GENDER:M
1510 LANG;PREF=1:fr
1511
1512
1513
1514Kewisch Standards Track [Page 27]
1515
1516RFC 7095 jCard January 2014
1517
1518
1519 LANG;PREF=2:en
1520 ORG;TYPE=work:Viagenie
1521 ADR;TYPE=work:;Suite D2-630;2875 Laurier;
1522 Quebec;QC;G1V 2M2;Canada
1523 TEL;VALUE=uri;TYPE="work,voice";PREF=1:tel:+1-418-656-9254;ext=102
1524 TEL;VALUE=uri;TYPE="work,cell,voice,video,text":tel:+1-418-262-6501
1525 EMAIL;TYPE=work:simon.perreault@viagenie.ca
1526 GEO;TYPE=work:geo:46.772673,-71.282945
1527 KEY;TYPE=work;VALUE=uri:
1528 http://www.viagenie.ca/simon.perreault/simon.asc
1529 TZ:-0500
1530 URL;TYPE=home:http://nomis80.org
1531 END:VCARD
1532
1533B.1.2. jCard Data
1534
1535 ["vcard",
1536 [
1537 ["version", {}, "text", "4.0"],
1538 ["fn", {}, "text", "Simon Perreault"],
1539 ["n",
1540 {},
1541 "text",
1542 ["Perreault", "Simon", "", "", ["ing. jr", "M.Sc."]]
1543 ],
1544 ["bday", {}, "date-and-or-time", "--02-03"],
1545 ["anniversary",
1546 {},
1547 "date-and-or-time",
1548 "2009-08-08T14:30:00-05:00"
1549 ],
1550 ["gender", {}, "text", "M"],
1551 ["lang", { "pref": "1" }, "language-tag", "fr"],
1552 ["lang", { "pref": "2" }, "language-tag", "en"],
1553 ["org", { "type": "work" }, "text", "Viagenie"],
1554 ["adr",
1555 { "type": "work" },
1556 "text",
1557 [
1558 "",
1559 "Suite D2-630",
1560 "2875 Laurier",
1561 "Quebec",
1562 "QC",
1563 "G1V 2M2",
1564 "Canada"
1565 ]
1566 ],
1567
1568
1569
1570Kewisch Standards Track [Page 28]
1571
1572RFC 7095 jCard January 2014
1573
1574
1575 ["tel",
1576 { "type": ["work", "voice"], "pref": "1" },
1577 "uri",
1578 "tel:+1-418-656-9254;ext=102"
1579 ],
1580 ["tel",
1581 { "type": ["work", "cell", "voice", "video", "text"] },
1582 "uri",
1583 "tel:+1-418-262-6501"
1584 ],
1585 ["email",
1586 { "type": "work" },
1587 "text",
1588 "simon.perreault@viagenie.ca"
1589 ],
1590 ["geo", { "type": "work" }, "uri", "geo:46.772673,-71.282945"],
1591 ["key",
1592 { "type": "work" },
1593 "uri",
1594 "http://www.viagenie.ca/simon.perreault/simon.asc"
1595 ],
1596 ["tz", {}, "utc-offset", "-05:00"],
1597 ["url", { "type": "home" }, "uri", "http://nomis80.org"]
1598 ]
1599 ]
1600
1601Author's Address
1602
1603 Philipp Kewisch
1604 Mozilla Corporation
1605 650 Castro Street, Suite 300
1606 Mountain View, CA 94041
1607 USA
1608
1609 EMail: mozilla@kewis.ch
1610 URI: http://www.mozilla.org/
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626Kewisch Standards Track [Page 29]
1627
1628