forked from ldbc/ldbc_snb_interactive_v1_impls
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
GO 1 to 2 steps from $personId over KNOWS bidirect where KNOWS._dst <> $personId yield distinct KNOWS._dst as friend | | ||
GO from $-.friend over POST_HAS_CREATOR reversely yield distinct POST_HAS_CREATOR._dst as friendPost | | ||
GO from $-.friendPost over HAS_TAG where $$.`Tag`.name==$tagName yield distinct HAS_TAG._src as postWithSpecifiedTag | | ||
GO from $-.postWithSpecifiedTag over HAS_TAG where $$.`Tag`.name<>$tagName yield distinct $$.`Tag`.name as otherTagName, HAS_TAG._src as commonPost | | ||
group by $-.otherTagName yield $-.otherTagName as otherTagName, count($-.commonPost) as postCount | | ||
order by $-.postCount desc, $-.otherTagName ASC | | ||
limit 10 | ||
MATCH (person:Person)-[:KNOWS*1..2]-(friend:Person) | ||
WHERE id(person) == $personId AND id(friend) != $personId | ||
WITH DISTINCT friend | ||
MATCH (knownTag:`Tag`{name: $tagName})<-[:HAS_TAG]-(post:Post), | ||
(post)-[:POST_HAS_CREATOR]->(friend:Person), | ||
(post)-[:HAS_TAG]->(t:`Tag`) | ||
WHERE t.`Tag`.name != $tagName | ||
RETURN t.`Tag`.name AS tagName, count(id(post)) AS postCount | ||
ORDER BY postCount DESC, tagName ASC | ||
LIMIT 10 |