SlideShare a Scribd company logo

JSON-stat & JS: the JSON-stat Javascript Toolkit

This presentation was part of the introductory JSON-stat presentation (July, 2013): http://www.slideshare.net/badosa/json-stat That presentation was split into three presentations between December 2015 and January 2016 and mainly updated to reflect the latest changes in the format (v. 2.0).

1 of 51
JSON-stat & JS
the JSON-stat Javascript Toolkit
Xavier Badosa
@badosa
https://xavierbadosa.com
https://json-stat.org
July, 2013
(updated to JSON-stat 2.0 in January, 2016)
The JSON-stat
Ecosystem
format
libs
conn.
schema
Introducing
the
JSON-stat
Javascript
Toolkit
json-stat.com
Introducing
the
JSON-stat
Javascript
Toolkit
It’s a Javascript
library that helps
you dealing with
JSON-stat
responses.
Introducing
the
JSON-stat
Javascript
Toolkit
It offers methods
to easily traverse
the JSON-stat
tree:
Dataset
Dimension
Category
Data
Introducing
the
JSON-stat
Javascript
Toolkit
It uses three
general
properties:
label
length
id
Ad

Recommended

JSON-stat, a simple light standard for all kinds of data disseminators
JSON-stat, a simple light standard for all kinds of data disseminatorsJSON-stat, a simple light standard for all kinds of data disseminators
JSON-stat, a simple light standard for all kinds of data disseminatorsXavier Badosa
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Adnan Sohail
 
MongoDB Evenings Chicago - WindyGrid: Utilizing MongoDB for a Smarter & Safer...
MongoDB Evenings Chicago - WindyGrid: Utilizing MongoDB for a Smarter & Safer...MongoDB Evenings Chicago - WindyGrid: Utilizing MongoDB for a Smarter & Safer...
MongoDB Evenings Chicago - WindyGrid: Utilizing MongoDB for a Smarter & Safer...MongoDB
 
第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出し第5回 様々なファイル形式の読み込みとデータの書き出し
第5回 様々なファイル形式の読み込みとデータの書き出しWataru Shito
 
JSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked DataJSON-LD: JSON for Linked Data
JSON-LD: JSON for Linked DataGregg Kellogg
 
Csv python-project
Csv python-projectCsv python-project
Csv python-projectRida Khalid
 

More Related Content

What's hot

Pandas Cheat Sheet
Pandas Cheat SheetPandas Cheat Sheet
Pandas Cheat SheetACASH1011
 
XML Avancé : DTD, XSD, XPATH, XSLT, XQuery
XML Avancé : DTD, XSD, XPATH, XSLT, XQueryXML Avancé : DTD, XSD, XPATH, XSLT, XQuery
XML Avancé : DTD, XSD, XPATH, XSLT, XQueryRachid NID SAID
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoringShraddha Patel
 
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...Camille Santa Maria
 
28 work and line integrals
28 work and line integrals28 work and line integrals
28 work and line integralsmath267
 
9 determinant and cross product
9 determinant and cross product9 determinant and cross product
9 determinant and cross productmath267
 
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar Series
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar SeriesBest Practices for Running MongoDB on AWS - AWS May 2016 Webinar Series
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar SeriesAmazon Web Services
 

What's hot (9)

Pandas Cheat Sheet
Pandas Cheat SheetPandas Cheat Sheet
Pandas Cheat Sheet
 
XML Avancé : DTD, XSD, XPATH, XSLT, XQuery
XML Avancé : DTD, XSD, XPATH, XSLT, XQueryXML Avancé : DTD, XSD, XPATH, XSLT, XQuery
XML Avancé : DTD, XSD, XPATH, XSLT, XQuery
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
 
Apostila de vb
Apostila de vbApostila de vb
Apostila de vb
 
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...
Tableaux croisés dynamiques sous Excel: des outils simples pour une analyse r...
 
28 work and line integrals
28 work and line integrals28 work and line integrals
28 work and line integrals
 
