A JavaScript Object Notation (JSON) Representation for vCardCisco Systems, Inc.900 McCarthy Blvd.MilpitasCA95035USA+1-408-902-2123ragbhat@cisco.comCisco Systems, Inc.1899 Wynkoop Street, Suite 600DenverCO80202USA+1-303-308-3282psaintan@cisco.comvCardJSONThis document defines a representation of vCard data in JavaScript Object Notation (JSON).vCard is a data format for representing and exchanging information about individuals and other entities. It is a text-based format (as opposed to a binary format). This document defines a representation for vCard data in JavaScript Object Notation (JSON), a lightweight, text-based, language-independent data interchange format derived from the ECMAScript Programming Language Standard (see ). As with the XML representation of vCard defined in , the data structure is exactly the same as for plain vCard, enabling a 1-to-1 mapping between the plain vCard format and the JSON representation (or the XML representation). The JSON formatting might be preferred in some contexts where JSON facilities are readily available and can be reused instead of writing a standalone vCard parser.The preferred discussion venue for this document is the vcarddav@ietf.org mailing list, for which subscription information and archives can be found at .The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in .To ease comparison with both plain vCard and the XML representation, the following example is a JSON representation of the same vCard (for Simon Perreault) that is also shown in and .The general idea is to map vCard parameters, properties and value types to JSON property/value pairs. For example, the "FN" property is mapped to the fn property. Value contains a text string that corresponds to the vCard property's value. vCard parameters are also mapped to JSON objects which are contained in the value object. For example, the "TYPE" parameter applied to the "TEL" property would look like the following in JSON.Parameters taking a list of values and properties with cardinality of more than one are converted to a JSON array object. Properties having structured values (e.g., the "N" property) are expressed by nested JSON object trees. Properties within that tree ("surname", "given", etc.) are mapped as simple name/value pairs. These pairs should follow the schema defined by the XML mapping of vCard(Appendix A in ) Line folding is a non-issue in JSON. Therefore, the mapping from vCard to JSON is done after the unfolding procedure is carried out. Conversely, the mapping from JSON to vCard is done before the folding procedure is carried out. The group construct (Section 3.2 in ) is represented with the JSON object of the same name. For example:... is equivalent to:The VALUE parameter from the plain VCARD format is used as the property name in the JSON format. If there is no VALUE parameter specified, it is treated as equivalent to VALUE=text. For example:... is equivalent to:In the plain vCard format, the "VERSION" property was mandatory and played a role in extensibility. In XML, this property was dropped in favor of the XML namespace mechanism. In the JSON mapping, we keep the "version" property, which plays a similar role as in the plain vCard format.Finally, there is no reason to include a top-level name of "vcard" or "vcards", since the data type can be determined from the media type of the data file.The plain vCard format is extensible. New properties, parameters, data types and values (collectively known as vCard elements, not to be confused with XML elements) can be registered with IANA (see , Section 10.2). It is expected that these vCard extensions will also specify extensions to the JSON format described in this document. New JSON vCard property and parameter element names MUST be lower-case. This is necessary to ensure that round-tripping between JSON and plain-text vCard works correctly. Unregistered extensions (i.e., those starting with "X-" and "VND-...-") are expressed in JSON by using properties starting with "x-" and "vnd-...-". Refer to for the implications when converting between plain-text vCard and JSON. For example:A vCard JSON parser MUST ignore JSON parameters and properties for which it doesn't recognize the name.In the XML representation of vCard , extensibility is handled in part by using XML namespaces for properties and parameters that have no equivalent in plain-text vCard. For extensions that might appear in both the JSON representation and the XML representation, it is RECOMMENDED to represent the JSON parameter or property name in "Clark Notation" by preceding the name itself with the Uniform Resource Identifier of the XML namespace, enclosed in curly brackets ('{' and '}'); thus the "expanded name" will be of the form "{URI}name". For extensions that will appear in the JSON representation but not the XML representation, a mere (non-expanded) name can be used, or the name can be an expanded name formed in another manner (e.g., using the "reverse domain name" convention such as "com.example.vcard.foo").The JSON format does not validate the cardinality of properties. This is a limitation of the JSON format specification. Cardinalities of the plain vCard format MUST still be respected.To followTo followAll the security considerations applicable to plain vCard are also applicable to the JSON representation of vCard.As explained in , JSON is a subset of JavaScript, but it is a safe subset that excludes assignment and invocation. A JSON text can be safely passed into JavaScript's eval() function (which compiles and executes a string) if all the characters not enclosed in strings are in the set of characters that form JSON tokens.To: ietf-types@iana.orgSubject: Registration of media type application/vcard+json8bit if UTF-8; binary if UTF-16 or UTF-32; see RFC 4627.All of the security considerations specified in RFC 4627 and RFC 6350 apply.&rfc.number;vCard processors.(none).jcardTEXTvCard discussion mailing list, <vcarddav@ietf.org>COMMON(none)Peter Saint-Andre, <psaintan@cisco.com>Peter Saint-Andre, <psaintan@cisco.com>Thanks to Joe Hildebrand for his feedback.Some text in this document was borrowed from .Key words for use in RFCs to Indicate Requirement LevelsHarvard University1350 Mass. Ave.CambridgeMA 02138- +1 617 495 3864sob@harvard.edu
General
keyword
In many standards track documents several words are used to signify
the requirements in the specification. These words are often
capitalized. This document defines these words as they should be
interpreted in IETF documents. Authors who follow these guidelines
should incorporate this phrase near the beginning of their document:
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
RFC 2119.
Note that the force of these words is modified by the requirement
level of the document in which they are used.
The application/json Media Type for JavaScript Object Notation (JSON)JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data. This memo provides information for the Internet community.vCard Format SpecificationThis document defines the vCard data format for representing and exchanging a variety of information about individuals and other entities (e.g., formatted and structured name and delivery addresses, email address, multiple telephone numbers, photograph, logo, audio clips, etc.). This document obsoletes RFCs 2425, 2426, and 4770, and updates RFC 2739. [STANDARDS-TRACK]Clark NotationUniform Resource Identifier (URI): Generic SyntaxWorld Wide Web ConsortiumMassachusetts Institute of Technology77 Massachusetts AvenueCambridgeMA02139USA+1-617-253-5702+1-617-258-5999timbl@w3.orghttp://www.w3.org/People/Berners-Lee/Day Software5251 California Ave., Suite 110IrvineCA92617USA+1-949-679-2960+1-949-679-2972fielding@gbiv.comhttp://roy.gbiv.com/Adobe Systems Incorporated345 Park AveSan JoseCA95110USA+1-408-536-3024LMM@acm.orghttp://larry.masinter.net/
Applications
uniform resource identifierURIURLURNWWWresource
A Uniform Resource Identifier (URI) is a compact sequence of characters
that identifies an abstract or physical resource. This specification
defines the generic URI syntax and a process for resolving URI references
that might be in relative form, along with guidelines and security
considerations for the use of URIs on the Internet.
The URI syntax defines a grammar that is a superset of all valid URIs,
allowing an implementation to parse the common components of a URI
reference without knowing the scheme-specific requirements of every
possible identifier. This specification does not define a generative
grammar for URIs; that task is performed by the individual
specifications of each URI scheme.
xCard: vCard XML RepresentationThis document defines the XML schema of the vCard data format. [STANDARDS-TRACK]Namespaces in XML 1.0 (Third Edition)