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
%%cypher -o table | |
load csv with headers from "https://raw.githubusercontent.com/nicola/tubemaps/master/datasets/london.stations.csv" as csv | |
return csv limit 5 |
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
%load_ext cypher-magic | |
%cypher -r | |
%cypher -p <passsword> -s neo4j+s://<server> |
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
# assume that | |
# pip install matplotlib seaborn | |
p= %cypher match (t:Transfer) where t.numericFee is not null and t.numericFee > 0 return t.numericFee as numericFee, t.season as season | |
# create anew year value based on the start year of the season | |
p['year'] = p['season'].str[:4] | |
p['numericFee'] = p['numericFee'].divide(1000000) | |
gb = p.groupby("season").sum() | |
gb.plot.bar() | |
gb |
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
%%cypher | |
MATCH path = shortestPath( (:Station {name:'Watford'})-[:LEG*]-(:Station {name: 'Liverpool Street'}) ) | |
with [n in nodes(path)|n.name] as Stations, [n in relationships(path)|n.line] as AlLines, reduce(time = 0, n in relationships(path) | time + n.time) as time | |
where time > 0 | |
with [i in range(0, size(AlLines)-1) | |
WHERE i=0 OR AlLines[i] <> AlLines[i-1] | AlLines[i] ] AS Lines, AlLines, Stations, time | |
RETURN Lines, Stations, time |
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
# reset connection | |
%cypher -r | |
# this will show: | |
# Neo4j database connection reset... | |
# connect to myserver using the username of neo4j and the password of password | |
%cypher -s myserver -u neo4j -p password | |
# this will show: | |
# Neo4j database connection established... bolt://myserver:7687 |
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
pip install --upgrade git+https://github.com/innovationOUtside/cypher_magic.git |
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
pip install cypher-magic |