[TASK] Overhaul getMovingCarsQuery.
This commit is contained in:
parent
9296de1fd6
commit
b7d9e55bbf
|
@ -547,18 +547,17 @@ public class RentACarSimulation implements Runnable {
|
||||||
+ "SELECT ?car "
|
+ "SELECT ?car "
|
||||||
+ "FROM STREAM <"+RentACarSimulation.CAR_STREAM_IRI+"> [RANGE 15s STEP 1s] "
|
+ "FROM STREAM <"+RentACarSimulation.CAR_STREAM_IRI+"> [RANGE 15s STEP 1s] "
|
||||||
+ "WHERE { "
|
+ "WHERE { "
|
||||||
+ " ?standingEvent rdf:type car:CarStatusEvent . "
|
+ " ?lockEvent rdf:type car:CarLockEvent . "
|
||||||
+ " ?standingEvent car:speed ?zeroSpeed . "
|
+ " ?lockEvent car:relatedCar ?car . "
|
||||||
+ " ?standingEvent car:handbrakeEngaged ?handbrake . "
|
|
||||||
+ " ?standingEvent car:locked ?locked . "
|
|
||||||
+ " ?rollingEvent rdf:type car:CarStatusEvent . "
|
+ " ?rollingEvent rdf:type car:CarStatusEvent . "
|
||||||
|
+ " ?rollingEvent car:relatedCar ?car . "
|
||||||
+ " ?rollingEvent car:speed ?speed . "
|
+ " ?rollingEvent car:speed ?speed . "
|
||||||
+ " ?rollingEvent car:handbrakeEngaged ?handbrake . "
|
+ " ?rollingEvent car:handbrakeEngaged ?handbrake . "
|
||||||
+ " ?rollingEvent car:locked ?locked . "
|
+ " ?rollingEvent car:locked ?locked . "
|
||||||
+ " FILTER(?zeroSpeed = 0) "
|
+ " FILTER(?speed>0) "
|
||||||
+ " FILTER(?locked) "
|
+ " FILTER(?locked) "
|
||||||
+ " FILTER(!?handbrake)"
|
+ " FILTER(!?handbrake) "
|
||||||
+ " FILTER(f:timestamp(?standingEvent,rdf:type,car:CarStatusEvent) < f:timestamp(?rollingEvent,rdf:type,car:CarStatusEvent)) "
|
+ " FILTER(f:timestamp(?lockEvent,rdf:type,car:CarLockEvent) < f:timestamp(?rollingEvent,rdf:type,car:CarStatusEvent)) "
|
||||||
+ "}";
|
+ "}";
|
||||||
QueryContainer queryContainer = new QueryContainer("getLockedMovingCars", query, true);
|
QueryContainer queryContainer = new QueryContainer("getLockedMovingCars", query, true);
|
||||||
queryContainer.useObserverWindow();
|
queryContainer.useObserverWindow();
|
||||||
|
|
Loading…
Reference in New Issue