org.vertexium.Graph.doesVertexExist()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.vertexium.Graph.doesVertexExist()方法的一些代码示例,展示了Graph.doesVertexExist()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.doesVertexExist()方法的具体详情如下:
包路径:org.vertexium.Graph
类名称:Graph
方法名:doesVertexExist

Graph.doesVertexExist介绍

[英]Tests the existence of a vertex with the given authorizations.
[中]使用给定的授权测试顶点的存在性。

代码示例

代码示例来源:origin: org.visallo/visallo-model-vertexium

@VisibleForTesting
boolean isSearchGlobal(String id, Authorizations authorizations) {
  if (!graph.doesVertexExist(id, authorizations)) {
    return false;
  }
  Iterable<String> vertexIds = getGlobalSavedSearchesRootVertex().getVertexIds(
      Direction.OUT,
      SearchProperties.HAS_SAVED_SEARCH,
      authorizations
  );
  return stream(vertexIds).anyMatch(vertexId -> vertexId.equals(id));
}

代码示例来源:origin: org.visallo/visallo-web-product-graph

public void updateVertices(
    GraphUpdateContext ctx,
    Vertex productVertex,
    Map<String, GraphUpdateProductEdgeOptions> updateVertices,
    User user,
    Visibility visibility,
    Authorizations authorizations
) {
  @SuppressWarnings("unchecked")
  Set<String> vertexIds = updateVertices.keySet();
  for (String id : vertexIds) {
    GraphUpdateProductEdgeOptions updateData = updateVertices.get(id);
    String edgeId = getEdgeId(productVertex.getId(), id);
    //undoing compound node removal
    if (updateData.hasChildren() && !ctx.getGraph().doesVertexExist(id, authorizations)) {
      addCompoundNode(ctx, productVertex, updateData, user, visibility, authorizations);
    }
    addOrUpdateProductEdgeToEntity(ctx, productVertex, id, updateData, visibility);
  }
}

代码示例来源:origin: org.vertexium/vertexium-test

assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertTrue("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
Assert.assertEquals(1, count(graph.getEdges(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
assertFalse("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertTrue("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
Assert.assertEquals(1, count(graph.getEdges(AUTHORIZATIONS_A)));

代码示例来源:origin: visallo/vertexium

assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertTrue("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
Assert.assertEquals(1, count(graph.getEdges(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
assertFalse("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertFalse("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(1, count(graph.getVertices(AUTHORIZATIONS_A_AND_B)));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
assertTrue("v1 exists (auth A)", graph.doesVertexExist("v1", AUTHORIZATIONS_A));
assertFalse("v1 exists (auth B)", graph.doesVertexExist("v1", AUTHORIZATIONS_B));
assertTrue("v1 exists (auth A&B)", graph.doesVertexExist("v1", AUTHORIZATIONS_A_AND_B));
Assert.assertEquals(2, count(graph.getVertices(AUTHORIZATIONS_A)));
Assert.assertEquals(1, count(graph.getEdges(AUTHORIZATIONS_A)));

代码示例来源:origin: org.visallo/visallo-model-vertexium

);
if (graph.doesVertexExist(id, authorizations)) {

相关文章