Tutorials - Managing Data Sources
Using JSON files
JSON files are used all over the place. Internet provides us with several cases where JSON are used for managing data, such as APIs. One of the biggest advantages of thse kind of files is that they allow to create complex data models, where data might be managed using hierarchical structures and therefore overcoming two dimensional data models.
Below find an image of how an image of how a JSON file looks like:
Data Source: Real Time Urban Traffic information provided by the city hall of Santander, Spain.
As you can see in the above image, this JSON contains three main levels of information, a first one with the summary, a second one with some metadata information and a third one with data form the 416 sensors that monitor urban traffic data 24/7. You can see this information in the “resources” level. Each sensor has a list of attribute - value pairs, such as traffic intensity, sensor id, measure timestamp, url etc.
How to build a viable layout in your JSON file to be properly handled by Quadrigram:
- Get rid of all the unnecessary levels, that is, all data in your JSON file that IS NOT a list of attribute - value pairs
- Make sure that your file starts with a “[“ at the beginning of the document
- Make sure that your file ends with a “]“ at the end of the document
Below find images that show what has been previously mentioned:
Before formatting (original structure)
After formatting (valid structure valid for Quadrigram)