边缘指向边缘?

时间:2018-08-15 22:39:02

标签: orientdb

在OrientDB 3.0.x(x> 5)中,是否可以具有边缘,其一端之一也是边缘?似乎有可能,但在文档中没有解释:

        --Define vertex A,B,C
        create class testVertexA extends V;
        create class testVertexB extends V;
        create class testVertexC extends V;

        --Define EdgeA that connects 2 vertexes -A and B
        create class testEdgeA extends E;
        create property testEdgeA.in link testVertexA;
        create property testEdgeA.out link testVertexB;

        --Define EdgeB that connects EdgeA and vertex C - is this possible?
        create class testEdgeB extends E;
        create property testEdgeB.in link testVertexC;
        create property testEdgeB.out link testEdgeA;

接下来,我们放入一些数据,以查看这是否完全有效:     orientdb>插入testVertexA;

Inserted record '[testVertexA#225:0 v1]' in 0.000000 sec(s).

orientdb > insert into testVertexB;

Inserted record '[testVertexB#233:0 v1]' in 0.016000 sec(s).

orientdb > insert into testVertexC;

Inserted record '[testVertexC#241:0 v1]' in 0.000000 sec(s).

orientdb > insert into testEdgeA set in=#225:0, out=#233:0;

Inserted record '[testEdgeA#249:0{in:#225:0,out:#233:0} v1]' in 0.000000 sec(s).

orientdb > insert into testEdgeB set in=#241:0, out=#249:0;

Inserted record '[testEdgeB#257:0{in:#241:0,out:#249:0} v1]' in 0.000000 sec(s).

orientdb > select from testEdgeB;

+----+------+---------+------+------+
|#   |@RID  |@CLASS   |in    |out   |
+----+------+---------+------+------+
|0   |#257:0|testEdgeB|#241:0|#249:0|
+----+------+---------+------+------+

1 item(s) found. Query executed in 0.0 sec(s).

orientdb > select from  #241:0

+----+------+-----------+
|#   |@RID  |@CLASS     |
+----+------+-----------+
|0   |#241:0|testVertexC|
+----+------+-----------+

1 item(s) found. Query executed in 0.0 sec(s).
orientdb > select from  #249:0

+----+------+---------+------+------+
|#   |@RID  |@CLASS   |in    |out   |
+----+------+---------+------+------+
|0   |#249:0|testEdgeA|#225:0|#233:0|
+----+------+---------+------+------+

1 item(s) found. Query executed in 0.0 sec(s).

有人可以肯定这一点吗?谢谢

0 个答案:

没有答案