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

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

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

Graph.getExtendedData介绍

[英]Gets the specified extended data rows.
[中]获取指定的扩展数据行。

代码示例

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

protected static void handleExtendedDataRow(
      Graph graph,
      Elasticsearch5SearchIndex elasticsearch5SearchIndex,
      FlushObjectQueue.FlushObject flushObject,
      Authorizations authorizations
  ) {
    ExtendedDataRowId id = new ExtendedDataRowId(
        flushObject.getElementType(),
        flushObject.getElementId(),
        flushObject.getExtendedDataTableName(),
        flushObject.getExtendedDataRowId()
    );
    ExtendedDataRow row = graph.getExtendedData(id, authorizations);
    elasticsearch5SearchIndex.addExtendedData(graph, Collections.singletonList(row), authorizations);
  }
}

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

protected static void handleExtendedDataRow(
      Graph graph,
      Elasticsearch5SearchIndex elasticsearch5SearchIndex,
      FlushObjectQueue.FlushObject flushObject,
      Authorizations authorizations
  ) {
    ExtendedDataRowId id = new ExtendedDataRowId(
        flushObject.getElementType(),
        flushObject.getElementId(),
        flushObject.getExtendedDataTableName(),
        flushObject.getExtendedDataRowId()
    );
    ExtendedDataRow row = graph.getExtendedData(id, authorizations);
    elasticsearch5SearchIndex.addExtendedData(graph, Collections.singletonList(row), authorizations);
  }
}

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

@Handle
  public ClientApiExtendedDataGetResponse handle(
      @Required(name = "elementType") ElementType elementType,
      @Required(name = "elementId") String elementId,
      @Required(name = "tableName") String tableName,
      Authorizations authorizations
  ) throws Exception {
    Iterable<ExtendedDataRow> rows = graph.getExtendedData(elementType, elementId, tableName, authorizations);
    return new ClientApiExtendedDataGetResponse(ClientApiConverter.toClientApiExtendedDataRows(rows));
  }
}

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

Iterable<? extends VertexiumObject> extendedDataRows = getGraph().getExtendedData(ids.getExtendedDataIds(), filterParameters.getAuthorizations());
items.add(extendedDataRows);

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

Iterable<? extends VertexiumObject> extendedDataRows = getGraph().getExtendedData(ids.getExtendedDataIds(), filterParameters.getAuthorizations());
items.add(extendedDataRows);

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

Iterable<? extends VertexiumObject> extendedDataRows = getGraph().getExtendedData(ids.getExtendedDataIds(), authorizations);
items.add(extendedDataRows);

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

Iterable<? extends VertexiumObject> extendedDataRows = getGraph().getExtendedData(ids.getExtendedDataIds(), authorizations);
items.add(extendedDataRows);

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

