0

グラフ データベースは初めてで、Neo4j ブログの例を使用して Java で ACL を作成しようとしています。

アクセス制御リスト グラフ データベースの方法

問題は、提供されている Ruby コードにあります。

#Here's our function to check the distance between principals (and to see if they're on the same path at all).
def depth_of_principal( principal, reference_principal )
  result = reference_principal.outgoing( :IS_MEMBER_OF_GROUP ).depth( :all ).path_to( principal )
  return result.nil? ? nil : result.size
end

Javaで最短パスアルゴリズムを使用する必要がありますか、それとも間違っていますか? これをJavaに移植する正しい方法は何でしょうか?

        PathFinder<Path> finder = GraphAlgoFactory.shortestPath(Traversal.expanderForTypes(RelTypes.IS_MEMBER_OF_GROUP, Direction.OUTGOING), maxDepth);
        Path path = finder.findSinglePath(principal, referencePrincipal);

適合しないことの 1 つは maxDepth ですが、パスが 15 よりも深くなることはないので、問題ないと思いますか?

4

1 に答える 1