

{"id":346,"date":"2021-12-07T11:22:09","date_gmt":"2021-12-07T10:22:09","guid":{"rendered":"https:\/\/project.inria.fr\/tcypher\/?page_id=346"},"modified":"2021-12-07T11:28:20","modified_gmt":"2021-12-07T10:28:20","slug":"university-connections","status":"publish","type":"page","link":"https:\/\/project.inria.fr\/tcypher\/university-connections\/","title":{"rendered":"University connections"},"content":{"rendered":"<p>Return pairs of users who became friends when studying at the same university.<\/p>\n<h5><a href=\"https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-118 aligncenter\" src=\"https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1-1024x576.png\" alt=\"\" width=\"437\" height=\"246\" srcset=\"https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1-1024x576.png 1024w, https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1-300x169.png 300w, https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1-768x432.png 768w, https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1-150x84.png 150w, https:\/\/project.inria.fr\/tcypher\/files\/2021\/12\/query_1-1.png 1280w\" sizes=\"auto, (max-width: 437px) 100vw, 437px\" \/><\/a><\/h5>\n<h5>\u00a0T-Cypher query:<\/h5>\n<p style=\"padding-left: 30px;\"><strong>RIGHT_SLICE<\/strong> 2010-01-01T01:01:01Z <strong>ON R<\/strong><\/p>\n<p style=\"padding-left: 30px;\"><strong>MATCH<\/strong> (p1:Person)-[k:knows]-(p2:Person),<\/p>\n<p style=\"padding-left: 30px;\">(p1)-[s1:studyIn]-&gt;(u:University)&lt;-[s2:studyIn]-(p2)<\/p>\n<p style=\"padding-left: 30px;\"><strong>WHERE<\/strong> s1@T <strong>EQUALS<\/strong> s2@T <strong>AND<\/strong> s2@T <strong>STARTS<\/strong> k@T<\/p>\n<p style=\"padding-left: 30px;\"><strong>RETURN<\/strong> p1, p2<\/p>\n<hr \/>\n<h5>Interpretation:<\/h5>\n<p>The right slice indicates that the time intervals of all the relationship variables of the query should end after 2010-01-01T01:01:01Z. Expression &#8216;s1@T <strong>EQUALS<\/strong> s2@T&#8217; indicates that both users studied during the same period of time in the same university. Whereas, expession s2@T <strong>STARTS<\/strong> k@T indicates that the friendship have started when both users started studying at the same university and continued to hold after graduation.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h5>Cypher query:<\/h5>\n<p style=\"padding-left: 30px;\">MATCH (p1:`Person`)-[r0:`knows`]-(p2:`Person`),<\/p>\n<p style=\"padding-left: 30px;\">(p1)-[r1:`studyIn`]-&gt;(u:`University`)&lt;-[r2:`studyIn`]-(p2)<\/p>\n<p style=\"padding-left: 30px;\">WHERE (r1.tStart = r2.tStart AND r1.tEnd = r2.tEnd AND k.tStart &lt; s1.tEnd AND r0.tEnd &gt;= 1262332800000 AND r1.tEnd &gt;= 1262332800000 AND r2.tEnd &gt;= 1262332800000)<\/p>\n<p style=\"padding-left: 30px;\">RETURN p1, p2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Return pairs of users who became friends when studying at the same university. \u00a0T-Cypher query: RIGHT_SLICE 2010-01-01T01:01:01Z ON R MATCH (p1:Person)-[k:knows]-(p2:Person), (p1)-[s1:studyIn]-&gt;(u:University)&lt;-[s2:studyIn]-(p2) WHERE s1@T EQUALS s2@T AND s2@T STARTS k@T RETURN p1, p2 Interpretation: The right slice indicates that the time intervals of all the relationship variables of the query\u2026<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/project.inria.fr\/tcypher\/university-connections\/\"><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-346","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/346","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=346"}],"version-history":[{"count":2,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/346\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/pages\/346\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/project.inria.fr\/tcypher\/wp-json\/wp\/v2\/media?parent=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}