【问题标题】:OrientDB -- is there a way to find out which edge was traversed?OrientDB——有没有办法找出遍历了哪条边?
【发布时间】:2015-04-26 18:09:02
【问题描述】:

为此,我一直在研究/四处寻找, 但是,找不到任何线索。 我认为这是一个限制,但是,我想确定一下。

场景(一): 在这种情况下,我已明确告知我要遍历哪条边。因此,我知道谁参加了 VPN-101 活动。

orientdb {db=event}> select firstname from (traverse in('people_attending_event')  from (select from Event where name='VPN-101')) where @class='People';

0   |null  |Mohammed
1   |null  |Sed
2   |null  |Fob

场景(2): 在这种情况下,我想知道哪些顶点与 VPN-101 顶点相关联,因此我在这里使用了 _in()。输出为我提供了 3 个名称,但是,有没有办法知道遍历了哪些特定边以获得输出? 在这个例子中,我只选择了 firstname,但是即使我执行 select *,它也不会告诉我遍历了哪些边来获取输出,它只是提供我与顶点关联的属性。

orientdb {db=event}> select firstname from (traverse in()  from (select from Event where name='VPN-101')) where @class='People';

0   |null  |Mohammed
1   |null  |Sed
2   |null  |Fob

我可以做些什么来知道我在寻找什么? 我感谢任何见解或帮助。 谢谢。

【问题讨论】:

    标签: orientdb


    【解决方案1】:

    返回 TRAVERSE 命令的最后 3 个遍历边:

    SELECT traversedEdge(-1, 3) FROM ( TRAVERSE outE(), inV() from #34:3232 WHILE $depth <= 10 )
    

    有关更多信息,请查看文档:http://orientdb.com/docs/last/SQL-Functions.html#traversededge

    【讨论】:

    • 谢谢卢卡!谢谢有帮助。仍然需要大量了解 OrientDB。实际上,我希望得到 People 名称以及它所经过的边缘。我决定创建一个标准边缘,用属性填充它并执行“连接”。例如选择呼号,out_relationship.attending 作为参加,out_relationship.mandatory 作为强制性 from (traverse in("relationship") from (select from Event where name="VPN-101")) where @class="People"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-20
    • 2015-07-24
    • 1970-01-01
    • 2016-01-16
    • 2016-05-03
    • 1970-01-01
    相关资源
    最近更新 更多