Last active
August 29, 2015 14:26
-
-
Save Yomguithereal/48c81d185a84f39f27a8 to your computer and use it in GitHub Desktop.
Hyphe-related cypher queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Getting the related nodes and avoiding irrelevant children belonging | |
// to other WEs. | |
MATCH (we:WE {name: "SCPO"})-[:PREFIX]->(:Node)-[rels:PARENT*0..]->(n:Node) | |
WHERE ALL(n IN extract(rel in rels | endNode(rel)) WHERE NOT (n)<-[:PREFIX]-()) | |
RETURN n; | |
// Computing the WEs graph | |
MATCH (we:WE {name: "SCPO"})-[:PREFIX]->(:Node)-[rels:PARENT*0..]->(n:Node) | |
WHERE ALL(n IN extract(rel in rels | endNode(rel)) WHERE NOT (n)<-[:PREFIX]-()) | |
MATCH (n)-[:LINK]-()<-[:PARENT*0..]-()<-[:PREFIX]-(twe:WE) | |
WHERE twe <> we | |
RETURN DISTINCT twe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run into the neo4j folder | |
./bin/neo4j-import --into graph.db --nodes ~/whatever/nodes.csv --relationships ~/whatever/edges.csv | |
# Then stop the server, replace the db, check user rights | |
./bin/neo4j stop | |
rm -rf ./data/graph.db | |
mv graph.db ./data/ | |
./bin/neo4j start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment