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

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

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

Graph.getVertexPropertyCountByValue介绍

[英]Gets the number of times a property with a given value occurs on vertices
[中]获取具有给定值的属性在顶点上出现的次数

代码示例

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

@Handle
  public ClientApiVertexCountsByConceptType handle(
      Authorizations authorizations
  ) throws Exception {
    Map<Object, Long> conceptTypeCounts = graph.getVertexPropertyCountByValue(VisalloProperties.CONCEPT_TYPE.getPropertyName(), authorizations);
    return new ClientApiVertexCountsByConceptType(conceptTypeCounts);
  }
}

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

@Test
public void testGetVertexPropertyCountByValue() {
  boolean searchIndexFieldLevelSecurity = isSearchIndexFieldLevelSecuritySupported();
  graph.defineProperty("name").dataType(String.class).textIndexHint(TextIndexHint.EXACT_MATCH).define();
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .addPropertyValue("k2", "name", "Joseph", VISIBILITY_EMPTY)
      .addPropertyValue("", "age", 25, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareVertex("v2", VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .addPropertyValue("k2", "name", "Joseph", VISIBILITY_B)
      .addPropertyValue("", "age", 20, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareEdge("e1", "v1", LABEL_LABEL1, VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Map<Object, Long> vertexPropertyCountByValue = graph.getVertexPropertyCountByValue("name", AUTHORIZATIONS_EMPTY);
  assertEquals(2, vertexPropertyCountByValue.size());
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joe"));
  assertEquals(searchIndexFieldLevelSecurity ? 1L : 2L, (long) vertexPropertyCountByValue.get("joseph"));
  vertexPropertyCountByValue = graph.getVertexPropertyCountByValue("name", AUTHORIZATIONS_A_AND_B);
  assertEquals(2, vertexPropertyCountByValue.size());
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joe"));
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joseph"));
}

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

@Test
public void testGetVertexPropertyCountByValue() {
  boolean searchIndexFieldLevelSecurity = isSearchIndexFieldLevelSecuritySupported();
  graph.defineProperty("name").dataType(String.class).textIndexHint(TextIndexHint.EXACT_MATCH).define();
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .addPropertyValue("k2", "name", "Joseph", VISIBILITY_EMPTY)
      .addPropertyValue("", "age", 25, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareVertex("v2", VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .addPropertyValue("k2", "name", "Joseph", VISIBILITY_B)
      .addPropertyValue("", "age", 20, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareEdge("e1", "v1", LABEL_LABEL1, VISIBILITY_EMPTY)
      .addPropertyValue("k1", "name", "Joe", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Map<Object, Long> vertexPropertyCountByValue = graph.getVertexPropertyCountByValue("name", AUTHORIZATIONS_EMPTY);
  assertEquals(2, vertexPropertyCountByValue.size());
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joe"));
  assertEquals(searchIndexFieldLevelSecurity ? 1L : 2L, (long) vertexPropertyCountByValue.get("joseph"));
  vertexPropertyCountByValue = graph.getVertexPropertyCountByValue("name", AUTHORIZATIONS_A_AND_B);
  assertEquals(2, vertexPropertyCountByValue.size());
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joe"));
  assertEquals(2L, (long) vertexPropertyCountByValue.get("joseph"));
}

相关文章