forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbi-9.cypher
More file actions
28 lines (28 loc) · 674 Bytes
/
bi-9.cypher
File metadata and controls
28 lines (28 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Q9. Forum with related Tags
/*
:param {
tagClass1: 'BaseballPlayer',
tagClass2: 'ChristianBishop',
threshold: 200
}
*/
MATCH
(forum:Forum)-[:HAS_MEMBER]->(person:Person)
WITH forum, count(person) AS members
WHERE members > $threshold
MATCH
(forum)-[:CONTAINER_OF]->(post1:Post)-[:HAS_TAG]->
(:Tag)-[:HAS_TYPE]->(:TagClass {name: $tagClass1})
WITH forum, count(DISTINCT post1) AS count1
MATCH
(forum)-[:CONTAINER_OF]->(post2:Post)-[:HAS_TAG]->
(:Tag)-[:HAS_TYPE]->(:TagClass {name: $tagClass2})
WITH forum, count1, count(DISTINCT post2) AS count2
RETURN
forum.id,
count1,
count2
ORDER BY
abs(count2-count1) DESC,
forum.id ASC
LIMIT 100