9 determinant and cross product
9 determinant and cross product9 determinant and cross product
9 determinant and cross product
 
Bit manipulation
Bit manipulationBit manipulation
Bit manipulation
 
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar Series
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar SeriesBest Practices for Running MongoDB on AWS - AWS May 2016 Webinar Series
Best Practices for Running MongoDB on AWS - AWS May 2016 Webinar Series
 

Similar to JSON-stat & JS: the JSON-stat Javascript Toolkit

Working with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONWorking with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONSV.CO
 
More expressive types for spark with frameless
More expressive types for spark with framelessMore expressive types for spark with frameless
More expressive types for spark with framelessMiguel Pérez Pasalodos
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling rogerbodamer
 
DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009Dirkjan Bussink
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDBlehresman
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDbsliimohara
 
Automatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsAutomatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsFederico Tomassetti
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
 
Casting for not so strange actors
Casting for not so strange actorsCasting for not so strange actors
Casting for not so strange actorszucaritask
 
Why MongoDB is awesome
Why MongoDB is awesomeWhy MongoDB is awesome
Why MongoDB is awesomeJohn Nunemaker
 
Webinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkWebinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkMongoDB
 
Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2blprnt
 
Schema design short
Schema design shortSchema design short
Schema design shortMongoDB
 
Webinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible SchemasWebinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible SchemasMongoDB
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightDonny Wals
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)William Narmontas
 
Consuming Nordic Statbank data with JSON-stat
Consuming Nordic Statbank data with JSON-statConsuming Nordic Statbank data with JSON-stat
Consuming Nordic Statbank data with JSON-statXavier Badosa
 

Similar to JSON-stat & JS: the JSON-stat Javascript Toolkit (20)

Working with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONWorking with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSON
 
Json at work overview and ecosystem-v2.0
Json at work   overview and ecosystem-v2.0Json at work   overview and ecosystem-v2.0
Json at work overview and ecosystem-v2.0
 
More expressive types for spark with frameless
More expressive types for spark with framelessMore expressive types for spark with frameless
More expressive types for spark with frameless
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling
 
DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009DataMapper @ RubyEnRails2009
DataMapper @ RubyEnRails2009
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 
jQuery Datatables With MongDb
jQuery Datatables With MongDbjQuery Datatables With MongDb
jQuery Datatables With MongDb
 
Automatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsAutomatically Spotting Cross-language Relations
Automatically Spotting Cross-language Relations
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
Casting for not so strange actors
Casting for not so strange actorsCasting for not so strange actors
Casting for not so strange actors
 
Why MongoDB is awesome
Why MongoDB is awesomeWhy MongoDB is awesome
Why MongoDB is awesome
 
Webinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkWebinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation Framework
 
Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2
 
Schema design short
Schema design shortSchema design short
Schema design short
 
Webinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible SchemasWebinar: Strongly Typed Languages and Flexible Schemas
Webinar: Strongly Typed Languages and Flexible Schemas
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)
 
Consuming Nordic Statbank data with JSON-stat
Consuming Nordic Statbank data with JSON-statConsuming Nordic Statbank data with JSON-stat
Consuming Nordic Statbank data with JSON-stat
 

More from Xavier Badosa

Putting Data in Cells
Putting Data in CellsPutting Data in Cells
Putting Data in CellsXavier Badosa
 
JSON-stat in the Sea of Standards
JSON-stat in the Sea of StandardsJSON-stat in the Sea of Standards
JSON-stat in the Sea of StandardsXavier Badosa
 
The Trouble with Tables
The Trouble with TablesThe Trouble with Tables
The Trouble with TablesXavier Badosa
 
StatisticalTable, a JSON-stat-based vocabulary
StatisticalTable, a JSON-stat-based vocabularyStatisticalTable, a JSON-stat-based vocabulary
StatisticalTable, a JSON-stat-based vocabularyXavier Badosa
 
Decoupling Official Statistics
Decoupling Official StatisticsDecoupling Official Statistics
Decoupling Official StatisticsXavier Badosa
 
