Tabnine Logo
GradoopFlinkConfig.getEdgeFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
getEdgeFactory
method
in
org.gradoop.flink.util.GradoopFlinkConfig

Best Java code snippets using org.gradoop.flink.util.GradoopFlinkConfig.getEdgeFactory (Showing top 20 results out of 315)

origin: dbs-leipzig/gradoop

/**
 * {@inheritDoc}
 *
 * The factory is passed from {@link GradoopFlinkConfig} at the moment.
 */
@Override
public EPGMEdgeFactory<Edge> getEdgeFactory() {
 return config.getEdgeFactory();
}
origin: org.gradoop/gradoop-flink

/**
 * {@inheritDoc}
 *
 * The factory is passed from {@link GradoopFlinkConfig} at the moment.
 */
@Override
public EPGMEdgeFactory<Edge> getEdgeFactory() {
 return config.getEdgeFactory();
}
origin: org.gradoop/gradoop-flink

/**
 * {@inheritDoc}
 *
 * The factory is passed from {@link GradoopFlinkConfig} at the moment.
 */
@Override
public EPGMEdgeFactory<Edge> getEdgeFactory() {
 return config.getEdgeFactory();
}
origin: dbs-leipzig/gradoop

/**
 * {@inheritDoc}
 *
 * The factory is passed from {@link GradoopFlinkConfig} at the moment.
 */
@Override
public EPGMEdgeFactory<Edge> getEdgeFactory() {
 return config.getEdgeFactory();
}
origin: org.gradoop/gradoop-flink

/**
 * Constructor.
 *
 * @param config Gradoop configuration
 */
public SubgraphDecoder(GradoopFlinkConfig config) {
 vertexFactory = config.getVertexFactory();
 graphHeadFactory = config.getGraphHeadFactory();
 edgeFactory = config.getEdgeFactory();
}
origin: org.gradoop/gradoop-flink

/**
 * Valued constructor.
 *
 * @param config gradoop flink config
 */
public GraphTransactionFromText(GradoopFlinkConfig config) {
 this.graphHeadFactory = config.getGraphHeadFactory();
 this.vertexFactory = config.getVertexFactory();
 this.edgeFactory = config.getEdgeFactory();
}
origin: dbs-leipzig/gradoop

/**
 * Valued constructor.
 *
 * @param config gradoop flink config
 */
public GraphTransactionFromText(GradoopFlinkConfig config) {
 this.graphHeadFactory = config.getGraphHeadFactory();
 this.vertexFactory = config.getVertexFactory();
 this.edgeFactory = config.getEdgeFactory();
}
origin: dbs-leipzig/gradoop

/**
 * Constructor.
 *
 * @param config Gradoop configuration
 */
public SubgraphDecoder(GradoopFlinkConfig config) {
 vertexFactory = config.getVertexFactory();
 graphHeadFactory = config.getGraphHeadFactory();
 edgeFactory = config.getEdgeFactory();
}
origin: org.gradoop/gradoop-flink

 /**
  * Creates an edge dataset from a given collection.
  * Encapsulates the workaround for dataset creation from an empty collection.
  *
  * @param edges edge collection
  * @return edge dataset
  */
 protected DataSet<Edge> createEdgeDataSet(Collection<Edge> edges) {
  ExecutionEnvironment env = getConfig().getExecutionEnvironment();

  DataSet<Edge> edgeSet;
  if (edges.isEmpty()) {
   GradoopId dummyId = GradoopId.get();
   edgeSet = env
    .fromElements(getConfig().getEdgeFactory().createEdge(dummyId, dummyId))
    .filter(new False<>());
  } else {
   edgeSet = env.fromCollection(edges);
  }
  return edgeSet;
 }
}
origin: org.gradoop/gradoop-flink

