本文整理了Java中org.vertexium.Graph.findRelatedEdgeSummary()
方法的一些代码示例,展示了Graph.findRelatedEdgeSummary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.findRelatedEdgeSummary()
方法的具体详情如下:
包路径:org.vertexium.Graph
类名称:Graph
方法名:findRelatedEdgeSummary
[英]Given a list of vertex ids, find all the edges that connect them.
[中]给定顶点ID列表,查找连接它们的所有边。
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFindRelatedEdgeSummaryAfterSoftDelete() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.softDeleteEdge(e1, AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(0, relatedEdges.size());
}
代码示例来源:origin: visallo/vertexium
@Test
public void testFindRelatedEdgeSummaryAfterMarkedHidden() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.markEdgeHidden(e1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(0, relatedEdges.size());
}
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFindRelatedEdgeSummaryAfterMarkedHidden() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.markEdgeHidden(e1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(0, relatedEdges.size());
}
代码示例来源:origin: visallo/vertexium
@Test
public void testFindRelatedEdgeSummaryAfterSoftDelete() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.softDeleteEdge(e1, AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(0, relatedEdges.size());
}
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFindRelatedEdgeSummaryAfterSoftDeleteAndReAdd() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.softDeleteEdge(e1, AUTHORIZATIONS_A);
graph.flush();
graph.prepareEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A)
.save(AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
}
代码示例来源:origin: visallo/vertexium
@Test
public void testFindRelatedEdgeSummaryAfterSoftDeleteAndReAdd() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
graph.softDeleteEdge(e1, AUTHORIZATIONS_A);
graph.flush();
graph.prepareEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A)
.save(AUTHORIZATIONS_A);
graph.flush();
relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(1, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
}
代码示例来源:origin: org.visallo/visallo-web-product-graph
systemAuthorizations
);
Iterable<RelatedEdge> productRelatedEdges = graph.findRelatedEdgeSummary(productVertexIds, authorizations);
List<String> ids = StreamUtil.stream(productRelatedEdges)
.map(RelatedEdge::getEdgeId)
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFindRelatedEdgeSummary() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v3 = graph.addVertex("v3", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v4 = graph.addVertex("v4", VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v1->v3", v1, v3, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v2->v3", v2, v3, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v3->v1", v3, v1, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v3->v4", v3, v4, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
vertexIds.add("v3");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(4, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v3", LABEL_LABEL1, v1.getId(), v3.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v2->v3", LABEL_LABEL2, v2.getId(), v3.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v3->v1", LABEL_LABEL2, v3.getId(), v1.getId()), relatedEdges);
}
代码示例来源:origin: visallo/vertexium
@Test
public void testFindRelatedEdgeSummary() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v3 = graph.addVertex("v3", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v4 = graph.addVertex("v4", VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v1->v2", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v1->v3", v1, v3, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v2->v3", v2, v3, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v3->v1", v3, v1, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.addEdge("e v3->v4", v3, v4, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
List<String> vertexIds = new ArrayList<>();
vertexIds.add("v1");
vertexIds.add("v2");
vertexIds.add("v3");
List<RelatedEdge> relatedEdges = toList(graph.findRelatedEdgeSummary(vertexIds, AUTHORIZATIONS_A));
assertEquals(4, relatedEdges.size());
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v2", LABEL_LABEL1, v1.getId(), v2.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v1->v3", LABEL_LABEL1, v1.getId(), v3.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v2->v3", LABEL_LABEL2, v2.getId(), v3.getId()), relatedEdges);
org.vertexium.test.util.IterableUtils.assertContains(new RelatedEdgeImpl("e v3->v1", LABEL_LABEL2, v3.getId(), v1.getId()), relatedEdges);
}
内容来源于网络,如有侵权,请联系作者删除!