JSON-stat in the session "The future of standards in statistics", United Nati...
JSON-stat in the session "The future of standards in statistics", United Nati...JSON-stat in the session "The future of standards in statistics", United Nati...
JSON-stat in the session "The future of standards in statistics", United Nati...Xavier Badosa
 
Data Dissemination through Data Visualization
Data Dissemination through Data VisualizationData Dissemination through Data Visualization
Data Dissemination through Data VisualizationXavier Badosa
 
Reutilización de datos gracias a la visualización de datos
Reutilización de datos gracias a la visualización de datosReutilización de datos gracias a la visualización de datos
Reutilización de datos gracias a la visualización de datosXavier Badosa
 
Idescat Visual: Gràfics i mapes
Idescat Visual: Gràfics i mapesIdescat Visual: Gràfics i mapes
Idescat Visual: Gràfics i mapesXavier Badosa
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsXavier Badosa
 
Periodisme de dades i oficines estadístiques
Periodisme de dades i oficines estadístiquesPeriodisme de dades i oficines estadístiques
Periodisme de dades i oficines estadístiquesXavier Badosa
 
Difusió estadísTICa oficial
Difusió estadísTICa oficialDifusió estadísTICa oficial
Difusió estadísTICa oficialXavier Badosa
 
Links and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the WebLinks and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the WebXavier Badosa
 
La difusión estadística y la apertura de datos: un viaje de ida y vuelta
La difusión estadística y la apertura de datos: un viaje de ida y vueltaLa difusión estadística y la apertura de datos: un viaje de ida y vuelta
La difusión estadística y la apertura de datos: un viaje de ida y vueltaXavier Badosa
 
Standards for statistical data dissemination: a wish list
Standards for statistical data dissemination: a wish listStandards for statistical data dissemination: a wish list
Standards for statistical data dissemination: a wish listXavier Badosa
 
What's our business? Statistics as platform
What's our business? Statistics as platformWhat's our business? Statistics as platform
What's our business? Statistics as platformXavier Badosa
 
Idescat on the Google Public Data Explorer
Idescat on the Google Public Data ExplorerIdescat on the Google Public Data Explorer
Idescat on the Google Public Data ExplorerXavier Badosa
 
El Idescat en Google Public Data Explorer
El Idescat en Google Public Data ExplorerEl Idescat en Google Public Data Explorer
El Idescat en Google Public Data ExplorerXavier Badosa
 
Los widgets del Idescat: una aplicación de las APIs
Los widgets del Idescat: una aplicación de las APIsLos widgets del Idescat: una aplicación de las APIs
Los widgets del Idescat: una aplicación de las APIsXavier Badosa
 
Anatomía de las APIs del Idescat
Anatomía de las APIs del IdescatAnatomía de las APIs del Idescat
Anatomía de las APIs del IdescatXavier Badosa
 

More from Xavier Badosa (20)

Putting Data in Cells
Putting Data in CellsPutting Data in Cells
Putting Data in Cells
 
JSON-stat in the Sea of Standards
JSON-stat in the Sea of StandardsJSON-stat in the Sea of Standards
JSON-stat in the Sea of Standards
 
The Trouble with Tables
The Trouble with TablesThe Trouble with Tables
The Trouble with Tables
 
StatisticalTable, a JSON-stat-based vocabulary
StatisticalTable, a JSON-stat-based vocabularyStatisticalTable, a JSON-stat-based vocabulary
StatisticalTable, a JSON-stat-based vocabulary
 
Decoupling Official Statistics
Decoupling Official StatisticsDecoupling Official Statistics
Decoupling Official Statistics
 
JSON-stat in the session "The future of standards in statistics", United Nati...
JSON-stat in the session "The future of standards in statistics", United Nati...JSON-stat in the session "The future of standards in statistics", United Nati...
JSON-stat in the session "The future of standards in statistics", United Nati...
 
Data Dissemination through Data Visualization
Data Dissemination through Data VisualizationData Dissemination through Data Visualization
Data Dissemination through Data Visualization
 
