Skip to content

Instantly share code, notes, and snippets.

@nicysneiros
Last active April 13, 2017 20:39
Show Gist options
  • Save nicysneiros/0e1da90a2979409ffdc82bb34cc5abc5 to your computer and use it in GitHub Desktop.
Save nicysneiros/0e1da90a2979409ffdc82bb34cc5abc5 to your computer and use it in GitHub Desktop.
from py2neo import Graph, Node, Relationship
g = Graph(password="admin")
tx = g.begin()
john = Node("User", name="John", gender="M", age="28")
tx.create(john)
mary = Node("User", name="Mary", gender="F", age="26")
tx.create(mary)
jm = Relationship(john, "FRIENDS_WITH", mary)
tx.create(jm)
tx.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment