Example #1
0
 public static String generateProjectionForTgd(
     ComplexQueryWithNegations query,
     List<VariableCorrespondence> correspondences,
     int chainingStep) {
   String fromClause = GenerateSQL.generateFromClause(query.getVariables(), chainingStep);
   String whereClause = GenerateSQL.generateWhereClause(query.getComplexQuery());
   return projectionOnTargetValuesFromCorrespondences(correspondences, fromClause, whereClause);
 }
 public void visitComplexQueryWithNegation(ComplexQueryWithNegations query) {
   stack.add(0, query);
   //        List<FormulaVariable> universalVariables =
   // variableFinder.getUniversalVariables(variableMaps, stack);
   //        variables.add(0, universalVariables);
   ComplexConjunctiveQuery positiveQuery = query.getComplexQuery();
   positiveQuery.accept(this);
   List<NegatedComplexQuery> sortedQueries =
       new ArrayList<NegatedComplexQuery>(query.getNegatedComplexQueries());
   Collections.sort(sortedQueries);
   for (NegatedComplexQuery negatedQuery : sortedQueries) {
     negatedQuery.accept(this);
   }
   //        variables.remove(0);
   stack.remove(0);
 }