<graph>
<ele>
<cell name = cell_1 linkPt = "1" linkPt = "2" />
<resistance name = r_1 linkPt = "3" linkPt = "4" />
<wire name = wire_1 linkPt = "5" linkPt = "6" />
<wire name = wire_2 linkPt = "7" linkPt = "8" />
<wire name = wire_3 linkPt = "9" linkPt = "10" />
<light light = ligtht_1 linkPt = "11" linkPt = "12" />
</ele>
<linkPts>
<linkpt name =1>
<linkpt name =2>
<linkpt name =3>
<linkpt name =4>
<linkpt name =5>
<linkpt name =6>
<linkpt name =7>
<linkpt name =8>
<linkpt name =9>
<linkpt name =10>
<linkpt name =11>
<linkpt name =12>
</linkPts>
<links>
<link name = 1 linkstart = "cell_1 " linkend = "1" linkend = "3" />
<link name = 2 linkstart = "" linkend = "" />
<link name = 3 linkstart = "" linkend = "" />
<link name = 4 linkstart = "" linkend = "" />
<link name = 5 linkstart = "" linkend = "" />
<link name = 5 linkstart = "" linkend = "" />
<link name = 5 linkstart = "" linkend = "" />
</links>
</graph>
接下来我们写Neo4J的数据的版本,我们通过壳的质量创建关系和数据实体。
创建基本设备
create (cell:cell_1{})
create (resistance :r_1 {})
create (wire: wire_1{})
create (wire: wire_2{})
create (wire: wire_3{})
create (light: ligtht_1{})
创建连接点:
create (linkpt : 1{})
create (linkpt : 2{})
create (linkpt : 3{})
create (linkpt : 4{})
create (linkpt : 5{})
创建连接关系
CREATE
(cell_1)<- [Link:link1{} ] -> (1)
(1)<- [Link:link1{} ] -> (2)
(2)<- [Link:link1{} ] -> ( wire_1)
.....
实际上就是按照上面的格式,将这些点和线以及设备一一的创建连接起来,我们的这个数据库逻辑图就基本上建立完成了。作为一个有技术兴趣的人,可以自己去一步一步的去完整的实现这个逻辑关系图,这里只做一个抛砖引玉的作用,打开一个思路和学习方法。
网友评论