OrientDB shortestPath() 使用特定边@class?

OrientDB shortestPath() using specific edge @class?

shortestPath() 函数将方向作为第三个参数。我如何修改该函数,使其仅遍历特定 class 的边?我相信我可以在第 106 行添加 class 作为第二个参数:

https://github.com/orientechnologies/orientdb/blob/b21429d600f87193611eed3d33b90d5fb9c2f61e/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionShortestPath.java

但是,如果我这样做,是否需要从源代码重建?我怎样才能创建一个自定义函数以在我的查询中使用?

刚刚在 OrientDB v.2.0.9 和 2.1 中实现。 两者都将在接下来的几天发布,如果你现在想尝试,你可以从源代码编译(分支“2.0.x”和"develop")

函数的当前签名是这样的:

shortestPath(<sourceVertex>, <destinationVertex>, [<direction>, [ <edgeTypeAsString> ]])

用法示例

SELECT shortestPath(#12:0, #12:10, null, "MyEdgeClass")