[TASK] Generic commit.
This commit is contained in:
parent
e042e4ea5c
commit
30c7526927
Binary file not shown.
|
@ -1069,6 +1069,37 @@ ACTION
|
|||
new StrongAccelerationEvent(relatedCar=c1.relatedCar, deltaSpeed=deltaSpeed)
|
||||
\end{lstlisting}
|
||||
|
||||
Übersetzt man dies in einen C-SPARQL-Query, so erhält man folgende Abfrage:
|
||||
\begin{lstlisting}[label={},caption={}]
|
||||
REGISTER STREAM getStronglyAcceleratingCars AS
|
||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
||||
PREFIX f: <http://larkc.eu/csparql/sparql/jena/ext#>
|
||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
||||
PREFIX car: <http://example.org/carSim/carSimulationOntology#>
|
||||
CONSTRUCT {
|
||||
[] rdf:type car:CarStrongAcceleratingEvent
|
||||
; car:relatedCar ?car
|
||||
; car:deltaSpeed ?deltaSpeed .
|
||||
}
|
||||
FROM STREAM <http://example.org/carSim/stream/carStream> [RANGE 5s STEP 1s]
|
||||
WHERE {
|
||||
?e1 rdf:type car:CarStatusEvent .
|
||||
?e1 car:relatedCar ?car .
|
||||
?e1 car:speed ?speed1 .
|
||||
?e2 rdf:type car:CarStatusEvent .
|
||||
?e2 car:relatedCar ?car .
|
||||
?e2 car:speed ?speed2 .
|
||||
FILTER NOT EXISTS {
|
||||
?ex rdf:type car:CarStatusEvent .
|
||||
FILTER(f:timestamp(?e1,rdf:type,car:CarStatusEvent) < f:timestamp(?ex,rdf:type,car:CarStatusEvent))
|
||||
FILTER(f:timestamp(?ex,rdf:type,car:CarStatusEvent) < f:timestamp(?e2,rdf:type,car:CarStatusEvent))
|
||||
}
|
||||
BIND(?speed2 - ?speed1 AS ?deltaSpeed)
|
||||
FILTER(f:timestamp(?e1,rdf:type,car:CarStatusEvent) < f:timestamp(?e2,rdf:type,car:CarStatusEvent))
|
||||
FILTER(?deltaSpeed > 25)
|
||||
}
|
||||
\end{lstlisting}
|
||||
Diese muss nun lediglich als Ereignisdatenstrom an der Engine registriert werden, und kann dann innerhalb von weiteren C-SPARQL-Queries verwendet werden.
|
||||
\item Verschleiß der Bremsen durch sehr starke Bremsmanöver
|
||||
|
||||
\item Verschleiß des Motors durch Fahrt mit überhöhter Motordrehzahl
|
||||
|
|
Loading…
Reference in New Issue