Skip to content

Commit

Permalink
Fix IC10 validation
Browse files Browse the repository at this point in the history
Fix IC10

fix

fix

small change

small fix

fix IC14

Fix IC10 validation

fix Ic10
  • Loading branch information
czpmango committed Dec 1, 2022
1 parent 75af79e commit f818d8c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions nebula/queries/interactive-complex-10.ngql
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ 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, count(post) AS postCount, p AS person
UNWIND posts AS post
OPTIONAL MATCH (person)-[e:HAS_INTEREST]->()<-[:HAS_TAG]-(post)
WITH friend, city, postCount, id(person) AS pid, count(e) AS commonPostCount
RETURN toInteger(substr(id(friend), 2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
commonPostCount - (postCount - commonPostCount) AS commonInterestScore,
friend.Person.gender AS personGender,
city.Place.name AS personCityName
WITH f AS friend, c AS city, collect(post) AS posts, count(post) AS postCount, p AS person
WITH friend,
city,
size(posts) AS postCount,
size([p IN posts WHERE (p)-[:HAS_TAG]->()<-[:HAS_INTEREST]-(person)]) AS commonPostCount
RETURN toInteger(substr(id(friend), 2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
commonPostCount - (postCount - commonPostCount) AS commonInterestScore,
friend.Person.gender AS personGender,
city.Place.name AS personCityName
ORDER BY commonInterestScore DESC, personId ASC
LIMIT 10
LIMIT 10

0 comments on commit f818d8c

Please sign in to comment.