I need ot enforce a unique contraint on my graph database. I found the following method:
graph.schema.create_uniqueness_constraint("Website", "url")
But it yields the following error:
graph.schema.create_uniqueness_constraint("Website", "url")
AttributeError: 'Schema' object has no attribute 'create_uniqueness_constraint'
My import and graph instentiation is:
from py2neo import neo4j,node
graph = neo4j.GraphDatabaseService("http://localhost:7474/db/data/")
What am I doing wrong, and how can I fix it?
Also, what's the simplest, cleanest way to add a uniqueness constraint with py2neo?
I'm getting confused with the abundance of methods, which sometime seem to fail without reason (couldn't find a comprehensive tutorial on py2neo), and I start to feel like I would be better off writing raw Cypher queries...