JSON-stat
a simple light standard
for all kinds of data disseminators
Xavier Badosa
@badosa
http://xavierbadosa.com
http://json-stat.org
December, 2015
a simple light standard
for all kinds of data disseminators
Who needs to disseminate data?
Who needs to disseminate data?
Nowadays? Everybody!
Of course!
NSOs*
Central Banks
Intl. orgs
* National Statistical Offices
Companies
The media
Citizens…
But also
NGOs
a simple light standard
for all kinds of data disseminators
How is data usually disseminated?
a simple light standard
for all kinds of data disseminators
How is data usually disseminated?
intableform
intableform
Wherever there’s data
addressed to humans
there is (usually) a table
plain old tables
Why are tables so popular?
Why are tables so popular?
a display device
Tablesare
a display device
with analytical features
an abbreviation, a compressor
a metadata saver
a cube model
that avoids
repeating
metadata
for every cell
an abbreviation, a compressor
a metadata saver
Cubic
Thinking
Describe data
in dimension terms
Simple, for everybody? How?
a simple light standard
for all kinds of data disseminators
Simple, for everybody? How?
If you managed to disseminate data
for humans in tables, you should be
able to do it for machines with no effort!
a simple light standard
for all kinds of data disseminators
JSON is a data format used in
most APIs. It can include data
and metadata in a single doc.
Simple, for everybody? How?
In JSON.
Using a very simple cube model
that mimics a plain old table.
Simple, for everybody? How?
In JSON-stat.
A Canadian Example
table
data
What’s the simplest way to express these data in JSON?
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
anarray
(flat)
What’s the simplest way to express these data in JSON?
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
Basic metadata?
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
"value" :
"class" : "dataset",
"label" : "Population by sex and age group. Canada. 2012",
"source" : "Statistics Canada, CANSIM, table 051-0001",
"updated" : "2012-09-27",
}
{
[
] ,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
"value" :
}
{
"id" : [ "country" , "year" , "age" , "concept" , "sex" ],
"size" : [ 1 , 1 , 20 , 2 , 3 ],
"class" : "dataset",
"label" : "Population by sex and age group. Canada. 2012",
"source" : "Statistics Canada, CANSIM, table 051-0001",
"updated" : "2012-09-27",
"dimension" : { … }
id and size are needed to “unflatten” the value array.
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
"id" : [ "country" , "year" , "age" , "concept" , "sex" ],
"size" : [ 1 , 1 , 20 , 2 , 3 ],
"dimension" : { … }
id and size are needed to “unflatten” the value array.
Method: Row-major order
In computing, row-major order and column-
major order describe methods for arranging
multidimensional arrays in linear storage such
as memory.
value
note/source/updated
label
dimension
age
dimension
age 20 categories
dimension
Size
age
Role
20 class
dimension
Size
age
concept
20
2
class
metric
dimension
RoleSize
age
concept
sex
20
2
3
class
metric
class
dimension
RoleSize
age
concept
sex
country
20
2
3
1
class
metric
class
geo
dimension
RoleSize
age
concept
sex
country
year
20
2
3
1
1
class
metric
class
geo
time
dimension
RoleSize
JSON-stat, a simple light standard for all kinds of data disseminators
Persons (thousands)
2012
Canada
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
To make sense of this array, dimensions must be ordered.
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
["country", "year", "age", "concept", "sex"]
To make sense of this array, dimensions must be ordered.
["country", "year", "age", "concept", "sex"]
Criterion:
What does not change, first.
To make sense of this array, dimensions must be ordered.
(Position of dimensions of size 1 is irrelevant.)
country
year
age
concept
sex
CA CA CA CA CA CA
2012 2012 2012 2012 2012 2012
Total Total Total Total Total Total
Persons Persons Persons % % %
Total TotalM M FF
What does not change, first.
"value" : [ … ]
}
{
"version" : "2.0",
"class" : "dataset",
"label" : "Population by sex and age group. Canada. 2012",
"source" : "Statistics Canada, CANSIM, table 051-0001",
"updated" : "2012-09-27",
"id" : [ "country" , "year" , "age" , "concept" , "sex" ],
"size" : [ 1 , 1 , 20 , 2 , 3 ],
"role" : { "time" : ["year"] , "geo" : ["country"] , "metric" : ["concept"] },
"dimension" : { … }
"value" : [ … ]
}
{
"id" : [ "country" , "year" , "age" , "concept" , "sex" ],
"size" : [ 1 , 1 , 20 , 2 , 3 ],
"role" : { "time" : ["year"] , "geo" : ["country"] , "metric" : ["concept"] },
"dimension" : {
"country" : { … },
"year" : { … },
"age" : { … },
"concept" : { … },
"sex" : { … }
}
"version" : "2.0",
"class" : "dataset",
"label" : "Population by sex and age group. Canada. 2012",
"source" : "Statistics Canada, CANSIM, table 051-0001",
"updated" : "2012-09-27",
country
year
age
concept
sex
CA CA CA CA CA CA
2012 2012 2012 2012 2012 2012
Total Total Total Total Total Total
Persons Persons Persons % % %
Total TotalM M FF
"value" : [ … ]
}
{
"id" : [ "country" , "year" , "age" , "concept" , "sex" ],
"size" : [ 1 , 1 , 20 , 2 , 3 ],
"role" : { "time" : ["year"] , "geo" : ["country"] , "metric" : ["concept"] },
"dimension" : {
"country" : { … },
"year" : { … },
"age" : { … },
"concept" : { … },
"sex" : { … }
}
"version" : "2.0",
"class" : "dataset",
"label" : "Population by sex and age group. Canada. 2012",
"source" : "Statistics Canada, CANSIM, table 051-0001",
"updated" : "2012-09-27",
"sex" : {
"label" : "sex",
"category" : {
"index" : ["T", "M", "F"],
"label" : {
"T" : "Total",
"M" : "Male",
"F" : "Female"
}
}
}
"sex" : {
"label" : "sex",
"category" : {
"index" : ["T", "M", "F"],
"label" : {
"T" : "Total",
"M" : "Male",
"F" : "Female"
}
}
}
{"T" : 0, "M" : 1, "F" : 2},
Also accepted
(faster access)*
* See “Arrays vs. Objects”
http://bl.ocks.org/5708161
The “unflattening” problem
The “unflattening” problem
from
dimension
positions
[0,0,7,0,2]
The “unflattening” problem
from
dimension
positions
to value
position
44[0,0,7,0,2]
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
["country", "year", "age", "concept", "sex"]
[
]
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
["country", "year", "age", "concept", "sex"]
0 1 2 3 4 5…
44
…120
Persons (thousands)
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0 is the first position
(first category of the dimension)
Persons (thousands)
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0
1
2
3
4
5
6
7
Persons (thousands)
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0 1
0
Persons (thousands)
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0
0 1 2
Persons (thousands)
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0
[0, 0, 7, 0, 2] → 44
2012
Canada
["country", "year", "age", "concept", "sex"]
0
0
0
[ 1, 1, 20, 2, 3 ]
Persons (thousands)
(Size)
[0, 0, 7, 0, 2] → 44
The“unflattening” problem
["country", "year", "age", "concept", "sex"]
[ 1, 1, 20, 2, 3 ]
[0, 0, 7, 0, 2] → 44
The“unflattening” problem
["country", "year", "age", "concept", "sex"]
[ 1, 1, 20, 2, 3 ]
It’s a simple
mathematical
problem
Compute value
position using
dimension
position & size
[0, 0, 7, 0, 2] → 44
Lost in cells?
Method: Row-major order
In computing, row-major order and column-
major order describe methods for arranging
multidimensional arrays in linear storage such
as memory.
Lost in cells?
There’s a Javascript library that
takes care of this.
Lost in cells?
Are you a coder? Do you want to
develop your own library?
arr2num(
[0,0,7,0,2],
[1,1,20,2,3]
)
44
Lost in cells?
Here’s a simple solution to
the “unflattening” problem.
function arr2num( arr, size ){
for(var i=0, num=0, mult=1, ndims=size.length; i<ndims; i++){
mult*=(i>0) ? size[ndims-i] : 1;
num+=mult*arr[ndims-i-1];
}
return num;
}
arr2num(
[0,0,7,0,2],
[1,1,20,2,3]
)
44
Lost in cells?
Or check the sample code section
at http://json-stat.org/tools/
function arr2num( arr, size ){
for(var i=0, num=0, mult=1, ndims=size.length; i<ndims; i++){
mult*=(i>0) ? size[ndims-i] : 1;
num+=mult*arr[ndims-i-1];
}
return num;
}
The JSON-stat
Ecosystem
format
libs
conn.
schema
thank you
all pictures from
Blocks picture in slide 1: Soma, by Dru! (CC BY-NC)
Cubic head in slide 13: Portrait by Thomas Leth-Olsen (CC BY)
Rubik’s Cube in slide 18: BW Rubik’s Cube,
by Gerwin Sturm (CC BY-SA)
Shiny cube in slide 48: SONY DSC, by Javier
Manso (CC BY-NC-SA)
Walking girl in slide 61: Sterile, by Lee
Nachtigal (CC BY)
Atomium in slide 66: Fighting Gravity –
Atomium, Brussels, by Jan Faborsky
(CC BY-NC-ND)
Eggs in slide 77: Eggs n. 3, by Leonardo
D’Amico (CC BY-SA-ND)

More Related Content

PDF
JSON-stat & JS: the JSON-stat Javascript Toolkit
PPTX
Présentation spring data Matthieu Briend
PDF
structuration des métadonnées de pérennisation
PDF
FIWARE Wednesday Webinars - NGSI-LD and Smart Data Models: Standard Access to...
PPT
Uzytkownicy informacji
PDF
Création de Services et Configuration du ESB avec TalendESB
PDF
giao-trinh-minna -no-nihongo -i-ban-dich-tieng-viet-ebook.pdf
PPTX
RESTful API 제대로 만들기
JSON-stat & JS: the JSON-stat Javascript Toolkit
Présentation spring data Matthieu Briend
structuration des métadonnées de pérennisation
FIWARE Wednesday Webinars - NGSI-LD and Smart Data Models: Standard Access to...
Uzytkownicy informacji
Création de Services et Configuration du ESB avec TalendESB
giao-trinh-minna -no-nihongo -i-ban-dich-tieng-viet-ebook.pdf
RESTful API 제대로 만들기

What's hot (16)

PPTX
Building Next-Generation Web APIs with JSON-LD and Hydra
PDF
DSpace 7 - The Power of Configurable Entities
PDF
Zachowania informacyjne
PPTX
C# Database操作5 SqlDataAdapterを使用したデータの取得-
PPTX
CORS - Enable Alfresco for CORS
PDF
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 2.2.0対応)
PDF
Json in Postgres - the Roadmap
 
PDF
【Japan Partner Conference 2019】Teams + UniTalk で実現するコミュニケーション 4.0
PDF
DSpace: Technical Basics
PPTX
Dspace 7 presentation
PDF
Zachowania informacyjne naukowców: w poszukiwaniu modelu zintegrowanego
PDF
Fiware overview
PDF
도메인 주도 설계의 본질
DOCX
SPARQL queries on CIDOC-CRM data of BritishMuseum
PPTX
Orion Context Broker 20220526
PPTX
MongoDB Overview
Building Next-Generation Web APIs with JSON-LD and Hydra
DSpace 7 - The Power of Configurable Entities
Zachowania informacyjne
C# Database操作5 SqlDataAdapterを使用したデータの取得-
CORS - Enable Alfresco for CORS
FIWARE Orion Context Broker コンテキスト情報管理 (Orion 2.2.0対応)
Json in Postgres - the Roadmap
 
【Japan Partner Conference 2019】Teams + UniTalk で実現するコミュニケーション 4.0
DSpace: Technical Basics
Dspace 7 presentation
Zachowania informacyjne naukowców: w poszukiwaniu modelu zintegrowanego
Fiware overview
도메인 주도 설계의 본질
SPARQL queries on CIDOC-CRM data of BritishMuseum
Orion Context Broker 20220526
MongoDB Overview
Ad

Similar to JSON-stat, a simple light standard for all kinds of data disseminators (20)

PDF
Consuming Nordic Statbank data with JSON-stat
PPTX
The Use of Data and Datasets in Data Science
PPTX
Lec 3.pptx
DOCX
Data mining BY Zubair Yaseen
PPTX
Cluster Analysis.pptx
PDF
clusteranalysis_simplexrelated to ai.pdf
PDF
Gov APIs: The Notorious Case of Official Statistics
PDF
Data Clustering Theory Algorithms And Applications Guojun Gan
PDF
Module - 5 Machine Learning-22ISE62.pdf
PDF
Clustering Algorithms - Kmeans,Min ALgorithm
PDF
Nicholas Jewell MedicReS World Congress 2014
PPTX
Clustering.pptx
PPTX
Clustering.pptx
PPTX
Clustering, Types of clustering, Types of data
PDF
Clustering training
PDF
CLUSTERING IN DATA MINING.pdf
PDF
Data Mining - Introduction and Data
PPTX
Cluster Analysis in Business Research Methods
PDF
Data Anayltics: How to predict anything
PPT
3.1 clustering
Consuming Nordic Statbank data with JSON-stat
The Use of Data and Datasets in Data Science
Lec 3.pptx
Data mining BY Zubair Yaseen
Cluster Analysis.pptx
clusteranalysis_simplexrelated to ai.pdf
Gov APIs: The Notorious Case of Official Statistics
Data Clustering Theory Algorithms And Applications Guojun Gan
Module - 5 Machine Learning-22ISE62.pdf
Clustering Algorithms - Kmeans,Min ALgorithm
Nicholas Jewell MedicReS World Congress 2014
Clustering.pptx
Clustering.pptx
Clustering, Types of clustering, Types of data
Clustering training
CLUSTERING IN DATA MINING.pdf
Data Mining - Introduction and Data
Cluster Analysis in Business Research Methods
Data Anayltics: How to predict anything
3.1 clustering
Ad

