neo4j download下载Neo4j。然后通过http://localhost:7474访问
1、创建实体文件csv,需要包含唯一id(采用uuid1的方式)
2、创建关系csv,通过实体ID相连接;
导入:
实体1:
LOAD CSV WITH HEADERS FROM "file:///new_entity1.csv" ASline
MERGE(comp:company{name:line.name,code:line.code})
实体2:
LOAD CSV WITH HEADERS FROM "file:///new_entity2.csv" ASline
MERGE (comp:company{name:line.name})
关系:LOAD CSV WITH HEADERS FROM "file:///gudong_relation2.csv" AS line
match (from:company{id:line.from_id}),(to:company{id:line.to_id})
merge (from)-[r:主要股东{持股:line.property}]->(to)
查询所有节点及关系:
start n = node(*)
return n
查找:
MATCH (com:company{name:"万科A"})-[主要股东]-(com2:company) RETURN com,com2
删除节点及关系
MATCH (n)-[r]-()
DELETE n,r
单纯删除所以节点:
match (n)
delete n