Edge.getLabel
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.gradoop.common.model.impl.pojo.Edge.getLabel(Showing top 15 results out of 315)

origin: dbs-leipzig/gradoop

 @Override
 public IdWithLabel map(E edge) throws Exception {
  reuseTuple.setId(edge.getTargetId());
  reuseTuple.setLabel(edge.getLabel());
  return reuseTuple;
 }
}
origin: dbs-leipzig/gradoop

/**
 * Drop edge properties.
 *
 * @param current current edge
 * @param transformed copy of current except label and properties
 * @return current edge without properties
 */
private static Edge dropEdgeProperties(Edge current, Edge transformed) {
 transformed.setLabel(current.getLabel());
 return transformed;
}
origin: dbs-leipzig/gradoop

@Test
public void getEdgesByLabel() throws Exception {
 TxCollectionLayout layout = new TxCollectionLayout(
  getExecutionEnvironment().fromElements(tx0, tx1));
 GradoopTestUtils.validateEPGMGraphElementCollections(
  tx0.getEdges().stream().filter(e -> e.getLabel().equals("a")).collect(Collectors.toList()),
  layout.getEdgesByLabel("a").collect());
}
origin: dbs-leipzig/gradoop

 @Override
 public CSVEdge map(Edge edge) throws Exception {
  csvEdge.setId(edge.getId().toString());
  csvEdge.setSourceId(edge.getSourceId().toString());
  csvEdge.setTargetId(edge.getTargetId().toString());
  csvEdge.setLabel(edge.getLabel());
  csvEdge.setProperties(getPropertyString(edge));
  return csvEdge;
 }
}
origin: dbs-leipzig/gradoop

 @Override
 public void join(Edge edge, Vertex vertex, Collector<Edge> collector) throws Exception {
  if (vertex == null) {
   collector.collect(edge);
  } else if (edge != null) {
   REUSABLE_EDGE.setId(GradoopId.get());
   REUSABLE_EDGE.setSourceId(isSourceNow ? vId : edge.getSourceId());
   REUSABLE_EDGE.setTargetId(isSourceNow ? edge.getTargetId() : vId);
   REUSABLE_EDGE.setProperties(edge.getProperties());
   REUSABLE_EDGE.setLabel(edge.getLabel());
   REUSABLE_EDGE.setGraphIds(edge.getGraphIds());
   collector.collect(REUSABLE_EDGE);
  }
 }
}
origin: dbs-leipzig/gradoop

@Test
public void testEdgeInducedSubgraph() throws Exception {
 FlinkAsciiGraphLoader loader = getSocialNetworkLoader();
 loader.appendToDatabaseFromString("expected[" +
  "(databases)<-[ghtd]-(gdbs)-[ghtg1]->(graphs)" +
  "(graphs)<-[ghtg2]-(gps)-[ghth]->(hadoop)" +
  "]");
 LogicalGraph input = loader.getDatabase().getDatabaseGraph();
 LogicalGraph expected = loader.getLogicalGraphByVariable("expected");
 LogicalGraph output = input.edgeInducedSubgraph(
  e -> e.getLabel().equals("hasTag"));
 collectAndAssertTrue(output.equalsByElementData(expected));
}
origin: dbs-leipzig/gradoop

@Test
public void testGetEdges() throws Exception {
 AsciiGraphLoader<GraphHead, Vertex, Edge> asciiGraphLoader =
  AsciiGraphLoader.fromString("[()-->()]", config);
 validateCollections(asciiGraphLoader, 1, 2, 1);
 validateCaches(asciiGraphLoader, 0, 0, 0);
 for (Edge edge : asciiGraphLoader.getEdges()) {
  assertEquals("Edge has wrong label",
   GradoopConstants.DEFAULT_EDGE_LABEL, edge.getLabel());
 }
}
origin: dbs-leipzig/gradoop

/**
 * Extracts a subgraph which is empty.
 *
 * @throws Exception
 */
