閉じる

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

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()
Pocket

コメントを残す

あなたのメールアドレスは公開されません。必須項目には印がついています *

© 2020 CV・NLP TIPS | WordPress Theme: Annina Free by CrestaProject.