/*
 * Copyright 2017 TraderJoe95.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package one.p_f.testing.msagimport.grouping;

import org.gradoop.flink.io.api.DataSink;
import org.gradoop.flink.io.api.DataSource;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.gradoop.flink.io.impl.json.JSONDataSource;
import org.gradoop.flink.io.impl.dot.DOTDataSink;
import org.gradoop.flink.model.impl.LogicalGraph;
import org.gradoop.flink.util.GradoopFlinkConfig;

import static java.util.Collections.singletonList;
import static org.gradoop.flink.model.impl.operators.grouping.Grouping.LABEL_SYMBOL;

/**
 * @author TraderJoe95
 */
public class GroupingMain {

    public static void main(final String[] args) throws Exception {
        String inputPath = args[0];
        String outputPath = args[1];

        ExecutionEnvironment env = ExecutionEnvironment
                .getExecutionEnvironment();

        // instantiate a default gradoop config
        GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(env);

        // define a data source to load the graph
        DataSource dataSource = new JSONDataSource(inputPath, config);

        // load the graph
        LogicalGraph graph = dataSource.getLogicalGraph();

        // use graph grouping to extract the schema
        LogicalGraph schema = graph.groupBy(singletonList(LABEL_SYMBOL),
                singletonList(LABEL_SYMBOL));

        // instantiate a data sink for the DOT format
        DataSink dataSink = new DOTDataSink(outputPath, false);
        dataSink.write(schema, true);

        // run the job
        env.execute();
    }
}

@@ -14,27 +14,32 @@
 ht 2017 
-TraderJoe95
+Johannes Leupold
 .%0A *%0A * 
@@ -637,24 +637,54 @@
 .grouping;%0A%0A
+import java.util.Collections;%0A
 import org.g
@@ -995,83 +995,46 @@
 ink.
-util.GradoopFlinkConfig;%0A%0Aimport static java.util.Collections.singletonList
+model.impl.operators.grouping.Grouping
 ;%0Aim
@@ -1038,23 +1038,16 @@
 %0Aimport 
-static 
 org.grad
@@ -1060,60 +1060,33 @@
 ink.
-model.impl.operators.grouping.Grouping.LABEL_SYMBOL;
+util.GradoopFlinkConfig;%0A
 %0A%0A/*
@@ -1813,16 +1813,45 @@
 groupBy(
+%0A                Collections.
 singleto
@@ -1848,32 +1848,41 @@
 s.singletonList(
+Grouping.
 LABEL_SYMBOL),%0A 
@@ -1896,16 +1896,28 @@
         
+Collections.
 singleto
@@ -1922,16 +1922,25 @@
 tonList(
+Grouping.
 LABEL_SY

Fix the fix.