Skip to Main Content
JavaScript and Open Data
book

JavaScript and Open Data

by Robert Jeansoulin
August 2018
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 3m
English
Wiley-ISTE
Content preview from JavaScript and Open Data

12Relational Data

We consider in this chapter, the simplest and most popular form of relational data and tabulated data. There exists billions of spreadsheets data, either from Excel, or from other software. Also, data from RDBMS (relational database management systems) can be easily exported as tabulated data, for instance under a “comma separated values” (CSV) format, or, as we have already learned, in JSON files.

Let us detail two important operations that can be done with a simple browser: data aggregation and data join.

12.1. Aggregating tabulated JSON data

The relational nature of tabulated data does not fit well with hierarchical structures, which introduce that which is called “dimensions”, for instance, the spatial dimension of an administrative breakdown or the taxonomic dimension of the scientific classification of the living beings.

This is well-known in database management systems, and data warehouses frequently use the joins and aggregators to pass from relational to hierarchical representations of the same datasets. At the browser scale, we are facing similar issues, and we must realize operations similar to Sql Left Join or Sql GroupBy, between data coming from several JSON files. We describe these processing with the JavaScript code of the following example: the analysis of electoral data.

12.1.1. Electoral data: administrative breakdown, political breakdown

The administrative breakdown is a well-known issue. In France, there are five levels: [communes], ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Wrangling with JavaScript

Data Wrangling with JavaScript

Ashley Davis
Web Applications with Javascript or Java

Web Applications with Javascript or Java

Gerd Wagner, Mircea Diaconescu

Publisher Resources

ISBN: 9781786302045