将RelationshipTypes定义为
private enum Rels实现RelationshipType { LIKES,KNOWS}图表可以通过例如以下遍历遍历,从“Joe”节点开始:
for(路径位置:Traversal.description() .depthFirst() .relationships(Rels.KNOWS) .relationships(Rels.LIKES,Direction.INCOMING) .evaluator(Evaluators.toDepth(5)) .traverse(node)){ 输出+ =位置+“\ n”;遍历将输出:
(7)(7)< - [LIKES,1] - (4)(7)< - [LIKES,1] - (4) - [知识,6] - > (1) (7)< - [LIKES,1] - (4) - [所知,6] - GT;(1) - [所知,4] - >(6) (7)< - [喜欢,1] - (4) - [所知,6] - GT;(1) - [所知,4] - >(6) - [都知道, 3] - >(5) (7)< - [喜欢,1] - (4) - [所知,6] - GT;(1) - [所知,4] - >(6) - [都知道, 3] - >(5) - [知识,2] - >(2)(7)< - [LIKES,1] - (4) - [知识,6] - > ;(1) - ; - [所知,5] - (3)
如果我们采取(7)< - [LIKES,1] - (4)数字1代表什么?
提前感谢您提供更多信息 http://docs.neo4j.org/chunked/stable/tutorial-traversal-java-api.html
答案 0 :(得分:3)
这可能是边缘的内容