2017-12-03 441 views
1

我想下面的CSV文件导入的Neo4j导入CSV到Neo4j的缺失节点

:START_ID,:END_ID,:TYPE 
1, 2, call 
2, 3, text 
3, 2, text 
6, 3, text 
5, 6, text 
5, 4, call 
4, 1, call 
4, 5, text 
1, 5, call 
1, 8, call 
6, 8, call 
6, 8, text 
8, 6, text 
7, 1, text 

person:ID,name,value:int 
1,Alice,1 
2,Bob,0 
3,Charlie,0 
4,David,0 
5,Esther,0 
6,Fanny,0 
7,Gabby,0 
8,XXX,1 

通过

DATA_DIR_SAMPLE=/data_network/ 
$NEO4J_HOME/bin/neo4j-admin import --into ${NEO4J_HOME}/data/databases/social.db \ 
    --nodes:Person ${DATA_DIR_SAMPLE}/v.csv \ 
    --relationships ${DATA_DIR_SAMPLE}/e.csv \ 
    --ignore-empty-strings true \ 
    --skip-duplicate-nodes true \ 
    --skip-bad-relationships true \ 
    --bad-tolerance 1500 \ 
    --multiline-fields=true 

进口告诉我,所有的关系包含缺少的节点。这里有什么问题?

InputRelationship: 
    source: /data_network/e.csv:2 
    startNode: 1 (global id space) 
    endNode: 2 (global id space) 
    type: call 
referring to missing node 2 
InputRelationship: 
    source: /data_network/e.csv:3 
    startNode: 2 (global id space) 
    endNode: 3 (global id space) 
    type: text 
referring to missing node 3 
InputRelationship: 
    source: /data_network/e.csv:4 
    startNode: 3 (global id space) 
    endNode: 2 (global id space) 
    type: text 
referring to missing node 2 
InputRelationship: 
    source: /data_network/e.csv:5 
    startNode: 6 (global id space) 
    endNode: 3 (global id space) 
    type: text 
referring to missing node 3 
InputRelationship: 
    source: /data_network/e.csv:6 
    startNode: 5 (global id space) 
    endNode: 6 (global id space) 
    type: text 
referring to missing node 6 
InputRelationship: 
    source: /data_network/e.csv:7 
    startNode: 5 (global id space) 
    endNode: 4 (global id space) 
    type: call 
referring to missing node 4 
InputRelationship: 
    source: /data_network/e.csv:8 
    startNode: 4 (global id space) 
    endNode: 1 (global id space) 
    type: call 
referring to missing node 1 
InputRelationship: 
    source: /data_network/e.csv:9 
    startNode: 4 (global id space) 
    endNode: 5 (global id space) 
    type: text 
referring to missing node 5 
InputRelationship: 
    source: /data_network/e.csv:10 
    startNode: 1 (global id space) 
    endNode: 5 (global id space) 
    type: call 
referring to missing node 5 
InputRelationship: 
    source: /data_network/e.csv:11 
    startNode: 1 (global id space) 
    endNode: 8 (global id space) 
    type: call 
referring to missing node 8 
InputRelationship: 
    source: /data_network/e.csv:12 
    startNode: 6 (global id space) 
    endNode: 8 (global id space) 
    type: call 
referring to missing node 8 
InputRelationship: 
    source: /data_network/e.csv:13 
    startNode: 6 (global id space) 
    endNode: 8 (global id space) 
    type: text 
referring to missing node 8 
InputRelationship: 
    source: /data_network/e.csv:14 
    startNode: 8 (global id space) 
    endNode: 6 (global id space) 
    type: text 
referring to missing node 6 
InputRelationship: 
    source: /data_network/e.csv:15 
    startNode: 7 (global id space) 
    endNode: 1 (global id space) 
    type: text 
referring to missing node 1 

回答

1

添加附加 :LABEL 列固定这一点。