Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dos2unix #69

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions nebula/queries-sf100/interactive-complex-12.ngql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
MATCH (n:Person)-[:KNOWS]-(friend:Person)<-[:COMMENT_HAS_CREATOR]-(`comment`:`Comment`)-[:REPLY_OF_POST]->(:Post)-[:HAS_TAG]->(`tag`:`Tag`)-[:HAS_TYPE]->(tagClass:Tagclass)-[:IS_SUBCLASS_OF*0..100]->(baseTagClass:Tagclass)
WHERE id(n) == $personId AND (tagClass.Tagclass.name == $tagClassName OR baseTagClass.Tagclass.name == $tagClassName)
RETURN
toInteger(substr(id(friend),2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
collect(DISTINCT `tag`.`Tag`.name) AS tagNames,
count(DISTINCT id(`comment`)) AS replyCount
ORDER BY replyCount DESC, personId ASC
MATCH (n:Person)-[:KNOWS]-(friend:Person)<-[:COMMENT_HAS_CREATOR]-(`comment`:`Comment`)-[:REPLY_OF_POST]->(:Post)-[:HAS_TAG]->(`tag`:`Tag`)-[:HAS_TYPE]->(tagClass:Tagclass)-[:IS_SUBCLASS_OF*0..100]->(baseTagClass:Tagclass)
WHERE id(n) == $personId AND (tagClass.Tagclass.name == $tagClassName OR baseTagClass.Tagclass.name == $tagClassName)
RETURN
toInteger(substr(id(friend),2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
collect(DISTINCT `tag`.`Tag`.name) AS tagNames,
count(DISTINCT id(`comment`)) AS replyCount
ORDER BY replyCount DESC, personId ASC
LIMIT 20
18 changes: 9 additions & 9 deletions nebula/queries-sf100/interactive-complex-2.ngql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GO FROM $personId OVER KNOWS BIDIRECT YIELD KNOWS._dst AS friendId
| GO FROM $-.friendId OVER POST_HAS_CREATOR_NEW, COMMENT_HAS_CREATOR_NEW REVERSELY WHERE (COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY and COMMENT_HAS_CREATOR_NEW.creationDate <= $maxDate) or (POST_HAS_CREATOR_NEW.creationDate is not EMPTY and POST_HAS_CREATOR_NEW.creationDate <= $maxDate)
YIELD
toInteger(substr($-.friendId, 2)) AS personId,
$^.Person.firstName AS personFirstName,
$^.Person.lastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR_NEW.content is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.content ELSE CASE size(POST_HAS_CREATOR_NEW.imageFile) WHEN 0 THEN POST_HAS_CREATOR_NEW.content ELSE POST_HAS_CREATOR_NEW.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.creationDate ELSE POST_HAS_CREATOR_NEW.creationDate END AS messageCreationDate
GO FROM $personId OVER KNOWS BIDIRECT YIELD KNOWS._dst AS friendId
| GO FROM $-.friendId OVER POST_HAS_CREATOR_NEW, COMMENT_HAS_CREATOR_NEW REVERSELY WHERE (COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY and COMMENT_HAS_CREATOR_NEW.creationDate <= $maxDate) or (POST_HAS_CREATOR_NEW.creationDate is not EMPTY and POST_HAS_CREATOR_NEW.creationDate <= $maxDate)
YIELD
toInteger(substr($-.friendId, 2)) AS personId,
$^.Person.firstName AS personFirstName,
$^.Person.lastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR_NEW.content is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.content ELSE CASE size(POST_HAS_CREATOR_NEW.imageFile) WHEN 0 THEN POST_HAS_CREATOR_NEW.content ELSE POST_HAS_CREATOR_NEW.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.creationDate ELSE POST_HAS_CREATOR_NEW.creationDate END AS messageCreationDate
| ORDER BY $-.messageCreationDate DESC, $-.messageId ASC | LIMIT 20
50 changes: 25 additions & 25 deletions nebula/queries-sf100/interactive-complex-3.ngql
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
MATCH (city:Place)-[:IS_PART_OF]->(country:Place)
WHERE country.Place.name == $countryXName OR country.Place.name == $countryYName
WITH collect(id(city)) AS cities
MATCH (person)-[:KNOWS*1..2]-(friend)-[:IS_LOCATED_IN]->(city)
WHERE id(person) == $personId AND id(friend) != $personId AND id(city) NOT IN cities
WITH DISTINCT friend
MATCH (friend)<-[:POST_HAS_CREATOR|COMMENT_HAS_CREATOR]-(message)-[:IS_LOCATED_IN]->(country)
WHERE
CASE
WHEN message.`Comment`.creationDate < $endDate AND message.`Comment`.creationDate >= $startDate AND (country.Place.name == $countryXName OR country.Place.name == $countryYName) THEN true
WHEN message.Post.creationDate < $endDate AND message.Post.creationDate >= $startDate AND (country.Place.name == $countryXName OR country.Place.name == $countryYName) THEN true
ELSE false
END
WITH friend,
CASE WHEN country.Place.name == $countryXName THEN 1 ELSE 0 END AS messageX,
CASE WHEN country.Place.name == $countryYName THEN 1 ELSE 0 END AS messageY
WITH friend, sum(messageX) AS xCount, sum(messageY) AS yCount
WHERE xCount>0 AND yCount>0
RETURN tointeger(substr(id(friend), 2)) AS friendId,
friend.Person.firstName AS friendFirstName,
friend.Person.lastName AS friendLastName,
xCount,
yCount,
xCount + yCount AS xyCount
ORDER BY xyCount DESC, friendId ASC
MATCH (city:Place)-[:IS_PART_OF]->(country:Place)
WHERE country.Place.name == $countryXName OR country.Place.name == $countryYName
WITH collect(id(city)) AS cities
MATCH (person)-[:KNOWS*1..2]-(friend)-[:IS_LOCATED_IN]->(city)
WHERE id(person) == $personId AND id(friend) != $personId AND id(city) NOT IN cities
WITH DISTINCT friend
MATCH (friend)<-[:POST_HAS_CREATOR|COMMENT_HAS_CREATOR]-(message)-[:IS_LOCATED_IN]->(country)
WHERE
CASE
WHEN message.`Comment`.creationDate < $endDate AND message.`Comment`.creationDate >= $startDate AND (country.Place.name == $countryXName OR country.Place.name == $countryYName) THEN true
WHEN message.Post.creationDate < $endDate AND message.Post.creationDate >= $startDate AND (country.Place.name == $countryXName OR country.Place.name == $countryYName) THEN true
ELSE false
END
WITH friend,
CASE WHEN country.Place.name == $countryXName THEN 1 ELSE 0 END AS messageX,
CASE WHEN country.Place.name == $countryYName THEN 1 ELSE 0 END AS messageY
WITH friend, sum(messageX) AS xCount, sum(messageY) AS yCount
WHERE xCount>0 AND yCount>0
RETURN tointeger(substr(id(friend), 2)) AS friendId,
friend.Person.firstName AS friendFirstName,
friend.Person.lastName AS friendLastName,
xCount,
yCount,
xCount + yCount AS xyCount
ORDER BY xyCount DESC, friendId ASC
LIMIT 20
22 changes: 11 additions & 11 deletions nebula/queries-sf100/interactive-complex-4.ngql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
MATCH (person:Person)-[:KNOWS]-(:Person)<-[:POST_HAS_CREATOR]-(post:Post)-[:HAS_TAG]->(`tag`:`Tag`)
WHERE id(person) == $personId AND post.Post.creationDate >= $startDate AND post.Post.creationDate < $endDate
WITH person, count(post) AS postsOnTag, `tag`
OPTIONAL MATCH (person)-[:KNOWS]-()<-[:POST_HAS_CREATOR]-(oldPost:Post)-[:HAS_TAG]->(`tag`)
WHERE oldPost.Post.creationDate < $startDate
WITH person, postsOnTag, `tag`, count(oldPost) AS cp
WHERE cp == 0
RETURN
`tag`.`Tag`.name AS tagName,
sum(postsOnTag) AS postCount
ORDER BY postCount DESC, tagName ASC
MATCH (person:Person)-[:KNOWS]-(:Person)<-[:POST_HAS_CREATOR]-(post:Post)-[:HAS_TAG]->(`tag`:`Tag`)
WHERE id(person) == $personId AND post.Post.creationDate >= $startDate AND post.Post.creationDate < $endDate
WITH person, count(post) AS postsOnTag, `tag`
OPTIONAL MATCH (person)-[:KNOWS]-()<-[:POST_HAS_CREATOR]-(oldPost:Post)-[:HAS_TAG]->(`tag`)
WHERE oldPost.Post.creationDate < $startDate
WITH person, postsOnTag, `tag`, count(oldPost) AS cp
WHERE cp == 0
RETURN
`tag`.`Tag`.name AS tagName,
sum(postsOnTag) AS postCount
ORDER BY postCount DESC, tagName ASC
limit 10
62 changes: 31 additions & 31 deletions nebula/queries-sf100/interactive-complex-7.ngql
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
MATCH (person:Person)<-[:POST_HAS_CREATOR|COMMENT_HAS_CREATOR]-(message)<-[like:LIKES_COMMENT|LIKES_POST]-(liker:Person)
WHERE id(person) == $personId
WITH
liker,
message,
like.creationDate AS likeTime,
person,
id(message) AS messageId
ORDER BY
likeTime DESC,
messageId ASC
WITH
liker,
head(collect({msg:message, likeTime:likeTime})) AS latestLike,
person
OPTIONAL MATCH p = (liker)-[:KNOWS]-(person)
RETURN
toInteger(substr(id(liker), 2)) AS personId,
liker.Person.firstName AS personFirstName,
liker.Person.lastName AS personLastName,
latestLike.likeTime AS likeCreationDate,
id(latestLike.msg) AS messageId,
CASE exists(latestLike.msg.content)
WHEN true THEN latestLike.msg.content
ELSE latestLike.msg.imageFile
END AS messageContent,
latestLike.msg.creationDate AS messageCreationDate,
p IS NULL AS isNew
ORDER BY
likeCreationDate DESC,
personId ASC
MATCH (person:Person)<-[:POST_HAS_CREATOR|COMMENT_HAS_CREATOR]-(message)<-[like:LIKES_COMMENT|LIKES_POST]-(liker:Person)
WHERE id(person) == $personId
WITH
liker,
message,
like.creationDate AS likeTime,
person,
id(message) AS messageId
ORDER BY
likeTime DESC,
messageId ASC
WITH
liker,
head(collect({msg:message, likeTime:likeTime})) AS latestLike,
person
OPTIONAL MATCH p = (liker)-[:KNOWS]-(person)
RETURN
toInteger(substr(id(liker), 2)) AS personId,
liker.Person.firstName AS personFirstName,
liker.Person.lastName AS personLastName,
latestLike.likeTime AS likeCreationDate,
id(latestLike.msg) AS messageId,
CASE exists(latestLike.msg.content)
WHEN true THEN latestLike.msg.content
ELSE latestLike.msg.imageFile
END AS messageContent,
latestLike.msg.creationDate AS messageCreationDate,
p IS NULL AS isNew
ORDER BY
likeCreationDate DESC,
personId ASC
LIMIT 20
32 changes: 16 additions & 16 deletions nebula/queries-sf100/interactive-complex-9.ngql
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
GO 1 TO 2 STEPS FROM $personId OVER KNOWS BIDIRECT
WHERE KNOWS._dst != $personId
YIELD DISTINCT
KNOWS._dst AS personId,
$$.Person.firstName AS personFirstName,
$$.Person.lastName AS personLastName
| GO FROM $-.personId OVER POST_HAS_CREATOR_NEW, COMMENT_HAS_CREATOR_NEW REVERSELY
WHERE (COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY and COMMENT_HAS_CREATOR_NEW.creationDate < $maxDate) OR (POST_HAS_CREATOR_NEW.creationDate is not EMPTY and POST_HAS_CREATOR_NEW.creationDate < $maxDate)
YIELD
$-.personId AS personId,
$-.personFirstName AS personFirstName,
$-.personLastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR_NEW.content is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.content ELSE CASE size(POST_HAS_CREATOR_NEW.imageFile) WHEN 0 THEN POST_HAS_CREATOR_NEW.content ELSE POST_HAS_CREATOR_NEW.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.creationDate ELSE POST_HAS_CREATOR_NEW.creationDate END AS messageCreationDate
| ORDER BY $-.messageCreationDate DESC, $-.messageId ASC | LIMIT 20
GO 1 TO 2 STEPS FROM $personId OVER KNOWS BIDIRECT
WHERE KNOWS._dst != $personId
YIELD DISTINCT
KNOWS._dst AS personId,
$$.Person.firstName AS personFirstName,
$$.Person.lastName AS personLastName
| GO FROM $-.personId OVER POST_HAS_CREATOR_NEW, COMMENT_HAS_CREATOR_NEW REVERSELY
WHERE (COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY and COMMENT_HAS_CREATOR_NEW.creationDate < $maxDate) OR (POST_HAS_CREATOR_NEW.creationDate is not EMPTY and POST_HAS_CREATOR_NEW.creationDate < $maxDate)
YIELD
$-.personId AS personId,
$-.personFirstName AS personFirstName,
$-.personLastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR_NEW.content is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.content ELSE CASE size(POST_HAS_CREATOR_NEW.imageFile) WHEN 0 THEN POST_HAS_CREATOR_NEW.content ELSE POST_HAS_CREATOR_NEW.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR_NEW.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR_NEW.creationDate ELSE POST_HAS_CREATOR_NEW.creationDate END AS messageCreationDate
| ORDER BY $-.messageCreationDate DESC, $-.messageId ASC | LIMIT 20
36 changes: 18 additions & 18 deletions nebula/queries-sf100/interactive-short-2.ngql
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
MATCH (n:Person)<-[:COMMENT_HAS_CREATOR | POST_HAS_CREATOR]-(message)-[:REPLY_OF_POST | REPLY_OF_COMMENT*0..100]->(p:Post)
WHERE id(n)==$personId
MATCH (p)-[:POST_HAS_CREATOR]->(c)
RETURN
id(message) as messageId,
CASE tags(message)[0]
WHEN "Comment" THEN message.`Comment`.content
ELSE CASE size(message.Post.imageFile) WHEN 0 THEN message.Post.content ELSE message.Post.imageFile END
END AS messageContent,
CASE tags(message)[0]
WHEN "Comment" THEN message.`Comment`.creationDate
ELSE message.Post.creationDate
END AS messageCreationDate,
id(p) AS originalPostId,
id(c) AS originalPostAuthorId,
c.Person.firstName as originalPostAuthorFirstName,
c.Person.lastName as originalPostAuthorLastName
ORDER BY messageCreationDate DESC
MATCH (n:Person)<-[:COMMENT_HAS_CREATOR | POST_HAS_CREATOR]-(message)-[:REPLY_OF_POST | REPLY_OF_COMMENT*0..100]->(p:Post)
WHERE id(n)==$personId
MATCH (p)-[:POST_HAS_CREATOR]->(c)
RETURN
id(message) as messageId,
CASE tags(message)[0]
WHEN "Comment" THEN message.`Comment`.content
ELSE CASE size(message.Post.imageFile) WHEN 0 THEN message.Post.content ELSE message.Post.imageFile END
END AS messageContent,
CASE tags(message)[0]
WHEN "Comment" THEN message.`Comment`.creationDate
ELSE message.Post.creationDate
END AS messageCreationDate,
id(p) AS originalPostId,
id(c) AS originalPostAuthorId,
c.Person.firstName as originalPostAuthorFirstName,
c.Person.lastName as originalPostAuthorLastName
ORDER BY messageCreationDate DESC
LIMIT 10
14 changes: 7 additions & 7 deletions nebula/queries-sf100/interactive-short-6.ngql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MATCH (m)-[:REPLY_OF_COMMENT | REPLY_OF_POST *0..100]->(p:Post)<-[:CONTAINER_OF]-(f:Forum)-[:HAS_MODERATOR]->(mod:Person)
WHERE id(m) == $commentId OR id(m) == $postId
RETURN
id(f) AS forumId,
f.Forum.title AS forumTitle,
id(mod) AS moderatorId,
mod.Person.firstName AS moderatorFirstName,
MATCH (m)-[:REPLY_OF_COMMENT | REPLY_OF_POST *0..100]->(p:Post)<-[:CONTAINER_OF]-(f:Forum)-[:HAS_MODERATOR]->(mod:Person)
WHERE id(m) == $commentId OR id(m) == $postId
RETURN
id(f) AS forumId,
f.Forum.title AS forumTitle,
id(mod) AS moderatorId,
mod.Person.firstName AS moderatorFirstName,
mod.Person.lastName AS moderatorLastName
28 changes: 14 additions & 14 deletions nebula/queries-sf100/interactive-short-7.ngql
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
MATCH (m)<-[:REPLY_OF_COMMENT|REPLY_OF_POST]-(c:`Comment`)-[:COMMENT_HAS_CREATOR]->(p:Person)
WHERE id(m) == $commentId OR id(m) == $postId
OPTIONAL MATCH (m)-[:COMMENT_HAS_CREATOR|POST_HAS_CREATOR]->(a:Person)-[r:KNOWS]-(p)
RETURN
id(c) AS commentId,
c.`Comment`.content AS commentContent,
c.`Comment`.creationDate AS commentCreationDate,
toInteger(substr(id(p), 2)) AS replyAuthorId,
p.Person.firstName AS replyAuthorFirstName,
p.Person.lastName AS replyAuthorLastName,
CASE dst(r)
WHEN null THEN false
ELSE true
END AS replyAuthorKnowsOriginalMessageAuthor
MATCH (m)<-[:REPLY_OF_COMMENT|REPLY_OF_POST]-(c:`Comment`)-[:COMMENT_HAS_CREATOR]->(p:Person)
WHERE id(m) == $commentId OR id(m) == $postId
OPTIONAL MATCH (m)-[:COMMENT_HAS_CREATOR|POST_HAS_CREATOR]->(a:Person)-[r:KNOWS]-(p)
RETURN
id(c) AS commentId,
c.`Comment`.content AS commentContent,
c.`Comment`.creationDate AS commentCreationDate,
toInteger(substr(id(p), 2)) AS replyAuthorId,
p.Person.firstName AS replyAuthorFirstName,
p.Person.lastName AS replyAuthorLastName,
CASE dst(r)
WHEN null THEN false
ELSE true
END AS replyAuthorKnowsOriginalMessageAuthor
ORDER BY commentCreationDate DESC, replyAuthorId
28 changes: 14 additions & 14 deletions nebula/queries/interactive-complex-12.ngql
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
MATCH (tag1:`Tag`)-[:HAS_TYPE|IS_SUBCLASS_OF*0..6]->(baseTagClass:Tagclass)
WHERE tag1.`Tag`.name == $tagClassName OR baseTagClass.Tagclass.name == $tagClassName
WITH collect(id(tag1)) as T
MATCH (p:Person)-[:KNOWS]-(friend:Person)<-[:COMMENT_HAS_CREATOR]-(comment1:`Comment`)-[:REPLY_OF_POST]->(:Post)-[:HAS_TAG]->(tag2:`Tag`)
WHERE id(p) == $personId AND id(tag2) in T
RETURN
toInteger(substr(id(friend),2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
collect(DISTINCT tag2.`Tag`.name) AS tagNames,
count(DISTINCT id(comment1)) AS replyCount
ORDER BY
replyCount DESC,
personId ASC
MATCH (tag1:`Tag`)-[:HAS_TYPE|IS_SUBCLASS_OF*0..6]->(baseTagClass:Tagclass)
WHERE tag1.`Tag`.name == $tagClassName OR baseTagClass.Tagclass.name == $tagClassName
WITH collect(id(tag1)) as T
MATCH (p:Person)-[:KNOWS]-(friend:Person)<-[:COMMENT_HAS_CREATOR]-(comment1:`Comment`)-[:REPLY_OF_POST]->(:Post)-[:HAS_TAG]->(tag2:`Tag`)
WHERE id(p) == $personId AND id(tag2) in T
RETURN
toInteger(substr(id(friend),2)) AS personId,
friend.Person.firstName AS personFirstName,
friend.Person.lastName AS personLastName,
collect(DISTINCT tag2.`Tag`.name) AS tagNames,
count(DISTINCT id(comment1)) AS replyCount
ORDER BY
replyCount DESC,
personId ASC
LIMIT 20
18 changes: 9 additions & 9 deletions nebula/queries/interactive-complex-2.ngql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GO FROM $personId OVER KNOWS BIDIRECT YIELD KNOWS._dst AS friendId
| GO FROM $-.friendId OVER POST_HAS_CREATOR, COMMENT_HAS_CREATOR REVERSELY WHERE (COMMENT_HAS_CREATOR.creationDate is not EMPTY and COMMENT_HAS_CREATOR.creationDate <= $maxDate) or (POST_HAS_CREATOR.creationDate is not EMPTY and POST_HAS_CREATOR.creationDate <= $maxDate)
YIELD
toInteger(substr($-.friendId, 2)) AS personId,
$^.Person.firstName AS personFirstName,
$^.Person.lastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR.content is not EMPTY THEN COMMENT_HAS_CREATOR.content ELSE CASE size(POST_HAS_CREATOR.imageFile) WHEN 0 THEN POST_HAS_CREATOR.content ELSE POST_HAS_CREATOR.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR.creationDate ELSE POST_HAS_CREATOR.creationDate END AS messageCreationDate
GO FROM $personId OVER KNOWS BIDIRECT YIELD KNOWS._dst AS friendId
| GO FROM $-.friendId OVER POST_HAS_CREATOR, COMMENT_HAS_CREATOR REVERSELY WHERE (COMMENT_HAS_CREATOR.creationDate is not EMPTY and COMMENT_HAS_CREATOR.creationDate <= $maxDate) or (POST_HAS_CREATOR.creationDate is not EMPTY and POST_HAS_CREATOR.creationDate <= $maxDate)
YIELD
toInteger(substr($-.friendId, 2)) AS personId,
$^.Person.firstName AS personFirstName,
$^.Person.lastName AS personLastName,
toInteger(substr(id($$), 2)) AS messageId,
CASE WHEN COMMENT_HAS_CREATOR.content is not EMPTY THEN COMMENT_HAS_CREATOR.content ELSE CASE size(POST_HAS_CREATOR.imageFile) WHEN 0 THEN POST_HAS_CREATOR.content ELSE POST_HAS_CREATOR.imageFile END END AS messageContent,
CASE WHEN COMMENT_HAS_CREATOR.creationDate is not EMPTY THEN COMMENT_HAS_CREATOR.creationDate ELSE POST_HAS_CREATOR.creationDate END AS messageCreationDate
| ORDER BY $-.messageCreationDate DESC, $-.messageId ASC | LIMIT 20
Loading