Zigzag { public void execute() throws AlgorithmExecutionException { List<InclusionDependency> allInputINDs = inclusionDependencyInput.execute(); Map<ImmutableList<String>, List<InclusionDependency>> tablesPairToINDList = allInputINDs.stream() .collect(Collectors.groupingBy( ind -> ImmutableList.of(ind.getDependant().getColumnIdentifiers().get(0).getTableIdentifier(), ind.getReferenced().getColumnIdentifiers().get(0).getTableIdentifier()))); for (List<InclusionDependency> split : tablesPairToINDList.values()) { partialExecute(split); currentLevel = config.getStartK(); satisfiedINDs.clear(); unsatisfiedINDs.clear(); } commitResults(); validationStrategy.close(); log.info(format("Total DB checks: %s", dbChecks)); } Zigzag(ZigzagConfiguration config); void execute();  }
@Test public void testPaperExample() throws Exception { List<ColumnIdentifier> ci = new ArrayList<>(); for (String c : columnNames) { ci.add(new ColumnIdentifier(relationName, c)); } List<InclusionDependency> maximumINDs = new ArrayList<>(); maximumINDs.add( new InclusionDependency( new ColumnPermutation(ci.get(0), ci.get(1), ci.get(2), ci.get(3), ci.get(4)), new ColumnPermutation(ci.get(7), ci.get(8), ci.get(9), ci.get(10), ci.get(11)))); maximumINDs.add( new InclusionDependency( new ColumnPermutation(ci.get(3), ci.get(5), ci.get(6)), new ColumnPermutation(ci.get(10), ci.get(12), ci.get(13)))); maximumINDs.add( new InclusionDependency( new ColumnPermutation(ci.get(4), ci.get(5)), new ColumnPermutation(ci.get(11), ci.get(12)))); maximumINDs.add( new InclusionDependency( new ColumnPermutation(ci.get(4), ci.get(6)), new ColumnPermutation(ci.get(11), ci.get(13)))); InclusionDependencyResultReceiverStub resultReceiver = new InclusionDependencyResultReceiverStub(); ValidationParameters validationParameters = new ValidationParameters(); validationParameters.setQueryType(QueryType.ERROR_MARGIN); validationParameters.setConnectionGenerator(testDatabase.asConnectionGenerator()); InclusionDependencyParameters inclusionDependencyParameters = new InclusionDependencyParameters(); inclusionDependencyParameters.setAlgorithmType(AlgorithmType.FILE); inclusionDependencyParameters .setConfigurationString("inputPath=" + getClass().getResource("ind_input.json").getFile()); ZigzagConfiguration config = ZigzagConfiguration.builder() .resultReceiver(resultReceiver) .validationParameters(validationParameters) .inclusionDependencyParameters(inclusionDependencyParameters) .startK(2) .epsilon(10000) .build(); Zigzag zigzag = new Zigzag(config); zigzag.execute(); assertEqualMaxInds(resultReceiver.getReceivedResults(), maximumINDs); }