use of com.baidu.hugegraph.structure.traverser.Ranks in project incubator-hugegraph-toolchain by apache.
the class NeighborRankApiTest method testNeighborRankWithIsolatedVertex.
@Test
public void testNeighborRankWithIsolatedVertex() {
Vertex isolate = graph().addVertex(T.label, "person", T.id, "isolate", "name", "isolate-vertex");
NeighborRankAPI.Request.Builder builder;
builder = NeighborRankAPI.Request.builder();
builder.source("isolate").alpha(0.9);
builder.steps().direction(Direction.BOTH);
NeighborRankAPI.Request request = builder.build();
List<Ranks> ranks = neighborRankAPI.post(request);
Assert.assertEquals(2, ranks.size());
Assert.assertEquals(ImmutableMap.of("isolate", 1.0D), ranks.get(0));
Assert.assertEquals(ImmutableMap.of(), ranks.get(1));
graph().removeVertex(isolate.id());
}
Aggregations