memgraph/tests/public_benchmark/ldbc/test_cases/queries/query_4.oc
Marko Budiselic a8e0792609 LDBC
Summary: Add LDBC helper scripts.

Reviewers: teon.banek, mferencevic, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D563
2017-08-28 09:34:22 +02:00

12 lines
515 B
Plaintext

MATCH (person:Person {id:"21990232559429"})-[:KNOWS]-(:Person)<-[:HAS_CREATOR]-(post:Post)-[:HAS_TAG]->(tag:Tag)
WHERE post.creationDate >= 1335830400000 AND post.creationDate < 1339027200000
OPTIONAL MATCH (tag)<-[:HAS_TAG]-(oldPost:Post)-[:HAS_CREATOR]->(:Person)-[:KNOWS]-(person)
WHERE oldPost.creationDate < 1335830400000
WITH tag, post, size(collect(oldPost)) AS oldPostCount
WHERE oldPostCount=0
RETURN
tag.name AS tagName,
size(collect(post)) AS postCount
ORDER BY postCount DESC, tagName ASC
LIMIT 10;