Tabnine Logo
GraphCollectionFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
GraphCollectionFactory
in
org.gradoop.flink.model.impl.epgm

Best Java code snippets using org.gradoop.flink.model.impl.epgm.GraphCollectionFactory (Showing top 20 results out of 315)

origin: org.gradoop/gradoop-flink

@Override
public DataSet<Boolean> execute(LogicalGraph firstGraph, LogicalGraph secondGraph) {
 GraphCollectionFactory collectionFactory = firstGraph.getConfig()
  .getGraphCollectionFactory();
 return collectionEquality
  .execute(collectionFactory.fromGraph(firstGraph), collectionFactory.fromGraph(secondGraph));
}
origin: dbs-leipzig/gradoop

@Test
public void testEmptyFromGraphsMethod() throws Exception {
 GraphCollection expected = factory.createEmptyCollection();
 GraphCollection result = factory.fromGraphs();
 collectAndAssertTrue(result.equalsByGraphElementData(expected));
}
origin: dbs-leipzig/gradoop

/**
 * Builds a {@link GraphCollection} from the graph referenced by the given
 * graph variables.
 *
 * @param variables graph variables used in GDL script
 * @return GraphCollection
 */
public GraphCollection getGraphCollectionByVariables(String... variables) {
 Collection<GraphHead> graphHeads = getGraphHeadsByVariables(variables);
 Collection<Vertex> vertices = getVerticesByGraphVariables(variables);
 Collection<Edge> edges = getEdgesByGraphVariables(variables);
 return config.getGraphCollectionFactory().fromCollections(graphHeads, vertices, edges);
}
origin: org.gradoop/gradoop-flink

@Override
public GraphCollection fromGraphs(LogicalGraph... logicalGraphLayouts) {
 if (logicalGraphLayouts.length != 0) {
  DataSet<GraphHead> graphHeads = null;
  DataSet<Vertex> vertices = null;
  DataSet<Edge> edges = null;
  if (logicalGraphLayouts.length == 1) {
   return fromGraph(logicalGraphLayouts[0]);
  }
  for (LogicalGraph logicalGraph : logicalGraphLayouts) {
   graphHeads = (graphHeads == null) ?
    logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead());
   vertices = (vertices == null) ?
    logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices());
   edges = (edges == null) ?
    logicalGraph.getEdges() : edges.union(logicalGraph.getEdges());
  }
  return fromDataSets(
   graphHeads.distinct(new Id<>()),
   vertices.distinct(new Id<>()),
   edges.distinct(new Id<>()));
 }
 return createEmptyCollection();
}
origin: dbs-leipzig/gradoop

@Override
public GraphCollection execute(
 GraphCollection firstCollection,
 GraphCollection secondCollection) {
 // do some init stuff for the actual operator
 this.firstCollection = firstCollection;
 this.secondCollection = secondCollection;
 final DataSet<GraphHead> newGraphHeads = computeNewGraphHeads();
 final DataSet<Vertex> newVertices = computeNewVertices(newGraphHeads);
 final DataSet<Edge> newEdges = computeNewEdges(newVertices);
 return firstCollection.getConfig().getGraphCollectionFactory()
  .fromDataSets(newGraphHeads, newVertices, newEdges);
}
origin: dbs-leipzig/gradoop

@Override
public GraphCollection execute(GraphCollection collection)  {
 config = collection.getConfig();
 DataSet<GraphTransaction> input = collection
  .getGraphTransactions();
 DataSet<GraphTransaction> output = execute(input);
 return config.getGraphCollectionFactory()
  .fromTransactions(output);
}
origin: dbs-leipzig/gradoop

@Test
public void testEmpty() throws Exception {
 GraphCollection inputCollection = getConfig().getGraphCollectionFactory()
  .createEmptyCollection();
 int limit = 4;
 int expectedCount = 0;
 GraphCollection outputCollection = inputCollection.limit(limit);
 assertEquals(expectedCount, outputCollection.getGraphHeads().count());
}
origin: dbs-leipzig/gradoop