@Test
public void testEmptySubgraph() throws Exception {
 FlinkAsciiGraphLoader loader = getSocialNetworkLoader();
 loader.appendToDatabaseFromString("expected[]");
 LogicalGraph input = loader.getDatabase().getDatabaseGraph();
 LogicalGraph expected = loader.getLogicalGraphByVariable("expected");
 LogicalGraph output = input.subgraph(
  v -> v.getLabel().equals("User"),
  e -> e.getLabel().equals("friendOf"));
 collectAndAssertTrue(output.equalsByElementData(expected));
}
origin: dbs-leipzig/gradoop

 @Override
 public LabeledGraphStringString map(GraphTransaction transaction) throws Exception {

  LabeledGraphStringString outGraph = LabeledGraphStringString.getEmptyOne();

  Map<String, Integer> labelMap = Maps.newHashMap();
  Map<GradoopId, Integer> vertexIdMap = Maps.newHashMap();

  for (Vertex vertex : transaction.getVertices()) {
   vertexIdMap.put(vertex.getId(), outGraph.addVertex(vertex.getLabel()));
  }

  labelMap.clear();

  for (Edge edge : transaction.getEdges()) {
   int sourceId = vertexIdMap.get(edge.getSourceId());
   int targetId = vertexIdMap.get(edge.getTargetId());
   outGraph.addEdge(sourceId, edge.getLabel(), targetId);
  }

  return outGraph;
 }
}
origin: dbs-leipzig/gradoop

/**
 * The actual computation.
 *
 * @param socialNetwork social network graph
 * @return summarized, aggregated graph
 */
private static LogicalGraph execute(LogicalGraph socialNetwork) {
 return socialNetwork
  .subgraph(
   vertex -> vertex.getLabel().equals("Person"),
   edge -> edge.getLabel().equals("knows"))
  .groupBy(Arrays.asList("gender", "city"))
  .aggregate(new VertexCount())
  .aggregate(new EdgeCount());
}
origin: dbs-leipzig/gradoop

 @Override
 public void flatMap(GraphTransaction graph,
  Collector<WithCount<String>> out) throws Exception {

  Set<String> edgeLabels = Sets.newHashSet();

  for (Edge edge : graph.getEdges()) {
   edgeLabels.add(edge.getLabel());
  }

  for (String label : edgeLabels) {
   reuseTuple.setObject(label);
   out.collect(reuseTuple);
  }
 }
}
origin: dbs-leipzig/gradoop

/**
 * Returns set of all edges with the given label.
 *
 * @param transaction the graph transaction containing the edges
 * @param label the label to be searched on
 * @return set of edges with the given label
 */
private Set<Edge> getEdgesByLabel(GraphTransaction transaction, String label) {
 Set<Edge> edges = Sets.newHashSet();
 for (Edge edge : transaction.getEdges()) {
  if (edge.getLabel().equals(label)) {
   edges.add(edge);
  }
 }
 return edges;
}
origin: dbs-leipzig/gradoop

@Override
public PropertyValue getEdgeIncrement(Edge edge) {
 return PropertyValue.create(edge.getLabel().equals(label));
}
origin: dbs-leipzig/gradoop

 @Override
 public IdWithLabel map(E edge) throws Exception {
  reuseTuple.setId(edge.getSourceId());
  reuseTuple.setLabel(edge.getLabel());
  return reuseTuple;
 }
}
origin: dbs-leipzig/gradoop

 @Override
 public void flatMap(GraphTransaction graphTransaction, Collector<String> collector)
  throws Exception {
  for (Edge edge : graphTransaction.getEdges()) {
   collector.collect(edge.getLabel());
  }
 }
}
org.gradoop.common.model.impl.pojoEdgegetLabel

Popular methods of Edge

  • <init>
    Creates an edge instance based on the given parameters.
  • getId
  • getSourceId
  • getTargetId
  • addGraphId
  • getGraphCount
  • getGraphIds
  • getPropertyValue
  • setLabel
  • getProperties
  • setGraphIds
  • setId
  • setGraphIds,
  • setId,
  • setProperties,
  • setProperty,
  • setSourceId,
  • setTargetId

Popular classes and methods

  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java virtua
  • GridBagLayout (java.awt)
  • Proxy (java.net)
    This class represents a proxy setting, typically a type (http, socks) and a socket address. A Proxy
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • HashSet (java.util)
    This class implements the Set interface, backed by a java.util.HashMap.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JButton (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)