Java:Data Science Made Easy
上QQ阅读APP看书,第一时间看更新

Overview of JSON

JavaScript Object Notation (JSON) (http://www.JSON.org/) is a data format used to interchange data. It is easy for humans or machines to read and write. JSON is supported by many languages, including Java, which has several JSON libraries listed at http://www.JSON.org/.

A JSON entity is composed of a set of name-value pairs enclosed in curly braces. We will use this format in several of our examples. In handling YouTube, we will use a JSON object, some of which is shown next, representing the results of a request from a YouTube video:

{ 
"kind": "youtube#searchResult",
"etag": "etag",
"id": {
"kind": string,
"videoId": string,
"channelId": string,
"playlistId": string
},
...
}

Accessing the fields and values of such a document is not hard and is illustrated in Chapter 3, Data Cleaning.