What is the best way to create undirectional relationships in neo4j? I am 
using neo4j, py2neo. Here is how I insert the nodes and the relationships:

index_name = db.get_or_create_index(neo4j.Node, "index_name")

def create_node(name):
 return index_name.get_or_create("name", name, {"name":name})

def insert_triplet(triplet):
 firstNode  = create_node(triplet[0])
 secondNode = create_node(triplet[2])
 chain = neo4j.Path(firstNode, triplet[1], secondNode)
 path = chain.get_or_create(db)

Thanks in advance for replying.

Regards
Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to