Haakon - introduction

I work as a product manager within competance sharing and enhancement in the public sector. I live in Drammen in Norway. As part of my work, I have worked extensively with SQL databases (mostly MySQL/MariaDB and PostgreSQL), both as a database administrator and in the enhancement and development of database applications. This lead me to BI and analytics, and different kinds of solutions in that space (Pentaho, QlikView etc). However, while very good in their space, I found them a bit... restrictive. When the NoSQL or schemeless space opened up, I was curious and looked at different graph technologies, and found Neo4j with its Cypher query language to be a relatively easy, flexible and interesting approach. I then read some of the books, papers, and tutorials, and now have my own server online for experiments. However, I have not put Neo4j into any production situations yet.

One of the reasons for this is that most of the data I need to work come from JSON formatted endpoints online, and till recently this was a bit more difficult to get directly into Neo4j than CSV formatted data. Turns out one of the my important sources, Statistics Norway, data.ssb.no , uses JSON-Stat - https://json-stat.org/, which is a nested JSON format for statistical data. While I can unwind the data, it is quite fiddly to do so, so if anyone has a tutorial or have worked with Neo4j and JSON-stat, please let me know. :-) One of the tables I need to consult from SSB is 07459: Alders- og kjønnsfordeling i kommuner, fylker og hele landets befolkning (K) 1986 - 2022. Statistikkbanken to get the number of people in each municipality in Norway, I only need the name and the number. At the bottom of the table is a link to endpoint and JSON query, https://data.ssb.no/api/v0/no/table/07459/ , and this is then JSON-stat formatted and needs to be unwinded in Neo4j.

So this is where I am at. :-)

Best wishes,
Haakon

2 Likes

Hi Haakon!
This is interesting. @jennifer_reif do you know if we have any resources for this type of problem?

Have you looked at something like our APOC library? It usually handles retrieving and formatting data really nicely from JSON. You can see some examples in the document I've linked below. I don't know of anything specific to Neo4j/JSON-Stat, but hopefully this might help. Let me know if you have any questions!

Doc: https://neo4j.com/docs/labs/apoc/current/import/load-json/
Example: Effective Bulk Data Import into Neo4j (Part 1) - DZone
Blog post: Neo4j: Loading JSON documents with Cypher | Mark Needham

Cheers,
Jennifer

Thank you for the resources, Jennifer. I have looked these before, and have used APOC with other endpoints, and the solution is probably there, it is just that I find JSON-stat a bit fiddly to wrap my head around. I will give it another try once I find some spare time under the rug. :slight_smile: