

{"id":333,"date":"2021-12-07T11:18:52","date_gmt":"2021-12-07T10:18:52","guid":{"rendered":"https:\/\/project.inria.fr\/tcypher\/?page_id=333"},"modified":"2021-12-07T11:18:52","modified_gmt":"2021-12-07T10:18:52","slug":"machine-failure","status":"publish","type":"page","link":"https:\/\/project.inria.fr\/tcypher\/machine-failure\/","title":{"rendered":"Machine failure"},"content":{"rendered":"<p><strong>Machine failure.<\/strong> Return the duration between the last maintenance of a machine and its failure before a given date.<\/p>\n<h5>T-Cypher query:<\/h5>\n<p><strong>LEFT_SLICE<\/strong> 2019-01-01T08:00:00Z<\/p>\n<p><strong>MATCH <\/strong>(employee) \u2013[m:maintains]-&gt; (machine)<\/p>\n<p>&lt;-[c:connectsTo]-(s:sensor)<\/p>\n<p><strong>WHERE <\/strong>s.meas@T<strong> AFTER <\/strong>m@T <strong>AND <\/strong>s.meas&gt;4<\/p>\n<p><strong>RETURN <\/strong>ELAPSED_TIME(m@T<b>, <\/b>s.meas@T)<\/p>\n<hr \/>\n<h5>Cypher query:<\/h5>\n<p>MATCH (n0:`employee`)-[m:`maintains`]-&gt;(n1:`machine`)&lt;-[c:`connectsTo`]-(s:`sensor`), (s)-[:`hasProperty`]-&gt;(smeas:`meas`) WHERE (s.tEnd &lt; smeas.tStart AND smeas.value &gt; 4 AND n0.tStart &lt;= 1546329600000 AND n1.tStart &lt;= 1546329600000 AND s.tStart &lt;= 1546329600000 AND m.tStart &lt;= 1546329600000 AND c.tStart &lt;= 1546329600000 AND smeas.tStart &lt;= 1546329600000) RETURN myFunctions.elapsed_time([m.tStart, m.tEnd], [smeas.tStart, smeas.tEnd]) AS `ELAPSED_TIME(m@T,s.meas)`<\/p>\n<hr \/>\n<h5>Interpretation:<\/h5>\n<p>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<b>@T<\/b><b> AFTER <\/b>m<b>@T<\/b> filters the measurements that are recorded by the sensor after the occurrence of the relationship i indicating the maitenance of the machine.\u00a0 The machine&#8217;s failure translates to s.meas&gt;4 indicating that the recorded value by the sensor exceeds a given threshold value (4 e.g.).\u00a0 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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) \u2013[m:maintains]-&gt; (machine) &lt;-[c:connectsTo]-(s:sensor) WHERE s.meas@T AFTER m@T AND s.meas&gt;4 RETURN ELAPSED_TIME(m@T, s.meas@T) Cypher query: MATCH (n0:`employee`)-[m:`maintains`]-&gt;(n1:`machine`)&lt;-[c:`connectsTo`]-(s:`sensor`), (s)-[:`hasProperty`]-&gt;(smeas:`meas`) WHERE (s.tEnd &lt; smeas.tStart AND smeas.value &gt; 4\u2026<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/project.inria.fr\/tcypher\/machine-failure\/\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":2118,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-333","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/users\/2118"}],"replies":[{"embeddable":true,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":1,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/333\/revisions"}],"predecessor-version":[{"id":334,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/333\/revisions\/334"}],"wp:attachment":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/media?parent=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}