Skip to content

Instantly share code, notes, and snippets.

@jgillmanjr
Created December 19, 2014 21:59
Show Gist options
  • Save jgillmanjr/85cd40ddb8085cca5d36 to your computer and use it in GitHub Desktop.
Save jgillmanjr/85cd40ddb8085cca5d36 to your computer and use it in GitHub Desktop.
pySchema4neo test script
#!/usr/bin/python
import sys
sys.path.append('../') # So I can load pySchema4neo, yo
from pySchema4neo import Schema
import py2neo
myGraph = py2neo.Graph()
mySchema = Schema('../documentation/examples/schemas/exampleSchema.json', 'thisisnotapathjustaplaceholder', myGraph)
node1 = py2neo.Node('Person', name = 'Bob', age = 26)
node2 = py2neo.Node('Person', name = 'Jim', age = 29)
node3 = py2neo.Node('Person', 'FreeForAll')
rel = py2neo.Relationship(node1, 'knows', node2, lengthYrs = 3)
#mySchema(node1, node2, rel)
for status in mySchema(node1, node2, node3):
print status
#myGraph.create(rel)
myGraph.delete_all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment