[PYTHON] neo4j sandbox part 16

Overview

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

Get 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 = '''
MATCH (n)
RETURN n.id, n.tosi, n.tiku, n.sex, n.date
'''
results = session.run(cypher_query, parameters = {})
print("id tosi tiku sex date")
for r in results:
	print ("%s,%s,%s,%s" % (r["n.id"], r["n.tosi"], r["n.tiku"], r["n.date"]))




Get 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 = '''
MATCH (n)-[]-(m)
RETURN n.id, m.id
'''
results = session.run(cypher_query, parameters = {})
print("n m")
for r in results:
	print ("%s,%s" % (r["n.id"], r["m.id"]))


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 1
argparse part 1
numpy part 2