ISO/IEC 21778:2017 情報技術—JSONデータ交換構文 | ページ 2

※一部、英文及び仏文を自動翻訳した日本語訳を使用しています。

序文

ISO (国際標準化機構) と IEC (国際電気標準会議) は、世界標準化のための専門システムを形成しています。 ISO または IEC のメンバーである国家機関は、技術活動の特定の分野を扱うために、それぞれの組織によって設立された技術委員会を通じて、国際規格の開発に参加しています。 ISO と IEC の技術委員会は、相互に関心のある分野で協力しています。 ISO および IEC と連携して、政府および非政府の他の国際機関もこの作業に参加しています。情報技術の分野では、ISO と IEC が合同技術委員会 ISO/IEC JTC 1 を設立しました。

この文書の作成に使用された手順と、そのさらなる維持を目的とした手順は、ISO/IEC 指令のPart 1 に記載されています。特に、さまざまな種類の文書に必要なさまざまな承認基準に注意する必要があります。この文書は、ISO/IEC 指令のPart 2 の編集規則に従って起草されました ( www.iso.org/directives を参照)

このドキュメントの要素の一部が特許権の対象となる可能性があることに注意してください。 ISO および IEC は、そのような特許権の一部またはすべてを特定する責任を負わないものとします。ドキュメントの開発中に特定された特許権の詳細は、序文および/または受信した特許宣言の ISO リストに記載されます ( www.iso.org/patents を 参照)

このドキュメントで使用されている商号は、ユーザーの便宜のために提供された情報であり、保証を構成するものではありません。

規格の自主的な性質に関する説明、適合性評価に関連する ISO 固有の用語と表現の意味、および技術的貿易障壁 (TBT) における世界貿易機関 (WTO) の原則への ISO の準拠に関する情報については、次を参照してください。次の URL: www.iso.org/iso/foreword.html

ISO/IEC 21778 は、Ecma International によって (ECMA-404 として) 作成され、特別な「ファストトラック手順」の下で、合同技術委員会 ISO/IEC JTC 1, 情報技術によって採用され、国家機関による承認と並行して行われました。 ISOおよびIECの。

序章

JSON 1は、すべてのプログラミング言語間で構造化データの交換を容易にするテキスト構文です。 JSON は、多くのコンテキスト、プロファイル、およびアプリケーションで役立つ中括弧、大括弧、コロン、およびコンマの構文です。 JSON は JavaScript Object Notation の略で、ECMAScript 言語仕様、第 3 版で定義されているように、JavaScript 別名 ECMAScript のオブジェクト リテラルに触発されました。 [ 1] ただし、ECMAScript の内部データ表現を他のプログラミング言語に適用しようとはしていません。代わりに、ECMAScript の構文の小さなサブセットを他のすべてのプログラミング言語と共有しています。 JSON 構文は、完全なデータ交換の仕様ではありません。意味のあるデータ交換には、JSON 構文の特定の使用に付随するセマンティクスに関するプロデューサーとコンシューマーの間の合意が必要です。 JSON が提供するのは、そのようなセマンティクスを付加できる構文フレームワークです。

JSON 構文は、一連の Unicode コード ポイントを記述します。 JSON は、 \uエスケープメント表記で使用される 16 進数の Unicode にも依存します。

JSON は、数値のセマンティクスにとらわれません。どのプログラミング言語にも、さまざまな容量と補数、固定または浮動小数点、2 進数または 10 進数のさまざまな数値型が存在する可能性があります。これにより、異なるプログラミング言語間の交換が困難になる可能性があります。代わりに、JSON は、人間が使用する数字の表現、つまり一連の数字のみを提供します。すべてのプログラミング言語は、内部表現に同意しない場合でも、数字の並びを理解する方法を知っています。交換を許可するにはそれで十分です。

プログラミング言語は、オブジェクトをサポートするかどうか、およびサポートする場合はオブジェクトが提供する特性と制約によって大きく異なります。オブジェクト システムのモデルは大きく異なる可能性があり、進化し続けています。代わりに、JSON は、名前と値のペアのコレクションを表現するための単純な表記法を提供します。ほとんどのプログラミング言語には、レコード、構造体、辞書、マップ、ハッシュ、 or オブジェクトなどの名前で移動できる、そのようなコレクションを表すための機能があります。

JSON は、順序付けられた値のリストもサポートします。すべてのプログラミング言語には、そのようなリストを表すための機能がいくつかあります。これは、 array 、 vector 、またはlistなどの名前で移動できます。オブジェクトと配列はネストできるため、ツリーやその他の複雑なデータ構造を表すことができます。 JSON の単純な規則を受け入れることで、互換性のないプログラミング言語間で複雑なデータ構造を簡単に交換できます。

JSON は、少なくとも直接的には循環グラフをサポートしていません。 JSON は、バイナリ データを必要とするアプリケーションには示されません。

他の標準がこれを参照し、JSON 構文に厳密に準拠する一方で、セマンティクスの解釈とさまざまなエンコーディングの詳細に制限を課すことが期待されます。このような標準では、特定の動作が必要になる場合があります。 JSON 自体は動作を指定しません。

非常に単純なため、JSON 文法が変更されることはないと予想されます。これにより、JSON は基本的な表記法として非常に安定しています。

JSON は、2001 年にJSON.org Web サイトで最初に世界に提示されました。JSON 構文の定義は、その後 2006 年 7 月に IETF RFC 4627 として公開されました。ECMA-262, 第 5 版 (2009) には、JSON 文法の規範的な仕様が含まれていました。 .この仕様、ECMA-404 は、JSON 構文の以前の定義を置き換えます。同時に、IETF は RFC 7158/7159 を発行し、2017 年には RFC 8259 を RFC 4627 の更新版として発行しました。この仕様と RFC 8259 で指定された JSON 構文は同一であることを意図しています。

1 スコープ

JSON は、データ交換形式を定義するための軽量でテキストベースの言語に依存しない構文です。 ECMAScript プログラミング言語から派生したものですが、プログラミング言語に依存しません。 JSON は、構造化データの移植可能な表現のための構造化ルールの小さなセットを定義します。

この仕様の目標は、有効な JSON テキストの構文を定義することだけです。その意図は、その構文に準拠するテキストのセマンティクスまたは解釈を提供することではありません。また、有効な JSON テキストをプログラミング言語のデータ構造に組み込む方法も意図的に定義していません。 JSON 構文に適用できるセマンティクスは多数あり、JSON テキストをプログラミング言語で処理またはマッピングする方法も多数あります。 JSON を使用した有意義な情報交換には、適用される特定のセマンティクスに関する関係者間の合意が必要です。 JSON の特定のセマンティック解釈を定義することは、他の仕様のトピックになる可能性があります。同様に、JSON の言語マッピングも個別に指定できます。たとえば、ECMA-262 では、有効な JSON テキストと ECMAScript のランタイム データ構造の間のマッピングが定義されています。

3 規範的参考文献

本書の適用には、以下の参考文献が不可欠です。日付のある参考文献については、引用された版のみが適用されます。日付のない参照については、参照文書の最新版 (修正を含む) が適用されます。

ISO/IEC 10646, 情報技術 - Universal Coded Character Set (UCS)

Unicode コンソーシアム。 Unicode 標準 http://www.unicode.org/versions/latest

Bray, T., Ed." The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259.

この仕様と [RFC 8259] はどちらも JSON 文法の仕様を提供していますが、異なる形式を使用しています。その意図は、両方の仕様が同じ構文言語を定義することです。それらの間に違いが見つかった場合、Ecma International と IETF は協力して両方のドキュメントを更新します。いずれかのドキュメントにエラーが見つかった場合は、もう一方を調べて同様のエラーがあるかどうかを確認し、可能であれば修正する必要があります。将来、いずれかの文書が変更された場合、Ecma International と IETF は協力して、変更後も 2 つの文書の整合性が保たれるようにします。 RFC 8259 は、JSON 構文の使用に関するさまざまなセマンティック制限も定義しています。これらの制限は、この仕様の規範ではありません。

参考文献

1ECMA-262, ECMAScript® 言語仕様
2IETF RFC 8259, JavaScript Object Notation (JSON) データ交換フォーマット

Foreword

ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.

The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives ).

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or on the ISO list of patent declarations received (see www.iso.org/patents ).

Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement.

For an explanation on the voluntary nature of standards, the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles in the Technical Barriers to Trade (TBT) see the following URL: www.iso.org/iso/foreword.html .

ISO/IEC 21778 was prepared by Ecma International (as ECMA‐404) and was adopted, under a special"fast‐track procedure", by Joint Technical Committee ISO/IEC JTC 1, Information technology, in parallel with its approval by national bodies of ISO and IEC.

Introduction

JSON 1 is a text syntax that facilitates structured data interchange between all programming languages. JSON is a syntax of braces, brackets, colons, and commas that is useful in many contexts, profiles, and applications. JSON stands for JavaScript Object Notation and was inspired by the object literals of JavaScript aka ECMAScript as defined in the ECMAScript Language Specification, Third Edition.[1] However, it does not attempt to impose ECMAScript’s internal data representations on other programming languages. Instead, it shares a small subset of ECMAScript’s syntax with all other programming languages. The JSON syntax is not a specification of a complete data interchange. Meaningful data interchange requires agreement between a producer and consumer on the semantics attached to a particular use of the JSON syntax. What JSON does provide is the syntactic framework to which such semantics can be attached

JSON syntax describes a sequence of Unicode code points. JSON also depends on Unicode in the hex numbers used in the \u escapement notation.

JSON is agnostic about the semantics of numbers. In any programming language, there can be a variety of number types of various capacities and complements, fixed or floating, binary or decimal. That can make interchange between different programming languages difficult. JSON instead offers only the representation of numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit sequences even if they disagree on internal representations. That is enough to allow interchange.

Programming languages vary widely on whether they support objects, and if so, what characteristics and constraints the objects offer. The models of object systems can be wildly divergent and are continuing to evolve. JSON instead provides a simple notation for expressing collections of name/value pairs. Most programming languages will have some feature for representing such collections, which can go by names like record, struct, dict, map, hash,orobject.

JSON also provides support for ordered lists of values. All programming languages will have some feature for representing such lists, which can go by names like array, vector, or list. Because objects and arrays can nest, trees and other complex data structures can be represented. By accepting JSON’s simple convention, complex data structures can be easily interchanged between incompatible programming languages.

JSON does not support cyclic graphs, at least not directly. JSON is not indicated for applications requiring binary data.

It is expected that other standards will refer to this one, strictly adhering to the JSON syntax, while imposing semantics interpretation and restrictions on various encoding details. Such standards may require specific behaviours. JSON itself specifies no behaviour.

Because it is so simple, it is not expected that the JSON grammar will ever change. This gives JSON, as a foundational notation, tremendous stability.

JSON was first presented to the world at the JSON.org website in 2001. A definition of the JSON syntax was subsequently published as IETF RFC 4627 in July 2006. ECMA-262, Fifth Edition (2009) included a normative specification of the JSON grammar. This specification, ECMA-404, replaces those earlier definitions of the JSON syntax. Concurrently, the IETF published RFC 7158/7159 and in 2017 RFC 8259 as updates to RFC 4627. The JSON syntax specified by this specification and by RFC 8259 are intended to be identical.

1 Scope

JSON is a lightweight, text-based, language-independent syntax for defining data interchange formats. It was derived from the ECMAScript programming language, but is programming language independent. JSON defines a small set of structuring rules for the portable representation of structured data.

The goal of this specification is only to define the syntax of valid JSON texts. Its intent is not to provide any semantics or interpretation of text conforming to that syntax. It also intentionally does not define how a valid JSON text might be internalized into the data structures of a programming language. There are many possible semantics that could be applied to the JSON syntax and many ways that a JSON text can be processed or mapped by a programming language. Meaningful interchange of information using JSON requires agreement among the involved parties on the specific semantics to be applied. Defining specific semantic interpretations of JSON is potentially a topic for other specifications. Similarly, language mappings of JSON can also be independently specified. For example, ECMA-262 defines mappings between valid JSON texts and ECMAScript’s runtime data structures.

3 Normative References

The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

ISO/IEC 10646, Information Technology – Universal Coded Character Set (UCS)

The Unicode Consortium. The Unicode Standard http://www.unicode.org/versions/latest

Bray, T., Ed." The JavaScript Object Notation (JSON) Data Interchange Format", RFC 8259.

This specification and [RFC 8259] both provide specifications of the JSON grammar but do so using different formalisms. The intent is that both specifications define the same syntactic language. If a difference is found between them, Ecma International and the IETF will work together to update both documents. If an error is found with either document, the other should be examined to see if it has a similar error, and fixed if possible. If either document is changed in the future, Ecma International and the IETF will work together to ensure that the two documents stay aligned through the change. RFC 8259, also defines various semantic restrictions on the use of the JSON syntax. Those restrictions are not normative for this specification.

Bibliography

1ECMA-262, ECMAScript® Language Specification
2IETF RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format