org.gradoop.common.model.impl.pojo.Vertex.setLabel()方法的使用及代码示例

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

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

Vertex.setLabel介绍

暂无

代码示例

代码示例来源:origin: dbs-leipzig/gradoop

@Override
 public GraphTransaction map(GraphTransaction graphTransaction)
   throws Exception {
  String label;
  for (Vertex vertex : graphTransaction.getVertices()) {
   label = vertexDictionary.get(Integer.parseInt(vertex.getLabel()));
   if (label != null) {
    vertex.setLabel(label);
   } else {
    vertex.setLabel(vertex.getLabel() + TLFConstants.EMPTY_LABEL);
   }
  }
  return graphTransaction;
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
  * {@inheritDoc}
  */
 @Override
 public GraphTransaction map(GraphTransaction graphTransaction)
   throws Exception {
  String label;
  for (Vertex vertex : graphTransaction.getVertices()) {
   label = vertexDictionary.get(Integer.parseInt(vertex.getLabel()));
   if (label != null) {
    vertex.setLabel(label);
   } else {
    vertex.setLabel(vertex.getLabel() + TLFConstants.EMPTY_LABEL);
   }
  }
  return graphTransaction;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Initializes an EPGM vertex using the specified parameters and adds its label
 * if the given vertex was created for the return pattern.
 *
 * @param out flat map collector
 * @param graphHead graph head to assign vertex to
 * @param vertexId vertex identifier
 * @param label label associated with vertex
 */
private void initVertexWithData(Collector<Element> out, GraphHead graphHead, GradoopId vertexId,
                String label) {
 if (!processedIds.contains(vertexId)) {
  Vertex v = vertexFactory.initVertex(vertexId);
  v.addGraphId(graphHead.getId());
  v.setLabel(label);
  out.collect(v);
  processedIds.add(vertexId);
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Initializes an EPGM vertex using the specified parameters and adds its label
 * if the given vertex was created for the return pattern.
 *
 * @param out flat map collector
 * @param graphHead graph head to assign vertex to
 * @param vertexId vertex identifier
 * @param label label associated with vertex
 */
private void initVertexWithData(Collector<Element> out, GraphHead graphHead, GradoopId vertexId,
                String label) {
 if (!processedIds.contains(vertexId)) {
  Vertex v = vertexFactory.initVertex(vertexId);
  v.addGraphId(graphHead.getId());
  v.setLabel(label);
  out.collect(v);
  processedIds.add(vertexId);
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
  * Removes the dictionary labels and sets the simple labels (integer).
  *
  * @param graphTransaction graph transaction with label format:
  *                         'dictionarylabel'
  * @return graph transaction with label format: 'simpleLabel' (Integer)
  * @throws Exception
  */
 @Override
 public GraphTransaction map(GraphTransaction graphTransaction)
   throws Exception {
  if (vertexDictionary != null) {
   for (Vertex vertex : graphTransaction.getVertices()) {
    vertex.setLabel(vertexDictionary.get(vertex.getLabel()).toString());
   }
  }
  if (edgeDictionary != null) {
   for (Edge edge : graphTransaction.getEdges()) {
    edge.setLabel(edgeDictionary.get(edge.getLabel()).toString());
   }
  }
  return graphTransaction;
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
  * Removes the dictionary labels and sets the simple labels (integer).
  *
  * @param graphTransaction graph transaction with label format:
  *                         'dictionarylabel'
  * @return graph transaction with label format: 'simpleLabel' (Integer)
  * @throws Exception
  */
 @Override
 public GraphTransaction map(GraphTransaction graphTransaction)
   throws Exception {
  if (vertexDictionary != null) {
   for (Vertex vertex : graphTransaction.getVertices()) {
    vertex.setLabel(vertexDictionary.get(vertex.getLabel()).toString());
   }
  }
  if (edgeDictionary != null) {
   for (Edge edge : graphTransaction.getEdges()) {
    edge.setLabel(edgeDictionary.get(edge.getLabel()).toString());
   }
  }
  return graphTransaction;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Relabel vertices and to drop properties.
 *
 * @param current current vertex
 * @param transformed copy of current except label and properties
 * @return current vertex with a new label depending on its type
 */
private static Vertex relabelVerticesAndRemoveProperties(Vertex current,
 Vertex transformed) {
 String label;
 if (current
  .getPropertyValue(BusinessTransactionGraphs.SUPERTYPE_KEY).getString()
  .equals(BusinessTransactionGraphs.SUPERCLASS_VALUE_TRANSACTIONAL)) {
  label = TRANSACTIONAL_PREFIX + current.getLabel();
 } else {
  label = MASTER_PREFIX + current.getPropertyValue(SOURCEID_KEY).toString();
 }
 transformed.setLabel(label);
 return transformed;
}

代码示例来源:origin: org.gradoop/gradoop-flink

@Override
 public Vertex cross(GraphHead searchGraphHead, GraphHead patternGraphSeachHead) throws Exception {
  REUSABLE_VERTEX.setLabel(patternGraphSeachHead.getLabel());
  REUSABLE_VERTEX.setProperties(patternGraphSeachHead.getProperties());
  REUSABLE_VERTEX.setId(newVertexId);
  REUSABLE_VERTEX.addGraphId(searchGraphHead.getId());
  return REUSABLE_VERTEX;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

@Override
 public Vertex cross(GraphHead searchGraphHead, GraphHead patternGraphSeachHead) throws Exception {
  REUSABLE_VERTEX.setLabel(patternGraphSeachHead.getLabel());
  REUSABLE_VERTEX.setProperties(patternGraphSeachHead.getProperties());
  REUSABLE_VERTEX.setId(newVertexId);
  REUSABLE_VERTEX.addGraphId(searchGraphHead.getId());
  return REUSABLE_VERTEX;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

@Override
 public Tuple2<Vertex, GradoopId> map(GraphHead hid) throws Exception {
  reusable.f0.setId(GradoopId.get());
  reusable.f0.setLabel(hid.getLabel());
  reusable.f0.setProperties(hid.getProperties());
  reusable.f1 = hid.getId();
  return reusable;
 }
}

代码示例来源:origin: org.gradoop/gradoop-flink

@Override
 public Tuple2<Vertex, GradoopId> map(GraphHead hid) throws Exception {
  reusable.f0.setId(GradoopId.get());
  reusable.f0.setLabel(hid.getLabel());
  reusable.f0.setProperties(hid.getProperties());
  reusable.f1 = hid.getId();
  return reusable;
 }
}

代码示例来源:origin: dbs-leipzig/gradoop

row.setLabel(value.toString());
 break;
case AccumuloTables.KEY.PROPERTY:

代码示例来源:origin: dbs-leipzig/gradoop

/**
 * Creates a {@link Vertex} object from the given {@link VertexGroupItem}
 * and returns a new {@link org.apache.flink.graph.Vertex}.
 *
 * @param groupItem vertex group item
 * @return vertex including new vertex data
 * @throws Exception on failure
 */
@Override
public Vertex map(VertexGroupItem groupItem) throws
 Exception {
 Vertex supVertex = vertexFactory.initVertex(groupItem.getSuperVertexId());
 supVertex.setLabel(groupItem.getGroupLabel());
 setGroupProperties(supVertex, groupItem.getGroupingValues(), groupItem.getLabelGroup());
 setAggregateProperties(
  supVertex,
  groupItem.getAggregateValues(),
  groupItem.getLabelGroup().getAggregateFunctions());
 return supVertex;
}

代码示例来源:origin: dbs-leipzig/gradoop

static Vertex transformVertex(Vertex current, Vertex transformed) {
 transformed.setLabel(current.getLabel());
 if (current.getLabel().equals("A")) {
  transformed.setProperty("a", current.getPropertyValue("a").getInt() + 1);
  transformed.setProperty("b", current.getPropertyValue("b").getInt() - 1);
 } else if (current.getLabel().equals("B")) {
  transformed.setProperty("d", current.getPropertyValue("c"));
 }
 return transformed;
}

代码示例来源:origin: org.gradoop/gradoop-flink

/**
 * Creates a {@link Vertex} object from the given {@link VertexGroupItem}
 * and returns a new {@link org.apache.flink.graph.Vertex}.
 *
 * @param groupItem vertex group item
 * @return vertex including new vertex data
 * @throws Exception on failure
 */
@Override
public Vertex map(VertexGroupItem groupItem) throws
 Exception {
 Vertex supVertex = vertexFactory.initVertex(groupItem.getSuperVertexId());
 supVertex.setLabel(groupItem.getGroupLabel());
 setGroupProperties(supVertex, groupItem.getGroupingValues(), groupItem.getLabelGroup());
 setAggregateProperties(
  supVertex,
  groupItem.getAggregateValues(),
  groupItem.getLabelGroup().getAggregateFunctions());
 return supVertex;
}

代码示例来源:origin: dbs-leipzig/gradoop

current.setLabel(current.getPropertyValue("decade").toString());
 return current;
});

代码示例来源:origin: dbs-leipzig/gradoop

transformed.setLabel("Node");
 return transformed;
});

代码示例来源:origin: dbs-leipzig/gradoop

transformed.setLabel(current.getLabel());
transformed.setProperty(city, current.getPropertyValue(city));
transformed.setProperty(gender, current.getPropertyValue(gender));

代码示例来源:origin: dbs-leipzig/gradoop

copy.setLabel(vertex.getLabel());
} else { // master data
 copy.setLabel(vertex.getPropertyValue(SOURCEID_KEY).toString());

相关文章