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], ...
Get JavaScript and Open Data now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.