[TASK] Generic commit.

This commit is contained in:
Jan Philipp Timme 2016-10-11 16:59:24 +02:00
parent cad2ad2e8c
commit e975f9825e
2 changed files with 16 additions and 20 deletions

View File

@ -187,7 +187,7 @@ public class SimulationContext {
engine.registerStream(rdfStreamFormatter);
resultProxy.addObserver(rdfStreamFormatter);
if(queryContainer.useObserverWindow) {
Observer resultObserver = this.createResultObserverWindow(queryContainer.name);
Observer resultObserver = this.createResultObserverWindow(streamUri);
resultProxy.addObserver(resultObserver);
}
} else {

View File

@ -74,9 +74,9 @@ public class RentACarSimulation implements Runnable {
private void registerOwnPrefixes() {
Main.prefixManager.registerPrefix("event", RentACarSimulation.BASE_OBJECT_IRI+"/event#");
Main.prefixManager.registerPrefix("carOnt", RentACarSimulation.BASE_ONTOLOGY_IRI);
Main.prefixManager.registerPrefix("car", RentACarSimulation.BASE_OBJECT_IRI+"/Car#");
Main.prefixManager.registerPrefix("driver", RentACarSimulation.BASE_OBJECT_IRI+"/Driver#");
Main.prefixManager.registerPrefix("car", RentACarSimulation.BASE_ONTOLOGY_IRI);
Main.prefixManager.registerPrefix("cars", RentACarSimulation.BASE_OBJECT_IRI+"/Car#");
Main.prefixManager.registerPrefix("drivers", RentACarSimulation.BASE_OBJECT_IRI+"/Driver#");
}
public RdfStream getCarStream() {
@ -579,26 +579,22 @@ public class RentACarSimulation implements Runnable {
+ "PREFIX car: <http://example.org/carSim/carSimulationOntology#> "
+ "CONSTRUCT { "
+ " [] rdf:type car:CarMaintenanceNeededEvent "
+ " ; car:relatedCar ?car . "
+ " ; car:relatedCar ?car "
+ " ; car:numberOfWearEvents ?numberWearEvents . "
+ "} "
+ "FROM STREAM <http://example.org/carSim/stream/carStream> [RANGE 5s TUMBLING] "
+ "FROM STREAM <http://example.org/carSim/stream/getEngineWear> [RANGE 4h STEP 5m] "
+ "FROM STREAM <http://example.org/carSim/stream/getWearEvents> [RANGE 5s TUMBLING] "
+ "WHERE { "
+ " { "
+ " SELECT ?car "
+ " WHERE { "
+ " ?wearEvent rdf:type car:CarWearEvent . "
+ " ?wearEvent car:relatedCar ?car . "
+ " } "
+ " GROUP BY ?car "
+ " HAVING (COUNT(?wearEvent) > 10) "
+ " SELECT (?carWithWear AS ?car) (COUNT(?wearEvent) AS ?numberWearEvents) "
+ " WHERE { "
+ " ?wearEvent rdf:type car:CarWearEvent . "
+ " ?wearEvent car:relatedCar ?carWithWear . "
+ " } "
+ " GROUP BY ?carWithWear "
+ " HAVING (COUNT(?wearEvent) > 10) "
+ " } "
+ " UNION { "
+ " ?checkEngineEvent rdf:type car:CarCheckEngineEvent . "
+ " ?checkEngineEvent car:relatedCar ?car . "
+ " } "
+ "}";
QueryContainer queryContainer = new QueryContainer("getMaintenanceEvents", query, true);
+ "}";
QueryContainer queryContainer = new QueryContainer("getMaintenanceEvents", query, false);
queryContainer.useObserverWindow();
return queryContainer;
}