Reputation: 1225
I have a dataset containing words and documents associated with those words. I would like to set labels on them to separate them into these two categories. I was able to create the labels by doing this:
if not "Social Words" in graph_db.node_labels:
neo4j.Schema.create_index(graph_db.schema, "Social Words", "word")
if not "Documents" in graph_db.node_labels:
neo4j.Schema.create_index(graph_db.schema, "Documents", "url")
The problem is that I need to enforce uniqueness on the "word" and "url" fields. I am adding the nodes & labels as follows
doc,= graph_db.create({"url": url})
doc.add_labels("Documents")
My questions are :
Upvotes: 0
Views: 443
Reputation: 4495
Answers:
Upvotes: 1