Skip to content

Instantly share code, notes, and snippets.

View nicysneiros's full-sized avatar

Nicolle Cysneiros nicysneiros

View GitHub Profile
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)
{ "results": [{
...
"data": [
{"row": [
{ "gender": "M",
"name": "John",
"age": "28" },
{},
{ "name": "The Beatles",
"category": "Musician/Band" }
MATCH (:User {name: "John"}) -[:LIKES]-> (pages)
RETURN pages
{ "results": [
{...
"graph": {
"nodes": [
{ "id": "1",
"labels": [ "User" ],
"properties": {
"gender": "M",
"name": "John",
"age": "28"
MATCH (john:User), (mary:User)
WHERE john.name="John" AND mary.name="Mary"
CREATE (john)-[f:FRIENDS_WITH]->(mary)
RETURN john, f, mary
{ "results": [
{...
"graph": {
"nodes": [
{
"id": "1",
"labels": [
"User"
],
"properties": {
CREATE (john:User {name:'John', gender:'M', age:'28'})
RETURN john