Neo4j图数据创建知识图谱相关知识

neo4j操作笔记

创建节点:

USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///city.csv' AS line
CREATE (:City{
  city_id: line.city_id,
  cityself_id:line.cityself_id,
  name: line.city
})

删除节点(City):MATCH (n:City) DELETE n

导入创建关系1:

USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///province_city.csv' AS line
MATCH (c:City) where c.name = line.city WITH c,line
MATCH (p:Provice) where p.id = line.city_id 
MERGE (c)-[:所属]->(p)

导入创建关系2:

USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///city_quota.csv' AS line
MATCH (q:Quota2) where q.name = line.quota2 WITH q,line
MATCH (c:City) where c.cityself_id = line.id 
MERGE (q)-[:增长指标]->(c)

做各城市生态综合环境影响因素:GDP影响显著。

MATCH(n:City),(n:City)
WHERE n.name='桂林市' AND n.name='柳州市'
CREATE (n)-[r:邻近市的企业数量对本地区的GDP有显著推动作用] -> (n)
return r

创建关系3:

kongjian _city.csv

USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///kongjian _city.csv' AS line
MATCH (y:Yinsu) where q.name = line.kongjian2 WITH y,line
MATCH (c:City) where c.cityself_id = line.self_id 
MERGE (y)-[:空间相关分析关系1]->(c)
USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///kongjian _city.csv' AS line
MATCH (s:Space) where s.name = line.kongjian2  WITH s,line
MATCH (c:City) where c.cityself_id = line.self_id 
MERGE (s)-[:空间相关分析关系2]->(c)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值