+ localqueryfile);
final String query = FileHelper
.fastReadFile(localqueryfile);
final QueryResult result2 = ((evaluator.debug) == DEBUG.ALL || (evaluator.debug) == DEBUG.WITHOUTRESULT) ? evaluator
.getResult(query, localqueryfile)
: evaluator.getResult(query);
final QueryResult result1 = ((evaluator.debug) == DEBUG.ALL || (evaluator.debug) == DEBUG.WITHOUTRESULT) ? qe
.getResult(query, localqueryfile)
: qe.getResult(query);
if ((evaluator.debug) == DEBUG.ONLYFINAL) {
evaluator
.displayOperatorGraph("Final Operatorgraph for query "
+ localqueryfile
+ " of engine "
+ evaluator.getClass().getSimpleName());
qe
.displayOperatorGraph("Final Operatorgraph for query "
+ localqueryfile
+ " of engine "
+ qe.getClass().getSimpleName());
}
int resultSize1;
int resultSize2;
if (result1 == null) {
resultSize1 = 0;
} else {
resultSize1 = result1.size();
}
if (result2 == null) {
resultSize2 = 0;
} else {
resultSize2 = result2.size();
}
System.out
.println("Number of results engine 1 versus number of results of engine 2:"
+ resultSize1
+ (resultSize1 == resultSize2 ? "=" : "!=")
+ resultSize2);
if ((resultSize1 == 0 && resultSize2 == 0)
|| (result1 != null && result2 != null && result1
.equals(result2))) {
System.out.println("The results match exactly!");
if (resultSize1 == 0)
System.out
.println("However, the results are empty. Please check more carefully!");
else {
if (result1.sameOrder(result2))
System.out
.println("\nThe results are in the same order!");
}
} else {
System.out
.println("Results mismatch!\n\nPlease set the logger's level to DEBUG to see more detailed information");
if (result1 != null)
System.out
.println("Size of query result of engine 1:"
+ result1.size());
if (result2 != null)
System.out
.println("Size of query result of engine 2:"
+ result2.size());
if (result1 != null
&& result2 != null
&& result1
.containsAllExceptAnonymousLiterals(result2)
&& result2
.containsAllExceptAnonymousLiterals(result1)) {
System.out
.println("\n\nIt seems to be that the results are equivalent except of anonymous literals.");
System.out
.println("It must be more carefully checked!");
if (result1
.sameOrderExceptAnonymousLiterals(result2))
System.out
.println("\nThe results are in the same order ignoring anonymous literals!");
}
}
}
} else {
final int times = evaluator.times;
if (times == 0) {
System.out.println("Evaluate a query in "
+ queryfile
+ " on data in "
+ datafile
+ " using the "
+ evaluator.getClass().getSimpleName().replace(
"QueryEvaluator", "") + " Engine\n");
System.out.println("Read input data from file " + datafile
+ " ...");
evaluator.prepareInputData(defaultGraphs, namedGraphs);
for (final String localqueryfile : queryFiles) {
System.out.println("\nQuery in file:"
+ localqueryfile);
System.out.println("Compile query...");
evaluator.compileQueryFromFile(localqueryfile);
System.out.println("Logical optimization...");
evaluator.logicalOptimization();
System.out.println("Physical optimization...");
evaluator.physicalOptimization();
System.out.println("Evaluate query ...");
final QueryResult resultQueryEvaluator = evaluator
.getResult();
System.out.println("\nQuery Result:");
System.out.println(resultQueryEvaluator);
System.out.println("Number of results: "
+ resultQueryEvaluator.size());
if ((evaluator.debug) == DEBUG.ONLYFINAL)
evaluator
.displayOperatorGraph("Final Operatorgraph for query "
+ localqueryfile);
System.out.println("----------------Done.");