py2neo无法为索引节点创建关系?

时间:2013-07-17 02:19:05

标签: neo4j py2neo

我正在使用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()

0 个答案:

没有答案