Repository: dbs-leipzig/gradoop
Issue: Overlap operator does not consider the edges of the second graph

Graph 1 : `(A)-[message]->(B)-[message]->(C)`
Graph 2:   `(A)-[like]->(B)-[message]->(C)`

Gaph1.overlap(Gaph2) returns the graph:
`(A)-[message]->(B)-[message]->(C)`
which is not the graph I expected. 

In my opinion the proper result should be a overlap of vertices AND edges:
`(A)     (B)-[message]->(C)`

The edge `(A)-[message]->(B)` does not occur in both graphs, but only in the first one.

The following code of the function Overlap.execute() is one solution approach. I join the edge-set of the second graph on the edge-set of the first graph:

```
public class Overlap [...] {
public LogicalGraph execute(LogicalGraph firstGraph, LogicalGraph secondGraph) {
        [...]
        DataSet<Edge> newEdges = firstGraph.getEdges()
          .join(secondGraph.getEdges())
          .where(new Id<>())
          .equalTo(new Id<>())
          .with(new LeftSide<>());
        [...]
      }
}
```

Related: #687

Also a UnitTest for this case should be added.

Changed files:
gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java
gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/overlap/Overlap.java

diff --git a/gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/overlap/Overlap.java b/gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/overlap/Overlap.java
index 83d1126b6a1..db1ba1594e3 100644
--- a/gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/overlap/Overlap.java
+++ b/gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/overlap/Overlap.java
@@ -21,8 +21,6 @@ import org.gradoop.common.model.impl.pojo.Vertex;
 import org.gradoop.flink.model.api.epgm.LogicalGraph;
 import org.gradoop.flink.model.api.operators.BinaryGraphToGraphOperator;
 import org.gradoop.flink.model.impl.functions.epgm.Id;
-import org.gradoop.flink.model.impl.functions.epgm.SourceId;
-import org.gradoop.flink.model.impl.functions.epgm.TargetId;
 import org.gradoop.flink.model.impl.functions.utils.LeftSide;
 
 /**
@@ -50,12 +48,8 @@ public class Overlap implements BinaryGraphToGraphOperator {
       .with(new LeftSide<>());
 
     DataSet<Edge> newEdges = firstGraph.getEdges()
-      .join(newVertices)
-      .where(new SourceId<>())
-      .equalTo(new Id<>())
-      .with(new LeftSide<>())
-      .join(newVertices)
-      .where(new TargetId<>())
+      .join(secondGraph.getEdges())
+      .where(new Id<>())
       .equalTo(new Id<>())
       .with(new LeftSide<>());
 
diff --git a/gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java b/gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java
index 61d9385248c..da1fd1575b5 100644
--- a/gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java
+++ b/gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java
@@ -105,6 +105,19 @@ public class OverlapTest extends ReducibleBinaryOperatorsTestBase {
     collectAndAssertTrue(derivedGraph1.overlap(derivedGraph2).equalsByElementIds(expected));
   }
 
+  @Test
+  public void testVertexOnlyOverlappingGraphs() throws Exception {
+    FlinkAsciiGraphLoader loader = getLoaderFromString(
+      "g1[(a)-[e1]->(b)]" +
+      "g2[(a)-[e2]->(b)]" +
+      "expected[(a)(b)]");
+    LogicalGraph g1 = loader.getLogicalGraphByVariable("g1");
+    LogicalGraph g2 = loader.getLogicalGraphByVariable("g2");
+    LogicalGraph expected = loader.getLogicalGraphByVariable("expected");
+
+    collectAndAssertTrue(g1.overlap(g2).equalsByElementIds(expected));
+  }
+
   @Test
   public void testGraphContainment() throws Exception {
     FlinkAsciiGraphLoader loader = getSocialNetworkLoader();
@@ -156,8 +169,10 @@ public class OverlapTest extends ReducibleBinaryOperatorsTestBase {
   @Test
   public void testReduceCollection() throws Exception {
     FlinkAsciiGraphLoader loader = getLoaderFromString("" +
-        "g1[(a)-[e1]->(b)];g2[(b)-[e2]->(c)]" +
-        "g3[(c)-[e3]->(d)];g4[(a)-[e1]->(b)]" +
+        "g1[(a)-[e1]->(b)]" +
+        "g2[(b)-[e2]->(c)]" +
+        "g3[(c)-[e3]->(d)]" +
+        "g4[(a)-[e1]->(b)]" +
         "exp12[(b)]" +
         "exp13[]" +
         "exp14[(a)-[e1]->(b)]"