関係に重みをつける方法[Py2neo][Neo4j]

7月 25, 2020

from py2neo import Graph
from py2neo import Node, Relationship
user = 'neo4j'
pwd = 'neo4j'
graph = Graph(auth=(user, pwd)) #http://localhost:7474

tx = graph.begin()
a = Node("Person", name="Alice")
tx.create(a)
b = Node("Person", name="Bob")
tx.create(b)
ab = Relationship(a, "KNOWS", b, weight=10)

tx.create(ab)
tx.commit()

Neo4j

Posted by vastee