Reutilización de datos gracias a la visualización de datos
Reutilización de datos gracias a la visualización de datosReutilización de datos gracias a la visualización de datos
Reutilización de datos gracias a la visualización de datos
 
Idescat Visual: Gràfics i mapes
Idescat Visual: Gràfics i mapesIdescat Visual: Gràfics i mapes
Idescat Visual: Gràfics i mapes
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official Statistics
 
Periodisme de dades i oficines estadístiques
Periodisme de dades i oficines estadístiquesPeriodisme de dades i oficines estadístiques
Periodisme de dades i oficines estadístiques
 
Difusió estadísTICa oficial
Difusió estadísTICa oficialDifusió estadísTICa oficial
Difusió estadísTICa oficial
 
Links and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the WebLinks and Widgets: the Fabric of the Web
Links and Widgets: the Fabric of the Web
 
La difusión estadística y la apertura de datos: un viaje de ida y vuelta
La difusión estadística y la apertura de datos: un viaje de ida y vueltaLa difusión estadística y la apertura de datos: un viaje de ida y vuelta
La difusión estadística y la apertura de datos: un viaje de ida y vuelta
 
Standards for statistical data dissemination: a wish list
Standards for statistical data dissemination: a wish listStandards for statistical data dissemination: a wish list
Standards for statistical data dissemination: a wish list
 
What's our business? Statistics as platform
What's our business? Statistics as platformWhat's our business? Statistics as platform
What's our business? Statistics as platform
 
Idescat on the Google Public Data Explorer
Idescat on the Google Public Data ExplorerIdescat on the Google Public Data Explorer
Idescat on the Google Public Data Explorer
 
El Idescat en Google Public Data Explorer
El Idescat en Google Public Data ExplorerEl Idescat en Google Public Data Explorer
El Idescat en Google Public Data Explorer
 
Los widgets del Idescat: una aplicación de las APIs
Los widgets del Idescat: una aplicación de las APIsLos widgets del Idescat: una aplicación de las APIs
Los widgets del Idescat: una aplicación de las APIs
 
Anatomía de las APIs del Idescat
Anatomía de las APIs del IdescatAnatomía de las APIs del Idescat
Anatomía de las APIs del Idescat
 

Recently uploaded

AWS Identity and access management for users
AWS Identity and access management for usersAWS Identity and access management for users
AWS Identity and access management for usersStephenEfange3
 
SABARI PRIYAN's self introduction as a reference
SABARI PRIYAN's self introduction as a referenceSABARI PRIYAN's self introduction as a reference
SABARI PRIYAN's self introduction as a referencepriyansabari355
 
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...Thibaud Le Douarin
 
A Gentle Introduction to Text Analysis :)
A Gentle Introduction to Text Analysis :)A Gentle Introduction to Text Analysis :)
A Gentle Introduction to Text Analysis :)UNCResearchHub
 
Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)CUO VEERANAN VEERANAN
 
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...Cyber Security Experts
 
Artificial Intelligence and its Impact on Society.pptx
Artificial Intelligence and its Impact on Society.pptxArtificial Intelligence and its Impact on Society.pptx
Artificial Intelligence and its Impact on Society.pptxVighnesh Shashtri
 
Lies and Myths in InfoSec - 2023 Usenix Enigma
Lies and Myths in InfoSec - 2023 Usenix EnigmaLies and Myths in InfoSec - 2023 Usenix Enigma
Lies and Myths in InfoSec - 2023 Usenix EnigmaAdrian Sanabria
 
ppt penjualan berbasis online omset.pptx
ppt penjualan berbasis online omset.pptxppt penjualan berbasis online omset.pptx
ppt penjualan berbasis online omset.pptxHizkiaJastis
 
SABARI PRIYAN's self introduction as reference
SABARI PRIYAN's self introduction as referenceSABARI PRIYAN's self introduction as reference
SABARI PRIYAN's self introduction as referencepriyansabari355
 
