Difference between revisions of "Java Script Object Notation (JSON)"

From Clinfowiki
Jump to: navigation, search
(Initial Creation)
 
(Added Data Values)
Line 1: Line 1:
'''Java Script Object Notation (JSON)''' is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. [1] [2]  
+
'''Java Script Object Notation (JSON)''' is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. [1][2]  
  
 +
==Data Values==
 +
JSON is used to express data in a combination of 6 different ways, usually expressed in key/value pairs.
  
 +
[[File:value.gif|link=http://www.json.org/value.gif]] [3]
 +
 +
===string===
 +
A JSON string can be one or more words numbers and or symbols. There are special characters used to indicate line breaks and other formatting such as apostrophes.
 +
 +
An example string representation:
 +
 
 +
<code>
 +
"stringKey"="BMI-512_Fall 2015"
 +
</code>
 +
 +
===number===
 +
A JSON number can be an integer or rational number.
 +
 +
An example number representation:
 +
 +
<code>
 +
"numberKey"=-1
 +
</code>
 +
 +
===object===
 +
A JSON Object is a group of JSON data values separated by a comma
 +
 +
An example object representation:
 +
 +
<code>
 +
"objectKey"={"stringKey"="BMI-512_Fall 2015", "numberKey"=-1}
 +
</code>
 +
 +
===array===
 +
A JSON array is an ordered list of values.
 +
 +
An example array representation: 
 +
 +
<code>
 +
"arrayKey"=["Freshman","Sophomore", "Junior", "Senior"]
 +
</code>
 +
 +
===true / false ===
 +
A JSON true / false is used to express Boolean values.
 +
 +
An example true / false representation: 
 +
 +
<code>
 +
"falseKey"="false"
 +
 +
"trueKey"="true"
 +
</code>
 +
 +
===null===
 +
A JSON null represents no value present or unknown value.
 +
 +
An example null representation: 
 +
 +
<code>
 +
"nullKey"=null
 +
</code>
  
 
==References==
 
==References==
 
# RFC 7159 [https://tools.ietf.org/html/rfc7159]
 
# RFC 7159 [https://tools.ietf.org/html/rfc7159]
 
# ECMA-404 [http://www.ecma-international.org/publications/standards/Ecma-404.htm]
 
# ECMA-404 [http://www.ecma-international.org/publications/standards/Ecma-404.htm]
 +
# Value Image [http://www.json.org/value.gif]
  
 
[[Category:Terminology and Coding]]
 
[[Category:Terminology and Coding]]

Revision as of 20:03, 10 October 2015

Java Script Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. [1][2]

Data Values

JSON is used to express data in a combination of 6 different ways, usually expressed in key/value pairs.

File:Value.gif [3]

string

A JSON string can be one or more words numbers and or symbols. There are special characters used to indicate line breaks and other formatting such as apostrophes.

An example string representation:

"stringKey"="BMI-512_Fall 2015"

number

A JSON number can be an integer or rational number.

An example number representation:

"numberKey"=-1

object

A JSON Object is a group of JSON data values separated by a comma

An example object representation:

"objectKey"={"stringKey"="BMI-512_Fall 2015", "numberKey"=-1}

array

A JSON array is an ordered list of values.

An example array representation:

"arrayKey"=["Freshman","Sophomore", "Junior", "Senior"]

true / false

A JSON true / false is used to express Boolean values.

An example true / false representation:

"falseKey"="false"

"trueKey"="true"

null

A JSON null represents no value present or unknown value.

An example null representation:

"nullKey"=null

References

  1. RFC 7159 [1]
  2. ECMA-404 [2]
  3. Value Image [3]