@Override
public LogicalGraph getLogicalGraph() throws IOException {
 MetaData metaData = MetaData.fromFile(getMetaDataPath(), hdfsConfig);
 ExecutionEnvironment env = getConfig().getExecutionEnvironment();
 VertexFactory vertexFactory = getConfig().getVertexFactory();
 EdgeFactory edgeFactory = getConfig().getEdgeFactory();
 Map<String, DataSet<Vertex>> vertices = metaData.getVertexLabels().stream()
  .map(l -> Tuple2.of(l, env.readTextFile(getVertexCSVPath(l))
   .map(new CSVLineToVertex(vertexFactory))
   .withBroadcastSet(MetaData.fromFile(getMetaDataPath(), getConfig()), BC_METADATA)))
  .collect(Collectors.toMap(t -> t.f0, t -> t.f1));
 Map<String, DataSet<Edge>> edges = metaData.getEdgeLabels().stream()
  .map(l -> Tuple2.of(l, env.readTextFile(getEdgeCSVPath(l))
   .map(new CSVLineToEdge(edgeFactory))
   .withBroadcastSet(MetaData.fromFile(getMetaDataPath(), getConfig()), BC_METADATA)))
  .collect(Collectors.toMap(t -> t.f0, t -> t.f1));
 return getConfig().getLogicalGraphFactory().fromIndexedDataSets(vertices, edges);
}
origin: dbs-leipzig/gradoop

@Override
public LogicalGraph getLogicalGraph() throws IOException {
 MetaData metaData = MetaData.fromFile(getMetaDataPath(), hdfsConfig);
 ExecutionEnvironment env = getConfig().getExecutionEnvironment();
 VertexFactory vertexFactory = getConfig().getVertexFactory();
 EdgeFactory edgeFactory = getConfig().getEdgeFactory();
 Map<String, DataSet<Vertex>> vertices = metaData.getVertexLabels().stream()
  .map(l -> Tuple2.of(l, env.readTextFile(getVertexCSVPath(l))
   .map(new CSVLineToVertex(vertexFactory))
   .withBroadcastSet(MetaData.fromFile(getMetaDataPath(), getConfig()), BC_METADATA)))
  .collect(Collectors.toMap(t -> t.f0, t -> t.f1));
 Map<String, DataSet<Edge>> edges = metaData.getEdgeLabels().stream()
  .map(l -> Tuple2.of(l, env.readTextFile(getEdgeCSVPath(l))
   .map(new CSVLineToEdge(edgeFactory))
   .withBroadcastSet(MetaData.fromFile(getMetaDataPath(), getConfig()), BC_METADATA)))
  .collect(Collectors.toMap(t -> t.f0, t -> t.f1));
 return getConfig().getLogicalGraphFactory().fromIndexedDataSets(vertices, edges);
}
origin: org.gradoop/gradoop-flink

/**
 * Extracts a {@link GraphCollection} from a set of {@link Element}.
 *
 * @param elements  EPGM elements
 * @param config        Gradoop Flink config
 * @param mayOverlap    elements may be contained in multiple graphs
 * @return Graph collection
 */
@SuppressWarnings("unchecked")
public static GraphCollection extractGraphCollection(
 DataSet<Element> elements, GradoopFlinkConfig config, boolean mayOverlap) {
 Class<GraphHead> graphHeadType = config.getGraphHeadFactory().getType();
 Class<Vertex> vertexType = config.getVertexFactory().getType();
 Class<Edge> edgeType = config.getEdgeFactory().getType();
 return config.getGraphCollectionFactory().fromDataSets(
  extractGraphHeads(elements, graphHeadType),
  extractVertices(elements, vertexType, mayOverlap),
  extractEdges(elements, edgeType, mayOverlap)
 );
}
origin: dbs-leipzig/gradoop

 /**
  * Extracts vertices and edges from the query result and constructs a
  * maximum match graph.
  *
  * @param graph    input graph
  * @param vertices valid vertices after simulation
  * @return maximum match graph
  */
 private GraphCollection postProcess(LogicalGraph graph,
  DataSet<FatVertex> vertices) {
  GradoopFlinkConfig config = graph.getConfig();

  DataSet<Vertex> matchVertices = doAttachData() ?
   PostProcessor.extractVerticesWithData(vertices, graph.getVertices()) :
   PostProcessor.extractVertices(vertices, config.getVertexFactory());

  DataSet<Edge> matchEdges = doAttachData() ?
   PostProcessor.extractEdgesWithData(vertices, graph.getEdges()) :
   PostProcessor.extractEdges(vertices, config.getEdgeFactory());

  return config.getGraphCollectionFactory().fromGraph(
   config.getLogicalGraphFactory().fromDataSets(matchVertices, matchEdges));
 }
}
origin: org.gradoop/gradoop-flink

