Week_09_json
Week_09_json
Data JSON
deep dive
COMP 1238 - week 9
COMP1238 - Intro to Data Management
Week 9 - Tue, Oct 29
Structured data
JSON deep dive Start at:
16:05
AtKlass code:
COMP 1238 – Introduction to
Data Management
● Keyboards
● Text editors
● Git & GitHub
● Command line & Terminal window
Second half of the course
Is an introduction to
Databases and SQL
SQL is a language used to
interact with databases
Agenda for today
● Mid-term stats
● What is Structured Data
● Spreadsheets and JSON as examples
● JSON Data Types
○ strings, numbers, booleans arrays and objects (and null)
● YAML as an extension of JSON
● XML & Binary representations - brief mention
Objective: Introduce JSON and the basic principles behind it and other
text based formats.
Midterm stats
Midterm stats
Class Average - 88%
Median - 92%
Bottom 3 questions - git commit
What is the function of the 'commit' command in Git?
A. To delete files from the repository
B. To save changes to your local repository (commit)
C. To upload changes to the remote repository (push /
sync)
D. To compare differences between files
Bottom 3 questions - character escaping \#
In Markdown we sometimes want to "escape" some
characters so that they are displayed literally, as is and not
interpreted as special. How would one escape the # character
in Markdown so it's not interpreted as the beginning of a title?
A. ##
B. \#
C. <#>
D. escape("#")
Bottom 3 questions - word processor
Which of the following tools is better described as a "word
processor" rather than a text editor?
A. Vim
B. Microsoft Word
C. VS Code
D. Notepad
Structured data
Structured data …
is the boring type
of data, like your
spreadsheets
Ann, 5 years
old
Some terminology
Each card in the catalogue is called a Record or an Entry
Key Key
Value Value
Value types - scalars & objects
{
"arrayExample1": [1, 2, 3],
"arrayExample2": ["a", "b", 3, false],
"arrayExample3": [{ "x": 3, "y": 4}, { "x": 7, "y": 9}],
}
Array of Objects
[
{
"title": "Romanian Furrow",
"published": 1933
},
{
"title": "The Great Gatsby",
"published": 1925
},
{
"title": "The Grapes of Wrath",
"published": 1939
}
]
Key-value data - other names
Data structures similar to JSON object that holds key-value
pairs have many names:
● Associative array
● Dictionary
● Map
● Hash Map / Hash Table
JSON limitations
● Very strict - must use quotation marks and commas
● Writing JSON by hand is notoriously annoying with all the {“
”},
● No support for comments