Skip to content

Commit

Permalink
Create the loading script and visualization query, references #2
Browse files Browse the repository at this point in the history
  • Loading branch information
hammad93 committed Mar 2, 2024
1 parent 4828401 commit 5acdabd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions neo4j/README.md
@@ -0,0 +1,24 @@
# Neo4J ADCY5
This directory in the repository explains how to setup and create the Neo4J database.

## Quickstart

1. Run the command `python main.py` to create the JSON file which performs data collection accross the internet.
2. Run the command `python ParseJson.py` creates the CSV.
3. Open the `load.cql` file to create the query from the `output.csv` to run on the cloud Neo4J.

## Cloud Storage
The data is located on https://console.neo4j.io/ and you can find the authentication, urls, and secrets in `keys.txt`.

## Install
- Run `./install.sh`
- Run the command `./neo4j-community-5.17.0/bin/neo4j status` to see the status of the Neo4J database.

## Visualize

Run this query to produce a visualization.

```cypher
MATCH (v:Variant)-[:CONTRIBUTED_BY]->(c:Contributor)
RETURN v, c
```
9 changes: 9 additions & 0 deletions neo4j/load.cql
@@ -0,0 +1,9 @@
LOAD CSV WITH HEADERS FROM 'file:///output.csv' AS row
WITH row WHERE row.Contributors IS NOT NULL
MERGE (v:Variant {name: row.`Allelic variant list`})
MERGE (r:Reference {citation: row.`Reference list`})
MERGE (l:Link {url: row.`External links`})
MERGE (c:Contributor {name: row.Contributors})
MERGE (v)-[:HAS_REFERENCE]->(r)
MERGE (r)-[:HAS_LINK]->(l)
MERGE (v)-[:CONTRIBUTED_BY]->(c);

0 comments on commit 5acdabd

Please sign in to comment.