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

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

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

origin: org.gradoop/gradoop-flink

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

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

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

/**
 * {@inheritDoc}
 *
 * The factory is passed from {@link GradoopFlinkConfig} at the moment.
 */
@Override
public EPGMGraphHeadFactory<GraphHead> getGraphHeadFactory() {
 return config.getGraphHeadFactory();
}
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

@Override
public LogicalGraphLayout<GraphHead, Vertex, Edge> fromIndexedDataSets(
 Map<String, DataSet<Vertex>> vertices,
 Map<String, DataSet<Edge>> edges) {
 GraphHead graphHead = getConfig()
  .getGraphHeadFactory()
  .createGraphHead();
 DataSet<GraphHead> graphHeadSet = getConfig().getExecutionEnvironment()
  .fromElements(graphHead);
 Map<String, DataSet<GraphHead>> graphHeads = Maps.newHashMap();
 graphHeads.put(graphHead.getLabel(), graphHeadSet);
 // update vertices and edges with new graph head id
 vertices = vertices.entrySet().stream()
  .collect(Collectors.toMap(
   Map.Entry::getKey, e -> e.getValue().map(new AddToGraph<>(graphHead))
    .withForwardedFields("id;label;properties")));
 edges = edges.entrySet().stream()
  .collect(Collectors.toMap(
   Map.Entry::getKey, e -> e.getValue().map(new AddToGraph<>(graphHead))
    .withForwardedFields("id;sourceId;targetId;label;properties")));
 return create(graphHeads, vertices, edges);
}
origin: org.gradoop/gradoop-flink

/**
 * Creates a graph head dataset from a given collection.
 * Encapsulates the workaround for dataset creation from an empty collection.
 *
 * @param graphHeads  graph heads
 * @return graph head dataset
 */
protected DataSet<GraphHead> createGraphHeadDataSet(Collection<GraphHead> graphHeads) {
 ExecutionEnvironment env = getConfig().getExecutionEnvironment();
 DataSet<GraphHead> graphHeadSet;
 if (graphHeads.isEmpty()) {
  graphHeadSet = env
   .fromElements(getConfig().getGraphHeadFactory().createGraphHead())
   .filter(new False<>());
 } else {
  graphHeadSet =  env.fromCollection(graphHeads);
 }
 return graphHeadSet;
}
origin: dbs-leipzig/gradoop

/**
 * Creates a graph head dataset from a given collection.
 * Encapsulates the workaround for dataset creation from an empty collection.
 *
 * @param graphHeads  graph heads
 * @return graph head dataset
 */
protected DataSet<GraphHead> createGraphHeadDataSet(Collection<GraphHead> graphHeads) {
 ExecutionEnvironment env = getConfig().getExecutionEnvironment();
 DataSet<GraphHead> graphHeadSet;
 if (graphHeads.isEmpty()) {
  graphHeadSet = env
   .fromElements(getConfig().getGraphHeadFactory().createGraphHead())
   .filter(new False<>());
 } else {
  graphHeadSet =  env.fromCollection(graphHeads);
 }
 return graphHeadSet;
}
origin: org.gradoop/gradoop-flink

@Override
public GVELayout fromDataSets(DataSet<Vertex> vertices, DataSet<Edge> edges) {
 Objects.requireNonNull(vertices, "Vertex DataSet was null");
 Objects.requireNonNull(edges, "Edge DataSet was null");
 GraphHead graphHead = getConfig()
  .getGraphHeadFactory()
  .createGraphHead();
 DataSet<GraphHead> graphHeadSet = getConfig().getExecutionEnvironment()
  .fromElements(graphHead);
 // update vertices and edges with new graph head id
 vertices = vertices
  .map(new AddToGraph<>(graphHead))
  .withForwardedFields("id;label;properties");
 edges = edges
  .map(new AddToGraph<>(graphHead))
  .withForwardedFields("id;sourceId;targetId;label;properties");
 return new GVELayout(graphHeadSet, vertices, edges);
}
origin: dbs-leipzig/gradoop

@Override
public GVELayout fromDataSets(DataSet<Vertex> vertices, DataSet<Edge> edges) {
 Objects.requireNonNull(vertices, "Vertex DataSet was null");
 Objects.requireNonNull(edges, "Edge DataSet was null");
 GraphHead graphHead = getConfig()
  .getGraphHeadFactory()
  .createGraphHead();
 DataSet<GraphHead> graphHeadSet = getConfig().getExecutionEnvironment()
  .fromElements(graphHead);
 // update vertices and edges with new graph head id
 vertices = vertices
  .map(new AddToGraph<>(graphHead))
  .withForwardedFields("id;label;properties");
 edges = edges
  .map(new AddToGraph<>(graphHead))
  .withForwardedFields("id;sourceId;targetId;label;properties");
 return new GVELayout(graphHeadSet, 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: org.gradoop/gradoop-flink

/**
 * Returns a logical graph containing the complete vertex and edge space of
 * the database.
 *
 * @param withGraphContainment true, if vertices and edges shall be updated to
 *                             be contained in the logical graph representing
 *                             the database
 * @return logical graph of vertex and edge space
 */
public LogicalGraph getLogicalGraph(boolean withGraphContainment) {
 if (withGraphContainment) {
  return config.getLogicalGraphFactory().fromCollections(getVertices(), getEdges())
   .transformGraphHead(new RenameLabel<>(GradoopConstants.DEFAULT_GRAPH_LABEL,
    GradoopConstants.DB_GRAPH_LABEL));
 } else {
  GraphHead graphHead = config.getGraphHeadFactory()
   .createGraphHead(GradoopConstants.DB_GRAPH_LABEL);
  return config.getLogicalGraphFactory().fromCollections(graphHead, getVertices(), getEdges());
 }
}
origin: dbs-leipzig/gradoop

/**
 * Returns a logical graph containing the complete vertex and edge space of
 * the database.
 *
 * @param withGraphContainment true, if vertices and edges shall be updated to
 *                             be contained in the logical graph representing
 *                             the database
 * @return logical graph of vertex and edge space
 */
public LogicalGraph getLogicalGraph(boolean withGraphContainment) {
 if (withGraphContainment) {
  return config.getLogicalGraphFactory().fromCollections(getVertices(), getEdges())
   .transformGraphHead(new RenameLabel<>(GradoopConstants.DEFAULT_GRAPH_LABEL,
    GradoopConstants.DB_GRAPH_LABEL));
 } else {
  GraphHead graphHead = config.getGraphHeadFactory()
   .createGraphHead(GradoopConstants.DB_GRAPH_LABEL);
  return config.getLogicalGraphFactory().fromCollections(graphHead, getVertices(), getEdges());
 }
}
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: 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.utilGradoopFlinkConfiggetGraphHeadFactory

Popular methods of GradoopFlinkConfig

  • getGraphCollectionFactory
    Returns a factory that is able to create graph collection layouts.
  • getExecutionEnvironment
    Returns the Flink execution environment.
  • getVertexFactory
  • getEdgeFactory
  • getLogicalGraphFactory
    Returns a factory that is able to create logical graph layouts.
  • createConfig
    Creates a Gradoop Flink configuration using the given parameters.
  • <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

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
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