row = graph.getExtendedData(new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), AUTHORIZATIONS_A);
assertEquals("row1", row.getId().getRowId());
assertEquals(date1, row.getPropertyValue("date"));
assertEquals("value1", row.getPropertyValue("name"));
rows = graph.getExtendedData(
    Lists.newArrayList(
        new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"),
rows = graph.getExtendedData(ElementType.VERTEX, "v1", "table1", AUTHORIZATIONS_A).iterator();
assertEquals(1, rowsList.size());
assertEquals(5, count(graph.getExtendedData(ElementType.VERTEX, "v1", null, AUTHORIZATIONS_A)));
assertEquals(5, count(graph.getExtendedData(ElementType.VERTEX, null, null, AUTHORIZATIONS_A)));
assertEquals(5, count(graph.getExtendedData(null, null, null, AUTHORIZATIONS_A)));
try {
  count(graph.getExtendedData(null, null, "table1", AUTHORIZATIONS_A));
  fail("nulls to the left of a value is not allowed");
} catch (Exception ex) {
  count(graph.getExtendedData(null, "v1", null, AUTHORIZATIONS_A));
  fail("nulls to the left of a value is not allowed");
} catch (Exception ex) {

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

row = graph.getExtendedData(new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"), AUTHORIZATIONS_A);
assertEquals("row1", row.getId().getRowId());
assertEquals(date1, row.getPropertyValue("date"));
assertEquals("value1", row.getPropertyValue("name"));
rows = graph.getExtendedData(
    Lists.newArrayList(
        new ExtendedDataRowId(ElementType.VERTEX, "v1", "table1", "row1"),
rows = graph.getExtendedData(ElementType.VERTEX, "v1", "table1", AUTHORIZATIONS_A).iterator();
assertEquals(1, rowsList.size());
assertEquals(5, count(graph.getExtendedData(ElementType.VERTEX, "v1", null, AUTHORIZATIONS_A)));
assertEquals(5, count(graph.getExtendedData(ElementType.VERTEX, null, null, AUTHORIZATIONS_A)));
assertEquals(5, count(graph.getExtendedData(null, null, null, AUTHORIZATIONS_A)));
try {
  count(graph.getExtendedData(null, null, "table1", AUTHORIZATIONS_A));
  fail("nulls to the left of a value is not allowed");
} catch (Exception ex) {
  count(graph.getExtendedData(null, "v1", null, AUTHORIZATIONS_A));
  fail("nulls to the left of a value is not allowed");
} catch (Exception ex) {

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

@Test
public void testAddExtendedDataRows() {
  graph.prepareVertex("v1", VISIBILITY_A)
      .addExtendedData("table1", "row1", "name", "value1", VISIBILITY_A)
      .addExtendedData("table1", "row2", "name", "value2", VISIBILITY_A)
      .save(AUTHORIZATIONS_A);
  graph.flush();
  if (graph instanceof GraphWithSearchIndex) {
    SearchIndex searchIndex = ((GraphWithSearchIndex) graph).getSearchIndex();
    searchIndex.truncate(graph);
    searchIndex.flush(graph);
    Iterable<ExtendedDataRow> extendedData = graph.getExtendedData(ElementType.VERTEX, "v1", "table1", AUTHORIZATIONS_A);
    searchIndex.addExtendedData(graph, extendedData, AUTHORIZATIONS_A);
    graph.flush();
  }
  QueryResultsIterable<ExtendedDataRow> rows = graph.query(AUTHORIZATIONS_A).extendedDataRows();
  assertResultsCount(2, 2, rows);
  rows = graph.query(AUTHORIZATIONS_A)
      .has("name", "value1")
      .extendedDataRows();
  assertResultsCount(1, 1, rows);
  ExtendedDataRow row = IterableUtils.single(rows);
  assertEquals("v1", row.getId().getElementId());
  assertEquals("table1", row.getId().getTableName());
  assertEquals("row1", row.getId().getRowId());
}

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

@Test
public void testAddExtendedDataRows() {
  graph.prepareVertex("v1", VISIBILITY_A)
      .addExtendedData("table1", "row1", "name", "value1", VISIBILITY_A)
      .addExtendedData("table1", "row2", "name", "value2", VISIBILITY_A)
      .save(AUTHORIZATIONS_A);
  graph.flush();
  if (graph instanceof GraphWithSearchIndex) {
    SearchIndex searchIndex = ((GraphWithSearchIndex) graph).getSearchIndex();
    searchIndex.truncate(graph);
    searchIndex.flush(graph);
    Iterable<ExtendedDataRow> extendedData = graph.getExtendedData(ElementType.VERTEX, "v1", "table1", AUTHORIZATIONS_A);
    searchIndex.addExtendedData(graph, extendedData, AUTHORIZATIONS_A);
    graph.flush();
  }
  QueryResultsIterable<ExtendedDataRow> rows = graph.query(AUTHORIZATIONS_A).extendedDataRows();
  assertResultsCount(2, 2, rows);
  rows = graph.query(AUTHORIZATIONS_A)
      .has("name", "value1")
      .extendedDataRows();
  assertResultsCount(1, 1, rows);
  ExtendedDataRow row = IterableUtils.single(rows);
  assertEquals("v1", row.getId().getElementId());
  assertEquals("table1", row.getId().getTableName());
  assertEquals("row1", row.getId().getRowId());
}

相关文章

微信公众号

最新文章

更多