0

我正在使用 py2neo 1.5.1 和 neo4j 1.9.1。根据我的测试,由于创建关系线,以下代码会引发很多错误。谁能解释为什么?

from py2neo import neo4j,node,rel

graph_db = neo4j.GraphDatabaseService("http://localhost:7474/db/data/")
entity = graph_db.get_or_create_index(neo4j.Node, "Entity", config={"type":"fulltext", "provider":"lucene"})

batch = neo4j.WriteBatch(graph_db)
n1 = batch.get_or_create_indexed_node(entity, "name_type","e1_t1",{"name":"e1","type":"t1"})
n2 = batch.get_or_create_indexed_node(entity, "name_type","e2_t2",{"name":"e2","type":"t2"})
batch.create(rel(n1, "TEST", n2))
results = batch.submit()
4

0 回答 0