当前位置 : 主页 > 手机开发 > ROM >

csv导入数据

来源:互联网 收集:自由互联 发布时间:2021-06-10
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 MERGE (s:Student{id:toInteger(line.id),name:line.name}) #导入

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
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)

 

 分享图片

网友评论