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

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

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

Edge.getId介绍

暂无

代码示例

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

@Override
  protected String convert(Edge edge) {
    return edge.getId();
  }
};

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

@Override
  protected String convert(Edge edge) {
    return edge.getId();
  }
};

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

@Override
  protected String convert(Edge edge) {
    return edge.getId();
  }
}

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

@Override
public Map<String, Boolean> doEdgesExist(Iterable<String> ids, Long endTime, Authorizations authorizations) {
  Map<String, Boolean> results = new HashMap<>();
  for (String id : ids) {
    results.put(id, false);
  }
  for (Edge edge : getEdges(ids, FetchHints.NONE, endTime, authorizations)) {
    results.put(edge.getId(), true);
  }
  return results;
}

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

@Override
public Map<String, Boolean> doEdgesExist(Iterable<String> ids, Long endTime, Authorizations authorizations) {
  Map<String, Boolean> results = new HashMap<>();
  for (String id : ids) {
    results.put(id, false);
  }
  for (Edge edge : getEdges(ids, FetchHints.NONE, endTime, authorizations)) {
    results.put(edge.getId(), true);
  }
  return results;
}

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

@Override
public Edge getEdge(String edgeId, FetchHints fetchHints, Long endTime, Authorizations authorizations) {
  for (Edge edge : getEdges(fetchHints, endTime, authorizations)) {
    if (edge.getId().equals(edgeId)) {
      return edge;
    }
  }
  return null;
}

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

@Override
  protected boolean isIncluded(Vertex termMention) {
    String forElementId = VisalloProperties.TERM_MENTION_FOR_ELEMENT_ID.getPropertyValue(termMention);
    if (forElementId == null || !forElementId.equals(edge.getId())) {
      return false;
    }
    return isTermMentionForProperty(termMention, propertyKey, propertyName, propertyVisibility);
  }
};

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

protected void broadcastEdgeDeletion(Edge edge) {
  JSONObject dataJson = new JSONObject();
  if (edge != null) {
    dataJson.put("edgeId", edge.getId());
    dataJson.put("outVertexId", edge.getVertexId(Direction.OUT));
    dataJson.put("inVertexId", edge.getVertexId(Direction.IN));
  }
  JSONObject json = new JSONObject();
  json.put("type", "edgeDeletion");
  json.put("data", dataJson);
  broadcastJson(json);
}

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

void removeOutEdge(Edge edge) {
  if (this.outEdges instanceof EdgesWithEdgeInfo) {
    ((EdgesWithEdgeInfo) this.outEdges).remove(edge.getId());
  } else {
    throw new VertexiumException("Cannot remove out edge");
  }
}

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

void removeOutEdge(Edge edge) {
  if (this.outEdges instanceof EdgesWithEdgeInfo) {
    ((EdgesWithEdgeInfo) this.outEdges).remove(edge.getId());
  } else {
    throw new VertexiumException("Cannot remove out edge");
  }
}

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

/**
 * If this is a resolved term mention. This allows setting that information.
 *
 * @param resolvedToVertex The vertex this term mention resolves to.
 * @param resolvedEdge     The edge that links the source vertex to the resolved vertex.
 */
public TermMentionBuilder resolvedTo(Vertex resolvedToVertex, Edge resolvedEdge) {
  return resolvedTo(resolvedToVertex.getId(), resolvedEdge.getId());
}

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

@Override
  protected EdgeVertexPair convert(Edge edge) {
    String otherVertexId = edge.getOtherVertexId(sourceVertexId);
    Vertex otherVertex = vertices.get(otherVertexId);
    if (otherVertex == null) {
      throw new VertexiumException("Found an edge " + edge.getId() + ", but could not find the vertex on the other end: " + otherVertexId);
    }
    return new EdgeVertexPair(edge, otherVertex);
  }
};

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

@Override
  protected EdgeVertexPair convert(Edge edge) {
    String otherVertexId = edge.getOtherVertexId(sourceVertexId);
    Vertex otherVertex = vertices.get(otherVertexId);
    if (otherVertex == null) {
      throw new VertexiumException("Found an edge " + edge.getId() + ", but could not find the vertex on the other end: " + otherVertexId);
    }
    return new EdgeVertexPair(edge, otherVertex);
  }
};

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

public ClientApiSourceInfo getSourceInfoForEdge(Edge edge, Authorizations authorizations) {
  String inVertexId = edge.getVertexId(Direction.IN);
  Vertex termMention = findTermMention(inVertexId, edge.getId(), null, null, null, authorizations);
  return getSourceInfoFromTermMention(termMention, authorizations);
}

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

public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) {
  ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
  ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
  if (currentColumnVisibility.equals(newColumnVisibility)) {
    return false;
  }
  EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN));
  vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility);
  vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
  return true;
}

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

public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) {
  ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
  ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
  if (currentColumnVisibility.equals(newColumnVisibility)) {
    return false;
  }
  EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN));
  vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility);
  vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
  return true;
}

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

void addInEdge(Edge edge) {
  if (this.inEdges instanceof EdgesWithEdgeInfo) {
    ((EdgesWithEdgeInfo) this.inEdges).add(edge.getId(), new org.vertexium.accumulo.iterator.model.EdgeInfo(edge.getLabel(), edge.getVertexId(Direction.OUT)));
  } else {
    throw new VertexiumException("Cannot add edge");
  }
}

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

void addInEdge(Edge edge) {
  if (this.inEdges instanceof EdgesWithEdgeInfo) {
    ((EdgesWithEdgeInfo) this.inEdges).add(edge.getId(), new org.vertexium.accumulo.iterator.model.EdgeInfo(edge.getLabel(), edge.getVertexId(Direction.OUT)));
  } else {
    throw new VertexiumException("Cannot add edge");
  }
}

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

public void alterEdgeLabel(Edge edge, String newEdgeLabel) {
  ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
  Mutation m = createAlterEdgeLabelMutation(edge, newEdgeLabel, edgeColumnVisibility);
  saveEdgeMutation(m);
  saveEdgeInfoOnVertex(
      edge.getId(),
      edge.getVertexId(Direction.OUT),
      edge.getVertexId(Direction.IN),
      newEdgeLabel,
      edgeColumnVisibility
  );
}

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

public void alterEdgeLabel(Edge edge, String newEdgeLabel) {
  ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
  Mutation m = createAlterEdgeLabelMutation(edge, newEdgeLabel, edgeColumnVisibility);
  saveEdgeMutation(m);
  saveEdgeInfoOnVertex(
      edge.getId(),
      edge.getVertexId(Direction.OUT),
      edge.getVertexId(Direction.IN),
      newEdgeLabel,
      edgeColumnVisibility
  );
}

相关文章