memgraph/tests/public_benchmark/ldbc/test_cases/queries/query_5.cyp
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

11 lines
419 B
Plaintext

MATCH (person:Person {id:"8796093030404"})-[:KNOWS*1..2]-(friend:Person)<-[membership:HAS_MEMBER]-(forum:Forum)
WHERE membership.joinDate>1347062400000 AND not(person=friend)
WITH DISTINCT friend, forum
OPTIONAL MATCH (friend)<-[:HAS_CREATOR]-(post:Post)<-[:CONTAINER_OF]-(forum)
WITH forum, count(post) AS postCount
RETURN
forum.title AS forumName,
postCount
ORDER BY postCount DESC, toInt(forum.id) ASC
LIMIT 20;