WOLFRAM LANGUAGE IMPORT/EXPORT FORMAT
■ MIME type: application/json.
■ Data interchange format.
■ RawJSON supports full JSON syntax but uses a specific interpretation.
■ RawJSON identifies JSON objects with Wolfram Language associations.
■ JSON is commonly used in web programming.
■ JSON was developed in 2001.
■ JSON is published as RFC 4627.
- Import["file","RawJSON"] imports a JSON file as a combination of nested lists and associations.
- ImportString["string","RawJSON"] imports a JSON string.
- Export["file",expr,"RawJSON"] exports a combination of nested lists and associations to a JSON file.
- ExportString[expr,"RawJSON"] exports to a JSON string.
- See the main function pages for full general information on Import and Export.
- ImportString and ExportString support the RawJSON data format.
- General Import elements:
|"Elements" ||list of elements and options available in this file|
|"Rules"||full list of rules for each element and option|
|"Options"||list of rules for options, properties, and settings|
- Data representation element:
|"Data"||contents of a JSON file as nested lists or associations|
- Import by default uses the element.
- The "RawJSON" format identifies JSON objects of the form with associations of the form in the Wolfram Language.
- "RawJSON" identifies JSON lists with Wolfram Language lists .
- Strings in the Wolfram Language are represented in RawJSON as UTF-8 strings, escaped as required by the JSON standard.
- Numbers where scientific notation is used are given in RawJSON in E notation.
- The symbols True and False are represented in RawJSON as the values and .
- The symbol Null is represented as the JSON value .
- Export options:
|"Compact"||False||whether to omit line breaks and tabs|
Import a JSON list:
Give a string consisting of a JSON object:
Importing this string gives an association:
Import the contents of a JSON file:
Import a URL:
Export an expression to a JSON string:
Export a list of chemical elements and their properties to a JSON file:
Export to a string:
Introduced in 2015