我想将数据导入Neo4j并按照以下链接中的说明操作: https://docs.google.com/spreadsheet/ccc?key=0Ah0qwaznhrupdF9kaDZDNWViM05UeVBfdTJmcHpQckE&usp=sharing)#gid=3
我可以成功导入数据,但当我使用Cypher查询match (n) return n;
时,结果为空...
以下是数据和属性设置的内容:
1.Instruction
cat import.txt | bin/neo4j-shell -config conf/neo4j.properties -path data/graph.db
2.import.txt
BEGIN
create (n:Female {id:1, name:'Amada Emory'});
create (n:Female {id:2, name:'Rana Seely'});
create (n:Female {id:3, name:'Detra Thatcher'});
create (n:Female {id:4, name:'Melda Reza'});
create (n:Female {id:5, name:'Shana Willems'});
create (n:Female {id:6, name:'Sharonda Peele'});
create (n:Female {id:7, name:'Dagny Agee'});
create (n:Female {id:8, name:'Tisa Woodman'});
create (n:Female {id:9, name:'Shelba Mutchler'});
create (n:Male {id:10, name:'Anderson Spagnola'});
create (n:Female {id:11, name:'Pamala Forward'});
create (n:Female {id:12, name:'Melva Fairchild'});
create (n:Male {id:13, name:'Antione Selman'});
create (n:Female {id:14, name:'Carmelia Cali'});
create (n:Female {id:15, name:'Fairy Daughtery'});
create (n:Female {id:16, name:'Stefany Mcamis'});
create (n:Male {id:17, name:'Kermit Meaney'});
create (n:Female {id:18, name:'Williemae Dossantos'});
create (n:Female {id:19, name:'Marth Sparling'});
create (n:Male {id:20, name:'Jarvis Noland'});
match (from {id:1}), (to {id:11}) create from-[:MOTHER_OF]->to;
match (from {id:1}), (to {id:12}) create from-[:MOTHER_OF]->to;
match (from {id:1}), (to {id:13}) create from-[:MOTHER_OF]->to;
match (from {id:2}), (to {id:14}) create from-[:MOTHER_OF]->to;
match (from {id:2}), (to {id:15}) create from-[:MOTHER_OF]->to;
match (from {id:2}), (to {id:16}) create from-[:MOTHER_OF]->to;
match (from {id:3}), (to {id:17}) create from-[:MOTHER_OF]->to;
match (from {id:3}), (to {id:18}) create from-[:MOTHER_OF]->to;
match (from {id:3}), (to {id:19}) create from-[:MOTHER_OF]->to;
match (from {id:10}), (to {id:20}) create from-[:FATHER_OF]->to;
match (from {id:14}), (to {id:1}) create from-[:MOTHER_OF]->to;
match (from {id:11}), (to {id:2}) create from-[:MOTHER_OF]->to;
match (from {id:11}), (to {id:3}) create from-[:MOTHER_OF]->to;
match (from {id:12}), (to {id:4}) create from-[:MOTHER_OF]->to;
match (from {id:12}), (to {id:5}) create from-[:MOTHER_OF]->to;
match (from {id:12}), (to {id:6}) create from-[:MOTHER_OF]->to;
match (from {id:17}), (to {id:7}) create from-[:FATHER_OF]->to;
match (from {id:13}), (to {id:8}) create from-[:MOTHER_OF]->to;
match (from {id:13}), (to {id:9}) create from-[:MOTHER_OF]->to;
match (from {id:20}), (to {id:1}) create from-[:FATHER_OF]->to;
COMMIT
3.neo4j-server.properties
...
# location of the database directory
org.neo4j.server.database.location=data/graph.db
...
neo4j.properties
# Default values for the low-level graph engine
#neostore.nodestore.db.mapped_memory=25M
#neostore.relationshipstore.db.mapped_memory=50M
#neostore.propertystore.db.mapped_memory=90M
#neostore.propertystore.db.strings.mapped_memory=130M
#neostore.propertystore.db.arrays.mapped_memory=130M
# Enable this to be able to upgrade a store from an older version
#allow_store_upgrade=true
# Enable this to specify a parser other than the default one.
#cypher_parser_version=2.0
# Keep logical logs, helps debugging but uses more disk space, enabled for
# legacy reasons To limit space needed to store historical logs use values such
# as: "7 days" or "100M size" instead of "true"
keep_logical_logs=true
# Autoindexing
# Enable auto-indexing for nodes, default is false
#node_auto_indexing=true
# The node property keys to be auto-indexed, if enabled
#node_keys_indexable=id,name,type
# Enable auto-indexing for relationships, default is false
#relationship_auto_indexing=true
# The relationship property keys to be auto-indexed, if enabled
#relationship_keys_indexable=name,age
# Enable shell server so that remote clients can connect via Neo4j shell.
#remote_shell_enabled=true
# Specify custom shell port (default is 1337).
#remote_shell_port=1234
但是如果我在创建和匹配块之间添加COMMIT
和BEGIN
,则会成功添加节点,但关系失败...
import.txt
的格式为:
BEGIN
...
create (n:Male {id:20, name:'Jarvis Noland'});
COMMIT
BEGIN
match (from {id:1}), (to {id:11}) create from-[:MOTHER_OF]->to;
...
COMMIT
有人可以告诉我为什么吗?非常感谢!
答案 0 :(得分:0)
不信任该屏幕上的节点计数,它只列出在文件中创建的记录,即使它们从未使用过或从未提交过。
-path
或不使用该参数并连接到正在运行的服务器时,请确保您的服务器未运行。