Skip to content

Commit

Permalink
Fix IC 10 validation (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu authored Dec 3, 2022
1 parent 3dd2700 commit 3d0fae2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nebula/queries/interactive-complex-10.ngql
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ WHERE (birthday.month==$month AND birthday.day>=21) OR
(birthday.month==($month%12)+1 AND birthday.day<22)
WITH DISTINCT friend AS f, city AS c, person AS p
OPTIONAL MATCH (f)<-[:POST_HAS_CREATOR]-(post:Post)
WITH f AS friend, c AS city, collect(post) AS posts, p AS person
WITH friend,
city,
size(posts) AS postCount,
size([p IN posts WHERE (p)-[:HAS_TAG]->()<-[:HAS_INTEREST]-(person)]) AS commonPostCount
OPTIONAL MATCH (p)-[:HAS_INTEREST]->(m)<-[:HAS_TAG]-(post:Post)
with f AS friend, c AS city, post, CASE WHEN count(m) > 0 THEN 1 ELSE 0 END AS cnt
with friend, city, sum(cnt) AS commonPostCount, count(post) AS postCount
RETURN toInteger(substr(id(friend), 2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
Expand Down

0 comments on commit 3d0fae2

Please sign in to comment.