10-100-22-94:/data/soft/neo4j-community-not/import

student.csv:

organization.csv:

 

relation.csv:

 

#导入student表 

LOAD CSV WITH HEADERS FROM "file:///student.csv" as line

with line where line.id is not null
MERGE (s:Student{id:toInteger(line.id),name:line.name})

#导入organization表
LOAD CSV WITH HEADERS FROM "file:///organization.csv" as line
MERGE (s:Organization{id:toInteger(line.id),name:line.name})

 

#导入关系表relation

LOAD CSV WITH HEADERS FROM "file:///relation.csv" as line
match (from:Student{id:toInteger(line.mid)}),(to:Organization{id:toInteger(line.gid)})
merge(from)-[r:friends{start_id:toInteger(line.mid),end_id:toInteger(line.gid),re:toString(line.links)}]->(to)

 

 

 

转载于:https://www.cnblogs.com/hapyygril/p/10956788.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