安装:




Neo4j Browser是一个命令驱动的客户端,例如基于Web的外壳环境。
编辑器是输入和运行命令的主要界面。输入Cypher查询以使用图形数据。
命令操作
创建节点

寻找节点

更新和删除节点




添加关系

删除关系

创建个人关系图谱:
create(a:student{name:"马鹏",age:23,education:"本科"})
create(b:student{name:"马强",age:18,work:"司机"})
create(c:parents{name:"马秀法",character:"母亲"})
create(d:parents{name:"马彦清",character:"父亲"})
create(e:teacher{name:"王某某",position:"班主任",grade:"初三1班"})
create(f:teacher{name:"张某某",position:"讲师",grade:"高三5班"})
create (a)-[:family{position:"brother"}]->(b),
(a)-[:family{position:"母子"}]->(c),
(b)-[:family{position:"母子"}]->(c),
(a)-[:family{position:"父子"}]->(d),
(b)-[:family{position:"父子"}]->(d),
(c)-[:family{position:"夫妻"}]->(d),
(e)-[:workplace{position:"同事"}]->(f),
(e)-[:education{position:"师生关系"}]->(a),
(f)-[:education{position:"师生关系"}]->(b)
(b)-[:family{position:"父子"}]->(d),
(c)-[:family{position:"夫妻"}]->(d),
(e)-[:workplace{position:"同事"}]->(f),
(e)-[:education{position:"师生关系"}]->(a),
(f)-[:education{position:"师生关系"}]->(b)

服务器端开发


本文详细介绍如何使用Neo4j图形数据库进行数据建模,包括创建节点、建立关系及复杂查询。通过具体案例,展示如何构建个人关系图谱,涵盖学生、教师及家庭成员之间的联系。
3324

被折叠的 条评论
为什么被折叠?



