[PYTHON] neo4j sandbox part 15

Overview

I tried sandbox with neo4j. I hit neo4j sandbox with python and tried to input gist data.

Input node.


from neo4j import GraphDatabase, basic_auth

driver = GraphDatabase.driver("bolt://18.233.67.98:32829", auth=basic_auth("neo4j", "convenience-patient-function"))
session = driver.session()
cypher_query = '''
LOAD CSV WITH HEADERS FROM "https://gist.github.com/ohisama/20ff770bfda7d9dafbb1fc0e259aeb9f/raw/938b739af1e2627a66a3ee781d0c46559ca61663/covid0.csv" AS line
CREATE (:Person {id:line.id, tiku:line.tiku, tosi:line.tosi, sex:line.sex, date:line.date})
'''
results = session.run(cypher_query, parameters = {})
for record in results:
	print(record)



Input link.


from neo4j import GraphDatabase, basic_auth

driver = GraphDatabase.driver("bolt://18.233.67.98:32829", auth=basic_auth("neo4j", "convenience-patient-function"))
session = driver.session()
cypher_query = '''
LOAD CSV WITH HEADERS FROM "https://gist.github.com/ohisama/20ff770bfda7d9dafbb1fc0e259aeb9f/raw/938b739af1e2627a66a3ee781d0c46559ca61663/covid1.csv" AS line
MATCH (a:Person {id:line.a}), (b:Person {id:line.b})
CREATE (a)-[:CONNCT]->(b)
'''
results = session.run(cypher_query, parameters = {})
for record in results:
	print(record)



that's all.

Recommended Posts

neo4j sandbox part 12
neo4j sandbox part 5
neo4j sandbox part 13
neo4j sandbox part 15
neo4j sandbox part 16
neo4j sandbox part 11
sandbox with neo4j part 10
datetime part 1
numpy part 2