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

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

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

Edge.getLabel介绍

[英]The edge label.
[中]边缘标签。

代码示例

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

@Override
public String getLabel() {
  return getVertexiumElement().getLabel();
}

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

private String columnEdgeToString(VertexiumCypherQueryContext ctx, Edge edge) {
  StringBuilder result = new StringBuilder();
  result.append("[");
  result.append(":");
  result.append(edge.getLabel());
  if (count(edge.getProperties()) > 0) {
    result.append(" ");
    result.append(elementPropertiesToString(ctx, edge));
  }
  result.append("]");
  return result.toString();
}

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

private String columnEdgeToString(VertexiumCypherQueryContext ctx, Edge edge) {
  StringBuilder result = new StringBuilder();
  result.append("[");
  result.append(":");
  result.append(edge.getLabel());
  if (count(edge.getProperties()) > 0) {
    result.append(" ");
    result.append(elementPropertiesToString(ctx, edge));
  }
  result.append("]");
  return result.toString();
}

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

public static JSONObject toJsonEdge(Edge edge, String workspaceId) {
  try {
    JSONObject json = toJsonElement(edge, workspaceId);
    json.put("label", edge.getLabel());
    json.put("outVertexId", edge.getVertexId(Direction.OUT));
    json.put("inVertexId", edge.getVertexId(Direction.IN));
    return json;
  } catch (JSONException e) {
    throw new RuntimeException(e);
  }
}

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

private Iterable<Vertex> filterFindPathEdgePairs(FindPathOptions options, Iterable<EdgeVertexPair> edgeVertexPairs) {
  return stream(edgeVertexPairs)
      .filter(edgePair -> {
        if (options.getExcludedLabels() != null) {
          return !ArrayUtils.contains(options.getExcludedLabels(), edgePair.getEdge().getLabel());
        }
        return true;
      })
      .map(EdgeVertexPair::getVertex)
      .collect(Collectors.toList());
}

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

private Mutation createAlterEdgeLabelMutation(Edge edge, String newEdgeLabel, ColumnVisibility edgeColumnVisibility) {
  String edgeRowKey = edge.getId();
  Mutation m = new Mutation(edgeRowKey);
  m.putDelete(AccumuloEdge.CF_SIGNAL, new Text(edge.getLabel()), edgeColumnVisibility, currentTimeMillis());
  m.put(AccumuloEdge.CF_SIGNAL, new Text(newEdgeLabel), edgeColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
  return m;
}

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

private Mutation createAlterEdgeLabelMutation(Edge edge, String newEdgeLabel, ColumnVisibility edgeColumnVisibility) {
  String edgeRowKey = edge.getId();
  Mutation m = new Mutation(edgeRowKey);
  m.putDelete(AccumuloEdge.CF_SIGNAL, new Text(edge.getLabel()), edgeColumnVisibility, currentTimeMillis());
  m.put(AccumuloEdge.CF_SIGNAL, new Text(newEdgeLabel), edgeColumnVisibility, currentTimeMillis(), ElementMutationBuilder.EMPTY_VALUE);
  return m;
}

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

@Override
public String toString() {
  if (this instanceof Edge) {
    Edge edge = (Edge) this;
    return getId() + ":[" + edge.getVertexId(Direction.OUT) + "-" + edge.getLabel() + "->" + edge.getVertexId(Direction.IN) + "]";
  }
  return getId();
}

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

@Override
public String toString() {
  if (this instanceof Edge) {
    Edge edge = (Edge) this;
    return getId() + ":[" + edge.getVertexId(Direction.OUT) + "-" + edge.getLabel() + "->" + edge.getVertexId(Direction.IN) + "]";
  }
  return getId();
}

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

@Override
public String toString() {
  if (this instanceof Edge) {
    Edge edge = (Edge) this;
    return getId() + ":[" + edge.getVertexId(Direction.OUT) + "-" + edge.getLabel() + "->" + edge.getVertexId(Direction.IN) + "]";
  }
  return getId();
}

代码示例来源: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

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

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

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

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

public static void populateClientApiEdge(ClientApiEdge e, Edge edge, String workspaceId) {
  e.setLabel(edge.getLabel());
  e.setOutVertexId(edge.getVertexId(Direction.OUT));
  e.setInVertexId(edge.getVertexId(Direction.IN));
  populateClientApiElement(e, edge, workspaceId);
}

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

public EdgeBuilderByVertexId prepareEdge(Edge edge) {
  return prepareEdge(
      edge.getId(),
      edge.getVertexId(Direction.OUT),
      edge.getVertexId(Direction.IN),
      edge.getLabel(),
      edge.getTimestamp(),
      edge.getVisibility()
  );
}

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

public EdgeBuilderByVertexId prepareEdge(Edge edge) {
  return prepareEdge(
      edge.getId(),
      edge.getVertexId(Direction.OUT),
      edge.getVertexId(Direction.IN),
      edge.getLabel(),
      edge.getTimestamp(),
      edge.getVisibility()
  );
}

代码示例来源: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: org.vertexium/vertexium-accumulo

public boolean alterEdgeVertexInVertex(Mutation vertexInMutation, 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.OUT));
  vertexInMutation.putDelete(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), currentColumnVisibility);
  vertexInMutation.put(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
  return true;
}

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

public boolean alterEdgeVertexInVertex(Mutation vertexInMutation, 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.OUT));
  vertexInMutation.putDelete(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), currentColumnVisibility);
  vertexInMutation.put(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
  return true;
}

相关文章