org.vertexium.Edge.getVertex()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(11.2k)|赞(0)|评价(0)|浏览(162)

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

Edge.getVertex介绍

[英]Get the attach vertex on either side of the edge.
[中]获取边任一侧的附加顶点。

代码示例

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

/**
 * Get the attach vertex on either side of the edge.
 *
 * @param direction The side of the edge to get the vertex from (IN or OUT).
 * @return The vertex.
 */
default Vertex getVertex(Direction direction, Authorizations authorizations) {
  return getVertex(direction, getGraph().getDefaultFetchHints(), authorizations);
}

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

@Handle
  public ClientApiEdge handle(
      @Required(name = "graphEdgeId") String graphEdgeId,
      @ActiveWorkspaceId String workspaceId,
      Authorizations authorizations
  ) throws Exception {
    Edge edge = graph.getEdge(graphEdgeId, authorizations);
    if (edge == null) {
      throw new VisalloResourceNotFoundException("Could not find edge: " + graphEdgeId);
    }

    Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
    if (outVertex == null) {
      throw new VisalloResourceNotFoundException("Could not find outVertex: " + edge.getVertexId(Direction.OUT));
    }

    Vertex inVertex = edge.getVertex(Direction.IN, authorizations);
    if (inVertex == null) {
      throw new VisalloResourceNotFoundException("Could not find inVertex: " + edge.getVertexId(Direction.IN));
    }

    return ClientApiConverter.toClientApiEdgeWithVertexData(edge, outVertex, inVertex, workspaceId, authorizations);
  }
}

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

private void publishGlyphIconProperties(Edge hasImageEdge, String workspaceId, Authorizations authorizations) {
  Vertex entityVertex = hasImageEdge.getVertex(Direction.OUT, authorizations);
  checkNotNull(entityVertex, "Could not find has image source vertex " + hasImageEdge.getVertexId(Direction.OUT));
  ExistingElementMutation elementMutation = entityVertex.prepareMutation();
  Iterable<Property> glyphIconProperties = entityVertex.getProperties(VisalloProperties.ENTITY_IMAGE_VERTEX_ID.getPropertyName());
  for (Property glyphIconProperty : glyphIconProperties) {
    if (publishNewProperty(elementMutation, glyphIconProperty, workspaceId)) {
      elementMutation.save(authorizations);
      return;
    }
  }
  LOGGER.warn("new has image edge without a glyph icon property being set on vertex %s", entityVertex.getId());
}

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

/**
 * Get the attach vertex on either side of the edge.
 *
 * @param direction The side of the edge to get the vertex from (IN or OUT).
 * @return The vertex.
 */
default Vertex getVertex(Direction direction, Authorizations authorizations) {
  return getVertex(direction, getGraph().getDefaultFetchHints(), authorizations);
}

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

trace.data("edgeId", edge.getId());
try {
  Vertex out = edge.getVertex(Direction.OUT, authorizations);
  if (out == null) {
    throw new VertexiumException(String.format("Unable to mark edge hidden %s, can't find out vertex %s", edge.getId(), edge.getVertexId(Direction.OUT)));
  Vertex in = edge.getVertex(Direction.IN, authorizations);
  if (in == null) {
    throw new VertexiumException(String.format("Unable to mark edge hidden %s, can't find in vertex %s", edge.getId(), edge.getVertexId(Direction.IN)));

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

@Override
public void addElement(SearchIndex searchIndex, Graph graph, Element element, Authorizations authorizations) {
  if (!getConfig().isUpdateEdgeBoost()) {
    return;
  }
  if (!(element instanceof Edge)) {
    return;
  }
  Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations);
  if (vOut != null) {
    searchIndex.addElement(graph, vOut, authorizations);
  }
  Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations);
  if (vIn != null) {
    searchIndex.addElement(graph, vIn, authorizations);
  }
}

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

trace.data("edgeId", edge.getId());
try {
  Vertex out = edge.getVertex(Direction.OUT, FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
  if (out == null) {
    throw new VertexiumException(String.format("Unable to mark edge visible %s, can't find out vertex %s", edge.getId(), edge.getVertexId(Direction.OUT)));
  Vertex in = edge.getVertex(Direction.IN, FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
  if (in == null) {
    throw new VertexiumException(String.format("Unable to mark edge visible %s, can't find in vertex %s", edge.getId(), edge.getVertexId(Direction.IN)));

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

@Override
public void addElement(SearchIndex searchIndex, Graph graph, Element element, Authorizations authorizations) {
  if (!getConfig().isUpdateEdgeBoost()) {
    return;
  }
  if (!(element instanceof Edge)) {
    return;
  }
  Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations);
  if (vOut != null) {
    searchIndex.addElement(graph, vOut, authorizations);
  }
  Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations);
  if (vIn != null) {
    searchIndex.addElement(graph, vIn, authorizations);
  }
}

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

trace.data("edgeId", edge.getId());
try {
  Vertex out = edge.getVertex(Direction.OUT, FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
  if (out == null) {
    throw new VertexiumException(String.format("Unable to mark edge visible %s, can't find out vertex %s", edge.getId(), edge.getVertexId(Direction.OUT)));
  Vertex in = edge.getVertex(Direction.IN, FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
  if (in == null) {
    throw new VertexiumException(String.format("Unable to mark edge visible %s, can't find in vertex %s", edge.getId(), edge.getVertexId(Direction.IN)));

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

@Override
public int addElement(Elasticsearch2SearchIndex searchIndex, Graph graph, BulkRequest bulkRequest, IndexInfo indexInfo, Element element, Authorizations authorizations) {
  int totalCount = 0;
  if (!getConfig().isUpdateEdgeBoost()) {
    return totalCount;
  }
  if (!(element instanceof Edge)) {
    return totalCount;
  }
  Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations);
  if (vOut != null) {
    searchIndex.addElementToBulkRequest(graph, bulkRequest, indexInfo, vOut, authorizations);
    totalCount++;
  }
  Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations);
  if (vIn != null) {
    searchIndex.addElementToBulkRequest(graph, bulkRequest, indexInfo, vIn, authorizations);
    totalCount++;
  }
  return totalCount;
}

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

trace.data("edgeId", edge.getId());
try {
  Vertex out = edge.getVertex(Direction.OUT, authorizations);
  if (out == null) {
    throw new VertexiumException(String.format("Unable to mark edge hidden %s, can't find out vertex %s", edge.getId(), edge.getVertexId(Direction.OUT)));
  Vertex in = edge.getVertex(Direction.IN, authorizations);
  if (in == null) {
    throw new VertexiumException(String.format("Unable to mark edge hidden %s, can't find in vertex %s", edge.getId(), edge.getVertexId(Direction.IN)));

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

@Override
public int addElement(ElasticsearchSingleDocumentSearchIndex searchIndex, Graph graph, BulkRequest bulkRequest, IndexInfo indexInfo, Element element, Authorizations authorizations) {
  int totalCount = 0;
  if (!getConfig().isUpdateEdgeBoost()) {
    return totalCount;
  }
  if (!(element instanceof Edge)) {
    return totalCount;
  }
  Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations);
  if (vOut != null) {
    searchIndex.addElementToBulkRequest(graph, bulkRequest, indexInfo, vOut, authorizations);
    totalCount++;
  }
  Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations);
  if (vIn != null) {
    searchIndex.addElementToBulkRequest(graph, bulkRequest, indexInfo, vIn, authorizations);
    totalCount++;
  }
  return totalCount;
}

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

assertEquals(LABEL_LABEL1, addedEdge.getLabel());
assertEquals("v1", addedEdge.getVertexId(Direction.OUT));
assertEquals(v1, addedEdge.getVertex(Direction.OUT, AUTHORIZATIONS_A));
assertEquals("v2", addedEdge.getVertexId(Direction.IN));
assertEquals(v2, addedEdge.getVertex(Direction.IN, AUTHORIZATIONS_A));
assertEquals(VISIBILITY_A, addedEdge.getVisibility());
assertEquals(LABEL_LABEL1, e.getLabel());
assertEquals("v1", e.getVertexId(Direction.OUT));
assertEquals(v1, e.getVertex(Direction.OUT, AUTHORIZATIONS_A));
assertEquals("v2", e.getVertexId(Direction.IN));
assertEquals(v2, e.getVertex(Direction.IN, AUTHORIZATIONS_A));
assertEquals(VISIBILITY_A, e.getVisibility());

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

Authorizations authorizations
) {
  Vertex inVertex = edge.getVertex(Direction.IN, authorizations);
  addSourceInfoToVertex(
      inVertex,

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

assertEquals(LABEL_LABEL1, addedEdge.getLabel());
assertEquals("v1", addedEdge.getVertexId(Direction.OUT));
assertEquals(v1, addedEdge.getVertex(Direction.OUT, AUTHORIZATIONS_A));
assertEquals("v2", addedEdge.getVertexId(Direction.IN));
assertEquals(v2, addedEdge.getVertex(Direction.IN, AUTHORIZATIONS_A));
assertEquals(VISIBILITY_A, addedEdge.getVisibility());
assertEquals(LABEL_LABEL1, e.getLabel());
assertEquals("v1", e.getVertexId(Direction.OUT));
assertEquals(v1, e.getVertex(Direction.OUT, AUTHORIZATIONS_A));
assertEquals("v2", e.getVertexId(Direction.IN));
assertEquals(v2, e.getVertex(Direction.IN, AUTHORIZATIONS_A));
assertEquals(VISIBILITY_A, e.getVisibility());

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

@Handle
  public ClientApiSuccess handle(
      @Required(name = "edgeId") String edgeId,
      @ActiveWorkspaceId String workspaceId,
      User user,
      Authorizations authorizations
  ) throws Exception {
    Edge edge = graph.getEdge(edgeId, authorizations);
    if (!aclProvider.canDeleteElement(edge, user, workspaceId)) {
      throw new VisalloAccessDeniedException("Edge " + edgeId + " is not deleteable", user, edge.getId());
    }

    Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
    Vertex inVertex = edge.getVertex(Direction.IN, authorizations);

    SandboxStatus sandboxStatus = SandboxStatusUtil.getSandboxStatus(edge, workspaceId);

    boolean isPublicEdge = sandboxStatus == SandboxStatus.PUBLIC;

    workspaceHelper.deleteEdge(workspaceId, edge, outVertex, inVertex, isPublicEdge, Priority.HIGH, authorizations, user);

    return VisalloResponse.SUCCESS;
  }
}

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

for (Edge edge : vertex.getEdges(Direction.BOTH, entityHasImageIri, authorizations)) {
  if (edge.getVertexId(Direction.IN).equals(vertex.getId())) {
    Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
    Property entityHasImage = outVertex.getProperty(VisalloProperties.ENTITY_IMAGE_VERTEX_ID.getPropertyName());
    outVertex.softDeleteProperty(entityHasImage.getKey(), entityHasImage.getName(), authorizations);
    String multiValueKey = rowKeyProperty.getValue().toString();
    if (edge.getVertexId(Direction.IN).equals(vertex.getId())) {
      Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);

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

@Override
public Vertex getVertex(Direction direction) throws IllegalArgumentException {
  org.vertexium.Direction sgDirection = VertexiumBlueprintsConvert.toVertexium(direction);
  Authorizations authorizations = getGraph().getAuthorizationsProvider().getAuthorizations();
  return VertexiumBlueprintsVertex.create(getGraph(), getVertexiumElement().getVertex(sgDirection, authorizations), authorizations);
}

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

authorizations
);
Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
Vertex inVertex = edge.getVertex(Direction.IN, authorizations);
if (SandboxStatusUtil.getSandboxStatus(edge, workspaceId) == SandboxStatus.PUBLIC
    && !WorkspaceDiffHelper.isPublicDelete(edge, authorizations)) {

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

continue;
Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
Vertex inVertex = edge.getVertex(Direction.IN, authorizations);
if (outVertex == null || inVertex == null) {
  continue;

相关文章