Created
March 26, 2019 08:46
-
-
Save elisedeux/1334304a8ea4f55bb3896e782ddca497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH p=(a:Company)-[rs:SELLS_TO*]->(c:Company) | |
WHERE a.country <> c.country | |
WITH p, a, c, rs, nodes(p) AS ns | |
WITH p, a, c, rs, filter(n IN ns WHERE n.epoch - 1383123473 < (90*60*60*24)) AS bs | |
WITH p, a, c, rs, head(bs) AS b | |
WHERE NOT b IS NULL | |
WITH p, a, b, c, head(rs) AS r1, last(rs) AS rn | |
WITH p, a, b, c, r1, rn, rn.epoch - r1.epoch AS d | |
WHERE d < (15*60*60*24) | |
RETURN a, b, c, d, r1, rn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment