Ion
Filename extension
.ion
Internet media typeapplication/ion
Developed byAmazon
Type of formatData interchange
Websiteamzn.github.io/ion-docs/

Ion is a data serialization language developed by Amazon. It may be represented by either a human-readable text form or a compact binary form. The text form is a superset of JSON; thus, any valid JSON document is also a valid Ion document.

Data types

edit

As a superset of JSON, Ion includes the following data types

  • null: An empty value (for JSON compatibility)
  • bool: Boolean values
  • string: Unicode text literals
  • list: Ordered heterogeneous collection of Ion values (extension of JSON array)
  • struct: Unordered collection of key/value pairs (extension of JSON object)

The nebulous JSON 'number' type is strictly defined in Ion to be one of

  • int: Signed integers of arbitrary size
  • float: 64-bit IEEE binary-encoded floating point numbers
  • decimal: Decimal-encoded real numbers of arbitrary precision

Ion adds these types:

  • timestamp: Date/time/time zone moments of arbitrary precision
  • symbol: Unicode symbolic atoms (aka identifiers), stored as interned strings in binary format
  • blob: Binary data of user-defined encoding
  • clob: Text data of user-defined encoding
  • sexp: Nested list of values (equivalent to an S-expression) with application-defined semantics

Each Ion type supports a null variant, indicating a lack of value while maintaining a strict type (e.g., null.int, null.struct).

The Ion format permits attaching one or more annotations (i.e. a list of symbols) to any value. Such annotations may be used as metadata for otherwise opaque data (such as a blob).

Implementations

edit

Examples

edit

Sample document

edit

Features seen in JavaScript and JSON5:

// Comments are allowed using the double forward slash 
{
  key: "value",   // key here is a symbol, it can also be a string as in JSON
  nums: 1_000_000, // equivalent to 1000000, use of underscores with numbers is more readable
  "A float": 31415e-4,  // key is a value that contains spaces 
}

Features unique to Ion:

{
  symbol: 'a symbol',     // symbols are interned Unicode strings
  "A null integer": null.int,
  annotated: age::35,     // the symbol "age" is attached to the value "35" as an annotation
  lists : 'hw grades'::[80, 85, 90], // any symbol can be used as an annotation 
  many_annot: I::have::many::annotations::true, // annotations are not nested, but rather, a list of annotations
  sexp: (this (is a [valid] "Ion") last::value + 42) // Ion S-expressions. 'this', 'is', 'a', 'valid', 'value', and '+' are symbols.
  _value: {{OiBTIKUgTyAASb8=}}, // blob value is represented as base64
  _value: {{"a b\0\xff"}}             // clob value is represented as an ASCII string with C-style escapes
  // ^ repeated names (keys) are allowed but generate a warning for undefined behavior 
}

Uses

edit
  • Amazon's Quantum Ledger Database (QLDB) stores data in Ion documents.[1]
  • PartiQL, an open source SQL-based query language also by Amazon, is built upon Ion. PartiQL supported queries are used by QLDB, S3Select.[2]

Tooling and extensions

edit

References

edit
  1. ^ "We are the Amazon Managed Blockchain and Amazon QLDB Teams – Ask the AWS Experts – November 29 @ 3PM PST / 6PM EST". 28 November 2018.
  2. ^ "Announcing PartiQL: One query language for all your data". August 2019.
edit

📚 Artikel Terkait di Wikipedia

Comparison of data-serialization formats

This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages

Smile (data interchange format)

Smile is a computer data interchange format based on JSON. It can also be considered a binary serialization of the generic JSON data model, which means

List of file signatures

itkach/slob: Data store for Aard 2 "Java Object Serialization Specification: 6 - Object Serialization Stream Protocol". "J3k0/OpenPFB". GitHub. 25 June

JSON

infrastructure engineering. BSON Comparison of data-serialization formats Extensible Data Notation Amazon Ion – a superset of JSON (though limited to UTF-8

Ion (disambiguation)

Industries Ion (serialization format), a data serialization language developed by Amazon Index to Organism Names (ION), a database of published names

Protocol Buffers

Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs that communicate

Digital pathology

binary container format for whole-slide images developed at the University of Michigan. Built upon contemporary performance serialization technology and

ROOT

command line interpreter (CINT in version 5, cling in version 6), object serialization and persistence. The packages provided by ROOT include those for Histogramming