【发布时间】:2013-09-26 17:13:59
【问题描述】:
我想使用 py2neo 将一些数据插入到 Neo4j 中。 Link 到数据文件。
我是Neo4j 的新手。有人能告诉我如何将批量数据插入Neo4j。实际上我想做Neo4j的性能测试.....
我已经尝试过了,但这只是针对小数据集...
from pprint import pprint
from py2neo import neo4j,node, rel
graph_db = neo4j.GraphDatabaseService()
def insert_data():
die_hard = graph_db.create(
node(name="Bruce Willis"),
node(name="John McClane"),
node(name="Alan Rickman"),
node(name="Hans Gruber"),
node(name="Nakatomi Plaza"),
rel(0, "PLAYS", 1),
rel(2, "PLAYS", 3),
rel(1, "VISITS", 4),
rel(3, "STEALS_FROM", 4),
rel(1, "KILLS", 3),)
pprint(die_hard)
insert_data()
错误:
src/test/java/org/neo4j/batchimport/TestDataGenerator.java:3: error: package org.junit does not exist
import org.junit.Ignore;
^
src/test/java/org/neo4j/batchimport/TestDataGenerator.java:14: error: cannot find symbol
@Ignore
^
symbol: class Ignore
2 errors
【问题讨论】:
-
我已经尝试过batch-import 但它不起作用......谁能帮助我
-
Neo4j有没有标准的基准 -
我找到了这个link ....但它给出了错误
-
你有那个代码吗?我没有看到你在这里引用了 batchinserter 类,这似乎是一个设置问题。