This is a script that reads from a json file output by Dibakar's Clinical Case Report parser.
Python 3.3+, neo4j 3.3.x, neomodel package
The format of the JSON file is
{
"nodes": [
{
"id": str,
"type": str,
"name": str,
"icolor": str,
"degree": int
},
...
],
"links": [
{
"id": str,
"name": str,
"value": float,
"source": str,
"source_name": str,
"target": str,
"target_name": str
},
...
]
}
Element of nodes
or links
represents a node or a relation in Neo4j respectively.
-
Start your Neo4j database.
-
Put your database information in
dbConfig.py
. -
Run the following command.
python jsonToNeo4j.py yourFilename.json
-
Now you can query results in Neo4j's console. For example:
MATCH (n) MATCH (n)-[r]-() RETURN n, r LIMIT 20;
- Almost no error checking
- Slow