data analytics and tools from in2inglobal.pdf
data analytics  and tools from in2inglobal.pdfdata analytics  and tools from in2inglobal.pdf
data analytics and tools from in2inglobal.pdfdigimartfamily
 
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdf
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdfIIBA Adl - Being Effective on Day 1 - Slide Deck.pdf
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdfAustraliaChapterIIBA
 
What is the value of your Data v3.0.pptx
What is the value of your Data v3.0.pptxWhat is the value of your Data v3.0.pptx
What is the value of your Data v3.0.pptxJose Briones
 
Tips to Align with Your Salesforce Data Goals
Tips to Align with Your Salesforce Data GoalsTips to Align with Your Salesforce Data Goals
Tips to Align with Your Salesforce Data GoalsDataArchiva
 
Industry 4.0 in IoT Transforming the Future.pptx
Industry 4.0 in IoT Transforming the Future.pptxIndustry 4.0 in IoT Transforming the Future.pptx
Industry 4.0 in IoT Transforming the Future.pptxMdRafiqulIslam403212
 
Soil Health Policy Map Years 2020 to 2023
Soil Health Policy Map Years 2020 to 2023Soil Health Policy Map Years 2020 to 2023
Soil Health Policy Map Years 2020 to 2023stephizcoolio
 
Operations Data On Mobile - inSis Mobile App - Sample Screens
Operations Data On Mobile - inSis Mobile App - Sample ScreensOperations Data On Mobile - inSis Mobile App - Sample Screens
Operations Data On Mobile - inSis Mobile App - Sample ScreensKondapi V Siva Rama Brahmam
 

Recently uploaded (18)

AWS Identity and access management for users
AWS Identity and access management for usersAWS Identity and access management for users
AWS Identity and access management for users
 
SABARI PRIYAN's self introduction as a reference
SABARI PRIYAN's self introduction as a referenceSABARI PRIYAN's self introduction as a reference
SABARI PRIYAN's self introduction as a reference
 
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...
Generative AI Rennes Meetup with OVHcloud - WAICF highlights & how to deploy ...
 
A Gentle Introduction to Text Analysis :)
A Gentle Introduction to Text Analysis :)A Gentle Introduction to Text Analysis :)
A Gentle Introduction to Text Analysis :)
 
Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)
 
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...
Web 3.0 in Data Privacy and Security | Data Privacy |Blockchain Security| Cyb...
 
Artificial Intelligence and its Impact on Society.pptx
Artificial Intelligence and its Impact on Society.pptxArtificial Intelligence and its Impact on Society.pptx
Artificial Intelligence and its Impact on Society.pptx
 
Lies and Myths in InfoSec - 2023 Usenix Enigma
Lies and Myths in InfoSec - 2023 Usenix EnigmaLies and Myths in InfoSec - 2023 Usenix Enigma
Lies and Myths in InfoSec - 2023 Usenix Enigma
 
ppt penjualan berbasis online omset.pptx
ppt penjualan berbasis online omset.pptxppt penjualan berbasis online omset.pptx
ppt penjualan berbasis online omset.pptx
 
SABARI PRIYAN's self introduction as reference
SABARI PRIYAN's self introduction as referenceSABARI PRIYAN's self introduction as reference
SABARI PRIYAN's self introduction as reference
 
data analytics and tools from in2inglobal.pdf
data analytics  and tools from in2inglobal.pdfdata analytics  and tools from in2inglobal.pdf
data analytics and tools from in2inglobal.pdf
 
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdf
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdfIIBA Adl - Being Effective on Day 1 - Slide Deck.pdf
IIBA Adl - Being Effective on Day 1 - Slide Deck.pdf
 
What is the value of your Data v3.0.pptx
What is the value of your Data v3.0.pptxWhat is the value of your Data v3.0.pptx
What is the value of your Data v3.0.pptx
 
Tips to Align with Your Salesforce Data Goals
Tips to Align with Your Salesforce Data GoalsTips to Align with Your Salesforce Data Goals
Tips to Align with Your Salesforce Data Goals
 
