[TASK] Add queries that use aggregation functions.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package lu.jpt.csparqlproject;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -156,14 +155,16 @@ public class SimulationContext {
|
||||
// Register all the queries and add result observers!
|
||||
Collection<String> queriesToRegister = new ArrayList<String>();
|
||||
queriesToRegister.add(RentACarSimulation.getEventsQuery());
|
||||
queriesToRegister.add(RentACarSimulation.getAverageDataByCar());
|
||||
for(String query : queriesToRegister) {
|
||||
String queryName = CsparqlQueryHelper.getQueryName(query);
|
||||
CsparqlQueryResultProxy resultProxy = null;
|
||||
try {
|
||||
resultProxy = this.engine.registerQuery(query, true);
|
||||
} catch (ParseException e) {
|
||||
} catch (Exception e) {
|
||||
SimulationContext.logger.error(e.toString());
|
||||
SimulationContext.logger.error(e.getStackTrace().toString());
|
||||
SimulationContext.logger.error("Could not register query "+queryName);
|
||||
SimulationContext.logger.error(query);
|
||||
}
|
||||
this.queryResultProxies.add(resultProxy);
|
||||
resultProxy.addObserver(new TextObserverWindow("[ResultProxy] " + queryName));
|
||||
|
||||
Reference in New Issue
Block a user