More from Xavier Badosa (20)

PDF
Putting Data in Cells
PDF
JSON-stat in the Sea of Standards
PDF
The Trouble with Tables
PDF
StatisticalTable, a JSON-stat-based vocabulary
PDF
Decoupling Official Statistics
PDF
JSON-stat in the session "The future of standards in statistics", United Nati...
PDF
Data Dissemination through Data Visualization
PDF
Reutilización de datos gracias a la visualización de datos
PDF
Idescat Visual: Gràfics i mapes
PDF
Periodisme de dades i oficines estadístiques
PPTX
Difusió estadísTICa oficial
PPTX
Links and Widgets: the Fabric of the Web
PPTX
La difusión estadística y la apertura de datos: un viaje de ida y vuelta
PPTX
Standards for statistical data dissemination: a wish list
PPTX
What's our business? Statistics as platform
PPTX
Idescat on the Google Public Data Explorer
PPTX
El Idescat en Google Public Data Explorer
PPTX
Los widgets del Idescat: una aplicación de las APIs
PPTX
Anatomía de las APIs del Idescat
PPTX
Rectificaciones: una propuesta de estándar
Putting Data in Cells
JSON-stat in the Sea of Standards
The Trouble with Tables
StatisticalTable, a JSON-stat-based vocabulary
Decoupling Official Statistics
JSON-stat in the session "The future of standards in statistics", United Nati...
Data Dissemination through Data Visualization
Reutilización de datos gracias a la visualización de datos
Idescat Visual: Gràfics i mapes
Periodisme de dades i oficines estadístiques
Difusió estadísTICa oficial
Links and Widgets: the Fabric of the Web
La difusión estadística y la apertura de datos: un viaje de ida y vuelta
Standards for statistical data dissemination: a wish list
What's our business? Statistics as platform
Idescat on the Google Public Data Explorer
El Idescat en Google Public Data Explorer
Los widgets del Idescat: una aplicación de las APIs
Anatomía de las APIs del Idescat
Rectificaciones: una propuesta de estándar

Recently uploaded (20)

PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
Optimizing bioinformatics applications: a novel approach with human protein d...
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
State of AI in Business 2025 - MIT NANDA
PDF
Fitaura: AI & Machine Learning Powered Fitness Tracker
PPTX
Information-Technology-in-Human-Society.pptx
PPT
Overviiew on Intellectual property right
PDF
Examining Bias in AI Generated News Content.pdf
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PDF
Advancements in abstractive text summarization: a deep learning approach
PDF
Gestión Unificada de los Riegos Externos
PDF
The AI Revolution in Customer Service - 2025
PDF
Decision Optimization - From Theory to Practice
PPTX
maintenance powerrpoint for adaprive and preventive
Intravenous drug administration application for pediatric patients via augmen...
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
CEH Module 2 Footprinting CEH V13, concepts
EIS-Webinar-Regulated-Industries-2025-08.pdf
Report in SIP_Distance_Learning_Technology_Impact.pptx
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Optimizing bioinformatics applications: a novel approach with human protein d...
Data Virtualization in Action: Scaling APIs and Apps with FME
State of AI in Business 2025 - MIT NANDA
Fitaura: AI & Machine Learning Powered Fitness Tracker
Information-Technology-in-Human-Society.pptx
Overviiew on Intellectual property right
Examining Bias in AI Generated News Content.pdf
How to Convert Tickets Into Sales Opportunity in Odoo 18
Advancements in abstractive text summarization: a deep learning approach
Gestión Unificada de los Riegos Externos
The AI Revolution in Customer Service - 2025
Decision Optimization - From Theory to Practice
maintenance powerrpoint for adaprive and preventive

JSON-stat, a simple light standard for all kinds of data disseminators