diff --git a/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java b/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java index 0677311..07b62e0 100644 --- a/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java +++ b/src/main/java/lu/jpt/csparqlproject/rentacar/RentACarSimulation.java @@ -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();