Machine failure

Machine failure. Return the duration between the last maintenance of a machine and its failure before a given date.

T-Cypher query:

LEFT_SLICE 2019-01-01T08:00:00Z

MATCH (employee) –[m:maintains]-> (machine)

<-[c:connectsTo]-(s:sensor)

WHERE s.meas@T AFTER m@T AND s.meas>4

RETURN ELAPSED_TIME(m@T, s.meas@T)


Cypher query:

MATCH (n0:`employee`)-[m:`maintains`]->(n1:`machine`)<-[c:`connectsTo`]-(s:`sensor`), (s)-[:`hasProperty`]->(smeas:`meas`) WHERE (s.tEnd < smeas.tStart AND smeas.value > 4 AND n0.tStart <= 1546329600000 AND n1.tStart <= 1546329600000 AND s.tStart <= 1546329600000 AND m.tStart <= 1546329600000 AND c.tStart <= 1546329600000 AND smeas.tStart <= 1546329600000) RETURN myFunctions.elapsed_time([m.tStart, m.tEnd], [smeas.tStart, smeas.tEnd]) AS `ELAPSED_TIME(m@T,s.meas)`


Interpretation:

The left slice indicates that the time interval of each query variable should start before the given time instant 2019-01-01T08:00:00Z. Now the s.meas@T AFTER m@T filters the measurements that are recorded by the sensor after the occurrence of the relationship i indicating the maitenance of the machine.  The machine’s failure translates to s.meas>4 indicating that the recorded value by the sensor exceeds a given threshold value (4 e.g.).  Finally, the elapsed time between the maintenance of the machine and its failure is applied to the time intervals of the relationship m@T referring to the maintenance of the machine and the time interval when the value exceeded the threshold.

Comments are closed.