常用Neo4j命令

创建标签:

LOAD CSV WITH HEADERS FROM “file:///Affair.csv” AS line
CREATE (p:Affair{title:line.title,disaster_level:line.disaster_level,emergency_response:line.emergency_response,phases:line.phases,antistop:line.antistop,Disaster_classification:line.Disaster_classification,occurrence_time:line.occurrence_time,Scale_of_the_event:line.Scale_of_the_event,accident_spot:line.accident_spot,casualty:line.casualty,Event_duration:line.Event_duration,financial_loss:line.financial_loss,nationality:line.nationality,immediate_cause:line.immediate_cause,remote_cause:line.remote_cause})

创建索引:

CREATE CONSTRAINT ON (c:Affair)
ASSERT c.title IS UNIQUE

创建标签:

LOAD CSV WITH HEADERS FROM “file:///new_node.csv” AS line
CREATE (p:NewNode{title:line.title})

创建关系:

LOAD CSV WITH HEADERS FROM “file:///Entity.csv” AS line
MATCH(entity1:Affair{stype:line.entity1}) ,(entity2:NewNode{stype:line.entity2})
CREATE (entity1)-[:RELATION { type: line.relation }]->(entity2)

清空数据库:

MATCH (n)-[r]-()
DELETE n,r
LOAD CSV WITH HEADERS FROM “file:///subject.csv” AS line
CREATE (p:Subject{subject:line.subject,subject_type:line.subject_type})

LOAD CSV WITH HEADERS FROM “file:///object.csv” AS line
CREATE (p:Object{object:line.object,object_type:line.object_type})

LOAD CSV WITH HEADERS FROM “file:///predicate.csv” AS line
MATCH(entity1:Subject{subject:line.subject}) ,(entity2:Object{object:line.object})
CREATE (entity1)-[:RL { type: line.predicate }]->(entity2)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值