[TASK] Overhaul getMovingCarsQuery.

This commit is contained in:
Jan Philipp Timme 2016-10-10 17:09:55 +02:00
parent 9296de1fd6
commit b7d9e55bbf
1 changed files with 6 additions and 7 deletions

View File

@ -547,18 +547,17 @@ public class RentACarSimulation implements Runnable {
+ "SELECT ?car "
+ "FROM STREAM <"+RentACarSimulation.CAR_STREAM_IRI+"> [RANGE 15s STEP 1s] "
+ "WHERE { "
+ " ?standingEvent rdf:type car:CarStatusEvent . "
+ " ?standingEvent car:speed ?zeroSpeed . "
+ " ?standingEvent car:handbrakeEngaged ?handbrake . "
+ " ?standingEvent car:locked ?locked . "
+ " ?lockEvent rdf:type car:CarLockEvent . "
+ " ?lockEvent car:relatedCar ?car . "
+ " ?rollingEvent rdf:type car:CarStatusEvent . "
+ " ?rollingEvent car:relatedCar ?car . "
+ " ?rollingEvent car:speed ?speed . "
+ " ?rollingEvent car:handbrakeEngaged ?handbrake . "
+ " ?rollingEvent car:locked ?locked . "
+ " FILTER(?zeroSpeed = 0) "
+ " FILTER(?speed>0) "
+ " FILTER(?locked) "
+ " FILTER(!?handbrake)"
+ " FILTER(f:timestamp(?standingEvent,rdf:type,car:CarStatusEvent) < f:timestamp(?rollingEvent,rdf:type,car:CarStatusEvent)) "
+ " FILTER(!?handbrake) "
+ " FILTER(f:timestamp(?lockEvent,rdf:type,car:CarLockEvent) < f:timestamp(?rollingEvent,rdf:type,car:CarStatusEvent)) "
+ "}";
QueryContainer queryContainer = new QueryContainer("getLockedMovingCars", query, true);
queryContainer.useObserverWindow();