Industry 4.0 in IoT Transforming the Future.pptx
Industry 4.0 in IoT Transforming the Future.pptxIndustry 4.0 in IoT Transforming the Future.pptx
Industry 4.0 in IoT Transforming the Future.pptx
 
Soil Health Policy Map Years 2020 to 2023
Soil Health Policy Map Years 2020 to 2023Soil Health Policy Map Years 2020 to 2023
Soil Health Policy Map Years 2020 to 2023
 
Electricity Year 2023_updated_22022024.pptx
Electricity Year 2023_updated_22022024.pptxElectricity Year 2023_updated_22022024.pptx
Electricity Year 2023_updated_22022024.pptx
 
Operations Data On Mobile - inSis Mobile App - Sample Screens
Operations Data On Mobile - inSis Mobile App - Sample ScreensOperations Data On Mobile - inSis Mobile App - Sample Screens
Operations Data On Mobile - inSis Mobile App - Sample Screens
 

JSON-stat & JS: the JSON-stat Javascript Toolkit

  • 1. JSON-stat & JS the JSON-stat Javascript Toolkit Xavier Badosa @badosa https://xavierbadosa.com https://json-stat.org July, 2013 (updated to JSON-stat 2.0 in January, 2016)
  • 4. Introducing the JSON-stat Javascript Toolkit It’s a Javascript library that helps you dealing with JSON-stat responses.
  • 5. Introducing the JSON-stat Javascript Toolkit It offers methods to easily traverse the JSON-stat tree: Dataset Dimension Category Data
  • 7. Sample file the JSON-stat Javascript Toolkit This URL returns a JSON-stat dataset document. (Collections can contain several datasets.) json-stat.org/samples/canada.json
  • 8. var ds = JSONstat( "http://json-stat.org/samples/canada.json" ); if ( ds.length > 0 ) { … } Retrieve a JSON-stat document. Check the number of elements. If zero, the service didn’t return a valid JSON-stat response. Sync
  • 9. JSONstat( "http://json-stat.org/samples/canada.json", function () { if ( this.length > 0 ) { … } } ); Retrieve a JSON-stat document. Check the number of elements. If zero, the service didn’t return a valid JSON-stat response. Async
  • 10. $.getJSON( "http://json-stat.org/samples/canada.json", function ( obj ) { var ds = JSONstat( obj ); if ( ds.length > 0 ) { … } } ); You can also retrieve a JSON-stat document with your usual bullet-proof framework and use JSONstat() for what is good for: dealing with the resulting object.
  • 11. var ds = JSONstat( "http://json-stat.org/samples/canada.json" ); var cl = ds.class; It contains a dataset (a cube). ds.class → "dataset"
  • 12. var ds = JSONstat( "http://json-stat.org/samples/canada.json" ); var cl = ds.class; (Because it’s a dataset response you don’t need to use the Dataset() method.) ds === ds.Dataset( 0 ) → true
  • 13. var dslabel = ds.label; Get the dataset label. ds.label → "Population by sex and age group. Canada. 2012"
  • 14. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; // new Date(upd) to convert into date Get the number of data in the dataset and the update information. ds.n → 120 ds.updated → "2012-09-27"
  • 15. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; Get the number of dimensions and the dimensions’ IDs. ds.length → 5 ds.id → ["country", "year", "age", "concept", "sex"]
  • 16. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; var sex = ds.Dimension( 4 ); Let’s analyze dimension “sex”. Selected by index.
  • 17. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; var sex = ds.Dimension( "sex" ); Let’s analyze dimension “sex”. Selected by ID.
  • 18. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; var sex = ds.Dimension( "sex" ); var sexsize = sex.length; var sexid = sex.id; sex.length is not what it seems: it’s just the number of categories of dimension“sex”. sex.length → 3 sex.id → ["T", "M", "F"]
  • 19. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; var sex = ds.Dimension( "sex" ); var sexsize = sex.length; var sexid = sex.id; var sexlabel = sex.label; As you can see, properties length, id and label are everywhere. sex.label → "sex"
  • 20. var dslabel = ds.label; var nobs = ds.n; var upd = ds.updated; var ndim = ds.length; var dimid = ds.id; var sex = ds.Dimension( "sex" ); var sexsize = sex.length; var sexid = sex.id; var sexlabel = sex.label; var sexrole = sex.role; sex is considered a classification variable because the provider didn’t attach any special role to it. sex.role → classification
  • 21. var yearrole = ds.Dimension( "year" ).role; var countryrole = ds.Dimension( "country" ).role; Special roles are time, geo and metric. ds.Dimension( "year" ).role → "time" ds.Dimension( "country" ).role → "geo"
  • 22. var yearrole = ds.Dimension( "year" ).role; var countryrole = ds.Dimension( "country" ).role; var timedims = ds.role.time; var geodims = ds.role.geo; Likewise, you can ask the other way around. Get dimensions with role time and role geo. ds.role.time → ["year"] ds.role.geo → ["country"]
  • 23. var sexlabel2 = sex.Category( 2 ).label; var sexunit2 = sex.Category( 2 ).unit; var sexcoord2 = sex.Category( 2 ).coordinates; Get information about a particular sex category. By index. sex.Category( 2 ).label → "female" .unit, .coordinates (only if role metric / geo) → null
  • 24. var sexlabel2 = sex.Category( "F" ).label; var sexunit2 = sex.Category( "F" ).unit; var sexcoord2 = sex.Category( "F" ).coordinates; Get information about a particular sex category. By ID. sex.Category( "F" ).label → "female" .unit, .coordinates (only if role metric / geo) → null
  • 25. var dimarray = ds.Dimension( ); var sexarray = sex.Category( ); All methods can be called without arguments. They will return an array of results.
  • 26. var dimarray = ds.Dimension( ); var sexarray = sex.Category( ); var malelabel = ds .Dimension( )[4] .Category( )[1] .label; Use responsibly! Always minimize calling methods without arguments. // sex (5th dimension) // male (2nd category)
  • 27. var dimarray = ds.Dimension( ); var sexarray = sex.Category( ); var malelabel = ds .Dimension( 4 ) .Category( 1 ) .label; Simpler. Still, you should minimize calling the same method with the same argument several times. // sex (5th dimension) // male (2nd category)
  • 28. var dimarray = ds.Dimension( ); var sexarray = sex.Category( ); var malelabel = sex .Category( 1 ) .label; If you must, store the result in a variable. // sex (5th dimension) // male (2nd category)
  • 29. the JSON-stat Javascript Toolkit It offers methods to easily traverse the JSON-stat tree: Dataset Dimension Category Data
  • 30. var cell44 = ds.Data( 44 ).value; var cell44 = ds.Data( [0,0,7,0,2] ).value; Get the value in cell 44. By value index and by dimensions’ indexes. ds.Data( 44 ).value → 1202.8 ds.Data( [0,0,7,0,2] ).value → 1202.8
  • 31. var cell44 = ds.Data( 44 ).value; var cell44 = ds.Data( [0,0,7,0,2] ).value; var cell44 = ds.Data( { country: "CA", year : "2012", concept : "POP", age: "34", sex: "F" } ).value; Get the value in cell 44. By dimension/category ID. ds.Data( {…} ).value → 1202.8
  • 32. var cell44 = ds.Data( 44 ).value; var cell44 = ds.Data( [0,0,7,0,2] ).value; var cell44 = ds.Data( { country: "CA", year : "2012", concept : "POP", age: "34", sex: "F" } ).value; Single category dimensions are not required. By dimension/category ID. ds.Data( {…} ).value → 1202.8
  • 33. var cell44 = ds.Data( 44 ).status; var cell44 = ds.Data( [0,0,7,0,2] ).status; var cell44 = ds.Data( { country: "CA", year : "2012", concept : "POP", age: "34", sex: "F" } ).status; Get cell status, if available. By dimension/category ID. ds.Data( {…} ).status → "a"
  • 34. var pop34 = ds.Data( { country: "CA", year : "2012", concept : "POP", age: "34", sex: "F" } ); By removing one (and only one) required dimension, you get an array of results (slice). (In the example, population of age 30-34 by sex in Canada in 2012.)
  • 35. var data = ds.Data( ); Get an array with information for every cell. (“Information” currently means value and status.)
  • 36. var data = ds.Data( ); // It allows you to rebuild the value array like this: var value = ds.Data( ).map( function( e ){ return e.value; } ); // But you can directly access the original value and status // like this: var value = ds.value; var status = ds.status;
  • 37. J.Dataset( ) .Dimension( ) .Category( ) .Data( ) Chainable traversing methods J.Dataset( ) .toTable( ) Chainable transformation methods
  • 38. J.Dataset( ) .Dimension( ) .Category( ) .Data( ) Chainable traversing methods J.Dataset( ) .toTable( ) Chainable transformation methods Get sections of the dataset. Get data and main metadata in tabular form.
  • 39. J.Dataset( ) .toTable( ) Chainable transformation methods Get data and main metadata in tabular form. Useful to export the dataset content to other table-based structures
  • 40. var tbl = ds.toTable( { type : "arrobj" } ); [ { age : "Total", concept : "Persons (thousands)", country : "Canada", sex : "Total", value : 34880.5, year : "2012" }, { age : "Total", concept : "Persons (thousands)", country : "Canada", sex : "Male", value : 17309.1, year : "2012" }, … ] Get an array of objects describing every cell.
  • 41. var tbl = ds.toTable( { type : "arrobj", status : true } ); [ { age : "Total", concept : "Persons (thousands)", country : "Canada", sex : "Total", value : 34880.5, status : "a", year : "2012" }, { age : "Total", concept : "Persons (thousands)", country : "Canada", sex : "Male", value : 17309.1, status : "a", year : "2012" }, … ] It can include status information.
  • 42. var tbl = ds.toTable( { type : "arrobj", content : "id" } ); [ { age : "T", concept : "POP", country : "CA", sex : "T", value : 34880.5, year : "2012" }, { age : "T", concept : "POP", country : "CA", sex : "M", value : 17309.1, year : "2012" }, … ] It can use categories’ IDs instead of labels.
  • 43. var tbl = ds.toTable( { type : "arrobj", content : "id", function ( d, i ){ if ( d.sex === "F" && d.concept === "POP" ){ return { age : d.age, population : d.value*1000 }; } } } ); // Get only slice females, persons (in thousands), transform // thousands into persons and keep age and population only. It can be post-processed with a callback function.
  • 44. var tbl = ds.toTable( { type : "object" } ); { cols : [ { id : "country", label : "Country", type : "string", }, { id : "year", label : "Year", type : "string", }, ... ], rows : [ ... ] } Get an object of arrays (Google DataTable format).
  • 45. var tbl = ds.toTable( { type : "array" } ); [ [ "Country", "Year", "Age group", "Population and %", "Sex", "Value" ], [ "Canada", "2012", "Total", "Persons (thousands)", "Total", 34880.5 ], ... ] Get an array of arrays (CSV-like format).
  • 46. These are just the main features of the JSON-stat Javascript Toolkit json-stat.com
  • 47. JJT is also available on the server as a Node.js module. npm install jsonstat https://www.npmjs.com/package/jsonstat
  • 48. Built on top of JJT the JSON-stat Javascript Utilities Suite
  • 49. Built on top of JJT the JSON-stat Javascript Utilities Suite High level utilities tbrowser: interactive, pivotal table datalist: unidimensional table fromTable: import from JSON tabular formats fromCSV/toCSV: import/export from/to CSV
  • 51. all pictures from Blocks picture in slide 1: Soma, by Dru! (CC BY-NC) Atomium in slide 2: Fighting Gravity – Atomium, Brussels, by Jan Faborsky (CC BY-NC-ND) Sculture in slide 3: Cubes, by Alex [Fino] LA (CC BY-SA) Egg in slide 50: Egg, by Auntie P (CC BY-NC-SA)