简体   繁体   English

深度遍历Orientdb

[英]Depth traversal Orientdb

How can I get depth traversal of a graph in Orientdb . 如何在Orientdb中获得图形的深度遍历。 Using the documentation here is what I tried , yet when I run in I get an error here is the query . 这是我尝试使用的文档,但是在运行时遇到错误,是查询。

EXPLAIN SELECT FROM (TRAVERSE any("Edge1") FROM P_H WHILE $depth <= 3) WHERE p ='SP00000000001';

The goal is the get the equivalent of this Neo4j Query : 目标是获得与此Neo4j查询等效的内容:

MATCH (n:Node{NodeID:"SP00000000001"})-[:Edge1*1..3]-(d) RETURN Distinct d, n

Any help would be appreciated 任何帮助,将不胜感激

The easiest thing is using a MATCH statement: http://orientdb.com/docs/2.2.x/SQL-Match.html 最简单的方法是使用MATCH语句: http : //orientdb.com/docs/2.2.x/SQL-Match.html

 MATCH
   {class:Node, as:n, where:(NodeID = "SP00000000001") -EdgeClass- {as:d, while:($depth < 3), where: ($matched.n != $currentMatch)} }
 RETURN d, n 

Or RETURN $elements if you want the vertices expanded 或者,如果您想扩大顶点,则RETURN $elements

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM