Dict2Graph – A json to Neo4j loading tool
When we parse public data it often comes in formats like json or xml. Every time we tapped into a potentially new data source, we needed to write a parser for the specific json structure. This is a very error prone process that needs a ton of iteration until it is reliable.
Dict2Graph allows users to easily convert this data into graph structures which are useful for representing and analyzing complex relationships between data points.
The goal was to create the following workflow:
- load your json into a Neo4j database
- inspect your json in Neo4j-browser (which is a very visual exploring experience; works better for most types of personalities compared to parsing a machine readable document like json or xml)
- define (or redefine) a model-transformation profile
- repeat the process until your happy with the resulting graph structure
This way we can quickly iterate a new dataloader from prototype to a productive state in a few lines of code.
Also we abstract and standardize all the fiddly parts of such a loader. This results in compact, readable and easy maintainable dataloaders.
The full blog post also provides examples of how Dict2Graph can be used in various applications. For instance, Dict2Graph can be used to represent and analyze protein-protein interaction networks, which can provide insights into disease mechanisms and potential drug targets.
Overall, Dict2Graph is a useful tool for anyone working with complex data sets and a valuable addition to any Python developer’s toolkit.
Good idea! Also sharing an alternative python code for similar use: https://github.com/GSK-Biostatistics/neointerface/blob/main/neointerface/neointerface.py#L1480
cool! thank you very much for that!