if (graphHeads != null && vertices != null && edges != null) {
 collection = graph.getConfig().getGraphCollectionFactory()
  .fromDataSets(graphHeads, vertices, edges);
} else {
 collection = graph.getConfig().getGraphCollectionFactory().createEmptyCollection();
origin: dbs-leipzig/gradoop

@Override
public GraphCollection fromGraphs(LogicalGraph... logicalGraphLayouts) {
 if (logicalGraphLayouts.length != 0) {
  DataSet<GraphHead> graphHeads = null;
  DataSet<Vertex> vertices = null;
  DataSet<Edge> edges = null;
  if (logicalGraphLayouts.length == 1) {
   return fromGraph(logicalGraphLayouts[0]);
  }
  for (LogicalGraph logicalGraph : logicalGraphLayouts) {
   graphHeads = (graphHeads == null) ?
    logicalGraph.getGraphHead() : graphHeads.union(logicalGraph.getGraphHead());
   vertices = (vertices == null) ?
    logicalGraph.getVertices() : vertices.union(logicalGraph.getVertices());
   edges = (edges == null) ?
    logicalGraph.getEdges() : edges.union(logicalGraph.getEdges());
  }
  return fromDataSets(
   graphHeads.distinct(new Id<>()),
   vertices.distinct(new Id<>()),
   edges.distinct(new Id<>()));
 }
 return createEmptyCollection();
}
origin: org.gradoop/gradoop-flink

/**
 * {@inheritDoc}
 */
@Override
public GraphCollection execute(
 GraphCollection firstCollection,
 GraphCollection secondCollection) {
 // do some init stuff for the actual operator
 this.firstCollection = firstCollection;
 this.secondCollection = secondCollection;
 final DataSet<GraphHead> newGraphHeads = computeNewGraphHeads();
 final DataSet<Vertex> newVertices = computeNewVertices(newGraphHeads);
 final DataSet<Edge> newEdges = computeNewEdges(newVertices);
 return firstCollection.getConfig().getGraphCollectionFactory()
  .fromDataSets(newGraphHeads, newVertices, newEdges);
}
origin: org.gradoop/gradoop-flink

@Override
public GraphCollection execute(GraphCollection collection)  {
 config = collection.getConfig();
 DataSet<GraphTransaction> input = collection
  .getGraphTransactions();
 DataSet<GraphTransaction> output = execute(input);
 return config.getGraphCollectionFactory()
  .fromTransactions(output);
}
origin: dbs-leipzig/gradoop

@Test(expected = InvalidProgramException.class)
public void testNegativeLimit() throws Exception {
 GraphCollection inputCollection = getConfig().getGraphCollectionFactory()
  .createEmptyCollection();
 int limit = -1;
 int expectedCount = 0;
 GraphCollection outputCollection = inputCollection.limit(limit);
 assertEquals(expectedCount, outputCollection.getGraphHeads().count());
}
origin: org.gradoop/gradoop-flink

if (graphHeads != null && vertices != null && edges != null) {
 collection = graph.getConfig().getGraphCollectionFactory()
  .fromDataSets(graphHeads, vertices, edges);
} else {
 collection = graph.getConfig().getGraphCollectionFactory().createEmptyCollection();
origin: dbs-leipzig/gradoop

 @Override
 public DataSet<Boolean> execute(LogicalGraph firstGraph, LogicalGraph secondGraph) {
  GraphCollectionFactory collectionFactory = firstGraph.getConfig()
   .getGraphCollectionFactory();
  return collectionEquality
   .execute(collectionFactory.fromGraph(firstGraph), collectionFactory.fromGraph(secondGraph));
 }
}
origin: org.gradoop/gradoop-flink

@Override
public GraphCollection execute(GraphCollection collection) {
 return collection.getConfig().getGraphCollectionFactory().fromDataSets(
  collection.getGraphHeads().distinct(new Id<>()),
  collection.getVertices(),
  collection.getEdges());
}
origin: org.gradoop/gradoop-flink

@Override
public GraphCollection executeForTxLayout(GraphCollection collection) {
 DataSet<GraphTransaction> updatedTransactions = collection.getGraphTransactions()
  .map(new AggregateTransactions(aggregateFunctions));
 return collection.getConfig().getGraphCollectionFactory().fromTransactions(updatedTransactions);
}
origin: dbs-leipzig/gradoop

 @Test
 public void testTotalOverlappingCollections() throws Exception {
  FlinkAsciiGraphLoader loader = getSocialNetworkLoader();

  GraphCollection col01 = loader.getGraphCollectionByVariables("g0", "g1");

  GraphCollection expectation = getConfig().getGraphCollectionFactory().createEmptyCollection();

  GraphCollection result = col01.difference(col01);
  checkAssertions(expectation, result, "total");

  result = col01.differenceWithSmallResult(col01);
  checkAssertions(expectation, result, "small total");
 }
}
origin: org.gradoop/gradoop-flink

/**
 * Builds a {@link GraphCollection} from the graph referenced by the given
 * graph variables.
 *
 * @param variables graph variables used in GDL script
 * @return GraphCollection
 */
public GraphCollection getGraphCollectionByVariables(String... variables) {
 Collection<GraphHead> graphHeads = getGraphHeadsByVariables(variables);
 Collection<Vertex> vertices = getVerticesByGraphVariables(variables);
 Collection<Edge> edges = getEdgesByGraphVariables(variables);
 return config.getGraphCollectionFactory().fromCollections(graphHeads, vertices, edges);
}
origin: dbs-leipzig/gradoop

 @Override
 public GraphCollection getGraphCollection() throws IOException {
  return config.getGraphCollectionFactory().fromGraph(getLogicalGraph());
 }
}
origin: dbs-leipzig/gradoop

 @Override
 public GraphCollection execute(GraphCollection collection) {
  return collection.getConfig().getGraphCollectionFactory().fromDataSets(
   collection.getGraphHeads().distinct(new Id<>()),
   collection.getVertices(),
   collection.getEdges());
 }
}
org.gradoop.flink.model.impl.epgmGraphCollectionFactory

Javadoc

Responsible for creating instances of GraphCollection based on a specific GraphCollectionLayout.

Most used methods

  • fromGraph
  • createEmptyCollection
  • fromCollections
  • fromDataSets
  • fromTransactions
  • <init>
    Creates a new factory.
  • fromGraphs
  • fromIndexedDataSets

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
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