/**
 * Extracts vertices and edges from the query result and constructs a
 * maximum match graph.
 *
 * @param graph    input graph
 * @param vertices valid vertices after simulation
 * @return maximum match graph
 */
private GraphCollection postProcess(LogicalGraph graph,
 DataSet<FatVertex> vertices) {
 GradoopFlinkConfig config = graph.getConfig();
 DataSet<Vertex> matchVertices = doAttachData() ?
  PostProcessor.extractVerticesWithData(vertices, graph.getVertices()) :
  PostProcessor.extractVertices(vertices, config.getVertexFactory());
 DataSet<Edge> matchEdges = doAttachData() ?
  PostProcessor.extractEdgesWithData(vertices, graph.getEdges()) :
  PostProcessor.extractEdges(vertices, config.getEdgeFactory());
 return config.getGraphCollectionFactory().fromGraph(
  config.getLogicalGraphFactory().fromDataSets(matchVertices, matchEdges));
}
origin: dbs-leipzig/gradoop

@BeforeClass
public static void setup() {
 ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
 GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(env);
 GraphHead g0 = config.getGraphHeadFactory().createGraphHead("A");
 GraphHead g1 = config.getGraphHeadFactory().createGraphHead("B");
 Vertex v0 = config.getVertexFactory().createVertex("A");
 Vertex v1 = config.getVertexFactory().createVertex("B");
 Vertex v2 = config.getVertexFactory().createVertex("C");
 Edge e0 = config.getEdgeFactory().createEdge("a", v0.getId(), v1.getId());
 Edge e1 = config.getEdgeFactory().createEdge("b", v1.getId(), v2.getId());
 v0.addGraphId(g0.getId());
 v1.addGraphId(g0.getId());
 v1.addGraphId(g1.getId());
 v2.addGraphId(g1.getId());
 e0.addGraphId(g0.getId());
 e1.addGraphId(g1.getId());
 tx0 = new GraphTransaction(g0, Sets.newHashSet(v0, v1), Sets.newHashSet(e0));
 tx1 = new GraphTransaction(g1, Sets.newHashSet(v1, v2), Sets.newHashSet(e1));
}
origin: org.gradoop/gradoop-flink

@Override
public LogicalGraph getLogicalGraph() {
 DataSet<Tuple3<String, String, String>> metaData =
  MetaData.fromFile(getMetaDataPath(), getConfig());
 DataSet<Vertex> vertices = getConfig().getExecutionEnvironment()
  .readTextFile(getVertexCSVPath())
  .map(new CSVLineToVertex(getConfig().getVertexFactory()))
  .withBroadcastSet(metaData, BC_METADATA);
 DataSet<Edge> edges = getConfig().getExecutionEnvironment()
  .readTextFile(getEdgeCSVPath())
  .map(new CSVLineToEdge(getConfig().getEdgeFactory()))
  .withBroadcastSet(metaData, BC_METADATA);
 return getConfig().getLogicalGraphFactory().fromDataSets(vertices, edges);
}
origin: dbs-leipzig/gradoop

@Override
public LogicalGraph getLogicalGraph() {
 DataSet<Tuple3<String, String, String>> metaData =
  MetaData.fromFile(getMetaDataPath(), getConfig());
 DataSet<Vertex> vertices = getConfig().getExecutionEnvironment()
  .readTextFile(getVertexCSVPath())
  .map(new CSVLineToVertex(getConfig().getVertexFactory()))
  .withBroadcastSet(metaData, BC_METADATA);
 DataSet<Edge> edges = getConfig().getExecutionEnvironment()
  .readTextFile(getEdgeCSVPath())
  .map(new CSVLineToEdge(getConfig().getEdgeFactory()))
  .withBroadcastSet(metaData, BC_METADATA);
 return getConfig().getLogicalGraphFactory().fromDataSets(vertices, edges);
}
origin: dbs-leipzig/gradoop

@BeforeClass
public static void setup() {
 ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
 GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(env);
 g0 = config.getGraphHeadFactory().createGraphHead("A");
 g1 = config.getGraphHeadFactory().createGraphHead("B");
 v0 = config.getVertexFactory().createVertex("A");
 v1 = config.getVertexFactory().createVertex("B");
 v2 = config.getVertexFactory().createVertex("C");
 e0 = config.getEdgeFactory().createEdge("a", v0.getId(), v1.getId());
 e1 = config.getEdgeFactory().createEdge("b", v1.getId(), v2.getId());
 v0.addGraphId(g0.getId());
 v1.addGraphId(g0.getId());
 v1.addGraphId(g1.getId());
 v2.addGraphId(g1.getId());
 e0.addGraphId(g0.getId());
 e1.addGraphId(g1.getId());
}
origin: org.gradoop/gradoop-flink

 @Override
 public GraphCollection getGraphCollection() {
  DataSet<Tuple3<String, String, String>> metaData =
   new CSVMetaDataSource().readDistributed(getMetaDataPath(), getConfig());

  DataSet<GraphHead> graphHeads = getConfig().getExecutionEnvironment()
   .readTextFile(getGraphHeadCSVPath())
   .map(new CSVLineToGraphHead(getConfig().getGraphHeadFactory()))
   .withBroadcastSet(metaData, BC_METADATA);

  DataSet<Vertex> vertices = getConfig().getExecutionEnvironment()
   .readTextFile(getVertexCSVPath())
   .map(new CSVLineToVertex(getConfig().getVertexFactory()))
   .withBroadcastSet(metaData, BC_METADATA);

  DataSet<Edge> edges = getConfig().getExecutionEnvironment()
   .readTextFile(getEdgeCSVPath())
   .map(new CSVLineToEdge(getConfig().getEdgeFactory()))
   .withBroadcastSet(metaData, BC_METADATA);


  return getConfig().getGraphCollectionFactory().fromDataSets(graphHeads, vertices, edges);
 }
}
origin: dbs-leipzig/gradoop

 @Override
 public GraphCollection getGraphCollection() {
  DataSet<Tuple3<String, String, String>> metaData =
   new CSVMetaDataSource().readDistributed(getMetaDataPath(), getConfig());

  DataSet<GraphHead> graphHeads = getConfig().getExecutionEnvironment()
   .readTextFile(getGraphHeadCSVPath())
   .map(new CSVLineToGraphHead(getConfig().getGraphHeadFactory()))
   .withBroadcastSet(metaData, BC_METADATA);

  DataSet<Vertex> vertices = getConfig().getExecutionEnvironment()
   .readTextFile(getVertexCSVPath())
   .map(new CSVLineToVertex(getConfig().getVertexFactory()))
   .withBroadcastSet(metaData, BC_METADATA);

  DataSet<Edge> edges = getConfig().getExecutionEnvironment()
   .readTextFile(getEdgeCSVPath())
   .map(new CSVLineToEdge(getConfig().getEdgeFactory()))
   .withBroadcastSet(metaData, BC_METADATA);


  return getConfig().getGraphCollectionFactory().fromDataSets(graphHeads, vertices, edges);
 }
}
org.gradoop.flink.utilGradoopFlinkConfiggetEdgeFactory

Popular methods of GradoopFlinkConfig

  • getGraphCollectionFactory
    Returns a factory that is able to create graph collection layouts.
  • getExecutionEnvironment
    Returns the Flink execution environment.
  • getVertexFactory
  • getLogicalGraphFactory
    Returns a factory that is able to create logical graph layouts.
  • createConfig
    Creates a Gradoop Flink configuration using the given parameters.
  • getGraphHeadFactory
  • <init>
    Creates a new Configuration.
  • setGraphCollectionLayoutFactory
    Sets the layout factory for building layouts that represent a GraphCollection.
  • setLogicalGraphLayoutFactory
    Sets the layout factory for building layouts that represent a LogicalGraph.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now