グラフ データベースは初めてで、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 よりも深くなることはないので、問題ないと思いますか?