diff --git a/nebula/queries-sf100/interactive-complex-1.ngql b/nebula/queries-sf100/interactive-complex-1.ngql new file mode 100644 index 000000000..5fea3651e --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-1.ngql @@ -0,0 +1,45 @@ +MATCH p=(person:Person)-[:KNOWS*1..3]-(friend:Person {firstName: $firstName}) +WHERE id(person) == $personId +AND person <> friend +WITH friend, length(p) AS distance +LIMIT 20 +MATCH (friend)-[:IS_LOCATED_IN]->(friendCity:Place) +OPTIONAL MATCH (friend)-[studyAt:STUDY_AT]->(uni:Organisation)-[:IS_LOCATED_IN]->(uniCity:Place) +WITH + friend, + collect( + CASE uni.Organisation.name + WHEN null THEN null + ELSE [uni.Organisation.name, studyAt.classYear, uniCity.Place.name] + END + ) AS unis, + friendCity, + distance +OPTIONAL MATCH (friend)-[workAt:WORK_AT]->(company:Organisation)-[:IS_LOCATED_IN]->(companyCountry:Place) +WITH + friend, + collect( + CASE company.Organisation.name + WHEN null THEN null + ELSE [company.Organisation.name, workAt.workFrom, companyCountry.Place.name] + END + ) AS companies, + unis, + friendCity, + distance +RETURN + id(friend) AS friendId, + friend.Person.lastName AS friendLastName, + distance AS distanceFromPerson, + friend.Person.birthday AS friendBirthday, + friend.Person.creationDate AS friendCreationDate, + friend.Person.gender AS friendGender, + friend.Person.browserUsed AS friendBrowserUsed, + friend.Person.locationIP AS friendLocationIp, + friend.Person.email AS friendEmails, + friend.Person.speaks AS friendLanguages, + friendCity.Place.name AS friendCityName, + unis AS friendUniversities, + companies AS friendCompanies +ORDER BY distanceFromPerson ASC, friendLastName ASC +LIMIT 20 diff --git a/nebula/queries-sf100/interactive-complex-11.ngql b/nebula/queries-sf100/interactive-complex-11.ngql new file mode 100644 index 000000000..ec42abf90 --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-11.ngql @@ -0,0 +1 @@ +GO 1 TO 2 STEPS FROM $personId OVER KNOWS BIDIRECT WHERE KNOWS._dst != $personId YIELD distinct KNOWS._dst AS friendId | GO FROM $-.friendId OVER WORK_AT WHERE WORK_AT.workFrom < $workFromYear YIELD $-.friendId AS friendId, $^.Person.firstName AS firstName, $^.Person.lastName AS lastName, WORK_AT.workFrom AS workFrom, WORK_AT._dst AS orgId| GO FROM $-.orgId OVER IS_LOCATED_IN WHERE $$.Place.name == $countryName YIELD toInteger(substr($-.friendId, 2)) AS personId, $-.firstName AS personFirstName, $-.lastName AS personLastName, $^.Organisation.name AS organizationName, $-.workFrom AS organizationWorkFromYear | ORDER BY $-.organizationWorkFromYear ASC, $-.personId ASC, $-.organizationName DESC | LIMIT 10 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-12.ngql b/nebula/queries-sf100/interactive-complex-12.ngql new file mode 100644 index 000000000..c7592283f --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-12.ngql @@ -0,0 +1,11 @@ +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 + /* id(friend) AS personId, 属性裁剪待改进, 暂时通过以下写法规避问题*/ + true ? id(friend) : id(n)+id(tagClass)+id(baseTagClass) 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 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-13.ngql b/nebula/queries-sf100/interactive-complex-13.ngql new file mode 100644 index 000000000..e6c740a96 --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-13.ngql @@ -0,0 +1 @@ +find shortest path from $person1Id to $person2Id over KNOWS BIDIRECT yield path as p|yield collect(length($-.p)) AS l | yield case size($-.l) when 0 then -1 else $-.l[0] end; \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-2.ngql b/nebula/queries-sf100/interactive-complex-2.ngql new file mode 100644 index 000000000..997906e4c --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-2.ngql @@ -0,0 +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 + | ORDER BY $-.messageCreationDate DESC, $-.messageId ASC | LIMIT 20 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-3.ngql b/nebula/queries-sf100/interactive-complex-3.ngql new file mode 100644 index 000000000..b464f2ef3 --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-3.ngql @@ -0,0 +1,38 @@ +MATCH (countryX:Place{name:$countryXName}) +MATCH (countryY:Place{name:$countryYName}) +MATCH (person:Person) + WHERE id(person) == $personId +WITH person, id(countryX) AS countryXId, id(countryY) AS countryYId +LIMIT 1 +MATCH (city:Place)-[:IS_PART_OF]->(country:Place) +WITH person, id(country) AS countryId, countryXId, countryYId, id(city) AS cityId +WHERE countryId IN [countryXId, countryYId] +WITH person, countryXId, countryYId, collect(cityId) AS cities +MATCH (person)-[:KNOWS*1..2]-(friend)-[:IS_LOCATED_IN]->(city) +WITH id(person) AS personId, friend, id(city) AS cityId, cities, countryXId, countryYId +WHERE personId<>id(friend) AND NOT cityId IN cities +WITH DISTINCT friend, countryXId, countryYId +MATCH (friend)<-[:POST_HAS_CREATOR|COMMENT_HAS_CREATOR]-(message) +WHERE + CASE + WHEN $endDate > message.`Comment`.creationDate AND message.`Comment`.creationDate >= $startDate THEN true + WHEN $endDate > message.Post.creationDate AND message.Post.creationDate >= $startDate THEN true + ELSE false + END +MATCH (message)-[:IS_LOCATED_IN]->(country) +WITH friend, id(country) AS countryId, countryXId, countryYId +WHERE countryId IN [countryXId, countryYId] +WITH friend, + CASE WHEN countryId==countryYId THEN 1 ELSE 0 END AS messageX, + CASE WHEN countryId==countryYId 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 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-4.ngql b/nebula/queries-sf100/interactive-complex-4.ngql new file mode 100644 index 000000000..ace82c483 --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-4.ngql @@ -0,0 +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 + limit 10 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-5.ngql b/nebula/queries-sf100/interactive-complex-5.ngql new file mode 100644 index 000000000..b16ad863f --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-5.ngql @@ -0,0 +1 @@ +GO 1 TO 2 STEPS FROM $personId OVER KNOWS WHERE KNOWS._dst != $personId YIELD distinct KNOWS._dst AS friendId | GO FROM $-.friendId OVER HAS_MEMBER REVERSELY WHERE HAS_MEMBER.joinDate > $minDate YIELD distinct HAS_MEMBER._dst AS forumId, $-.friendId as friendId| GO FROM $-.forumId OVER CONTAINER_OF YIELD $-.friendId AS friendId, $^.Forum.title AS title, $-.forumId AS forumId, CONTAINER_OF._dst AS postId | GO FROM $-.postId OVER POST_HAS_CREATOR WHERE POST_HAS_CREATOR._dst == $-.friendId YIELD $-.forumId AS forumId, $-.title AS forumTitle, $-.postId AS postId | group by $-.forumId, $-.forumTitle YIELD toInteger(substr($-.forumId, 2)) AS forumId, $-.forumTitle AS forumTitle, count($-.postId) AS postCount | ORDER BY $-.postCount DESC, $-.forumId ASC | LIMIT 20 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-6.ngql b/nebula/queries-sf100/interactive-complex-6.ngql new file mode 100644 index 000000000..ef188ddad --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-6.ngql @@ -0,0 +1 @@ +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 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-7.ngql b/nebula/queries-sf100/interactive-complex-7.ngql new file mode 100644 index 000000000..883c34aff --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-7.ngql @@ -0,0 +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 +LIMIT 20 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-8.ngql b/nebula/queries-sf100/interactive-complex-8.ngql new file mode 100644 index 000000000..95faf661e --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-8.ngql @@ -0,0 +1 @@ +GO FROM $personId OVER POST_HAS_CREATOR, COMMENT_HAS_CREATOR REVERSELY YIELD id($$) AS messageId | GO FROM $-.messageId OVER REPLY_OF_COMMENT, REPLY_OF_POST REVERSELY YIELD id($$) AS commentId | GO FROM $-.commentId OVER COMMENT_HAS_CREATOR YIELD COMMENT_HAS_CREATOR._dst AS personId, $$.Person.firstName AS personFirstName, $$.Person.lastName AS personLastName, $^.`Comment`.creationDate AS commentCreationDate, toInteger(substr($-.commentId, 2)) AS commentId, $^.`Comment`.content AS commentContent |ORDER BY $-.commentCreationDate DESC, $-.commentId ASC|LIMIT 20 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-complex-9.ngql b/nebula/queries-sf100/interactive-complex-9.ngql new file mode 100644 index 000000000..8668a8be4 --- /dev/null +++ b/nebula/queries-sf100/interactive-complex-9.ngql @@ -0,0 +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 diff --git a/nebula/queries-sf100/interactive-short-1.ngql b/nebula/queries-sf100/interactive-short-1.ngql new file mode 100644 index 000000000..7a6eea8dd --- /dev/null +++ b/nebula/queries-sf100/interactive-short-1.ngql @@ -0,0 +1 @@ +GO FROM $personId OVER IS_LOCATED_IN YIELD $^.Person.firstName AS firstName, $^.Person.lastName AS lastName, $^.Person.birthday AS birthday, $^.Person.locationIP AS locationIP, $^.Person.browserUsed AS browserUsed, IS_LOCATED_IN._dst AS cityId, $^.Person.gender AS gender, $^.Person.creationDate AS creationDate \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-2.ngql b/nebula/queries-sf100/interactive-short-2.ngql new file mode 100644 index 000000000..a955d6dbd --- /dev/null +++ b/nebula/queries-sf100/interactive-short-2.ngql @@ -0,0 +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 + LIMIT 10 \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-3.ngql b/nebula/queries-sf100/interactive-short-3.ngql new file mode 100644 index 000000000..1aa96295c --- /dev/null +++ b/nebula/queries-sf100/interactive-short-3.ngql @@ -0,0 +1 @@ + GO FROM $personId OVER KNOWS BIDIRECT YIELD toInteger(substr(KNOWS._dst, 2)) AS personId, $$.Person.firstName AS firstName, $$.Person.lastName AS lastName, KNOWS.creationDate AS friendshipCreationDate | ORDER BY $-.friendshipCreationDate DESC, $-.personId ASC \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-4.ngql b/nebula/queries-sf100/interactive-short-4.ngql new file mode 100644 index 000000000..994c8cbc3 --- /dev/null +++ b/nebula/queries-sf100/interactive-short-4.ngql @@ -0,0 +1 @@ +FETCH PROP ON `Comment`, Post $commentId, $postId YIELD CASE WHEN `Comment`.creationDate is not EMPTY THEN `Comment`.creationDate ELSE Post.creationDate END AS messageCreationDate, CASE WHEN `Comment`.content is not EMPTY THEN `Comment`.content ELSE CASE size(Post.imageFile) WHEN 0 THEN Post.content ELSE Post.imageFile END END AS messageContent \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-5.ngql b/nebula/queries-sf100/interactive-short-5.ngql new file mode 100644 index 000000000..70d723990 --- /dev/null +++ b/nebula/queries-sf100/interactive-short-5.ngql @@ -0,0 +1 @@ +GO FROM $commentId, $postId OVER COMMENT_HAS_CREATOR, POST_HAS_CREATOR YIELD id($$) AS personId, $$.Person.firstName AS firstName, $$.Person.lastName AS lastName \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-6.ngql b/nebula/queries-sf100/interactive-short-6.ngql new file mode 100644 index 000000000..a46364909 --- /dev/null +++ b/nebula/queries-sf100/interactive-short-6.ngql @@ -0,0 +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, + mod.Person.lastName AS moderatorLastName \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-short-7.ngql b/nebula/queries-sf100/interactive-short-7.ngql new file mode 100644 index 000000000..860d51760 --- /dev/null +++ b/nebula/queries-sf100/interactive-short-7.ngql @@ -0,0 +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 r + WHEN null THEN false + ELSE true + END AS replyAuthorKnowsOriginalMessageAuthor + ORDER BY commentCreationDate DESC, replyAuthorId \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-update-1-add-person-companies.ngql b/nebula/queries-sf100/interactive-update-1-add-person-companies.ngql new file mode 100644 index 000000000..034fb6f38 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-1-add-person-companies.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + WORK_AT(workFrom) +VALUES + $personId->$organizationId:($worksFromYear) diff --git a/nebula/queries-sf100/interactive-update-1-add-person-emails.ngql b/nebula/queries-sf100/interactive-update-1-add-person-emails.ngql new file mode 100644 index 000000000..e69de29bb diff --git a/nebula/queries-sf100/interactive-update-1-add-person-languages.ngql b/nebula/queries-sf100/interactive-update-1-add-person-languages.ngql new file mode 100644 index 000000000..e69de29bb diff --git a/nebula/queries-sf100/interactive-update-1-add-person-place.ngql b/nebula/queries-sf100/interactive-update-1-add-person-place.ngql new file mode 100644 index 000000000..ae7935b67 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-1-add-person-place.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + IS_LOCATED_IN() +VALUES + $personId->$cityId:() diff --git a/nebula/queries-sf100/interactive-update-1-add-person-tags.ngql b/nebula/queries-sf100/interactive-update-1-add-person-tags.ngql new file mode 100644 index 000000000..0722e6c21 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-1-add-person-tags.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_INTEREST() +VALUES + $personId->$tagId:() diff --git a/nebula/queries-sf100/interactive-update-1-add-person-universities.ngql b/nebula/queries-sf100/interactive-update-1-add-person-universities.ngql new file mode 100644 index 000000000..6aeb51c38 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-1-add-person-universities.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + STUDY_AT(classYear) +VALUES + $personId->$organizationId:($studiesFromYear) diff --git a/nebula/queries-sf100/interactive-update-1-add-person.ngql b/nebula/queries-sf100/interactive-update-1-add-person.ngql new file mode 100644 index 000000000..ef1e663dc --- /dev/null +++ b/nebula/queries-sf100/interactive-update-1-add-person.ngql @@ -0,0 +1,4 @@ +INSERT VERTEX IF NOT EXISTS + Person(firstName, lastName, gender, birthday, creationDate, locationIP, browserUsed) +VALUES + $personId:($personFirstName, $personLastName, $gender, $birthday, $creationDate, $locationIP, $browserUsed); diff --git a/nebula/queries-sf100/interactive-update-2.ngql b/nebula/queries-sf100/interactive-update-2.ngql new file mode 100644 index 000000000..df2172706 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-2.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + LIKES_POST(creationDate) +VALUES + $personId->$postId:($creationDate); diff --git a/nebula/queries-sf100/interactive-update-3.ngql b/nebula/queries-sf100/interactive-update-3.ngql new file mode 100644 index 000000000..5b3576985 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-3.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + LIKES_COMMENT(creationDate) +VALUES + $personId->$commentId:($creationDate) diff --git a/nebula/queries-sf100/interactive-update-4-add-forum-person.ngql b/nebula/queries-sf100/interactive-update-4-add-forum-person.ngql new file mode 100644 index 000000000..5b7681b57 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-4-add-forum-person.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_MODERATOR() +VALUES + $forumId->$moderatorPersonId:() \ No newline at end of file diff --git a/nebula/queries-sf100/interactive-update-4-add-forum-tags.ngql b/nebula/queries-sf100/interactive-update-4-add-forum-tags.ngql new file mode 100644 index 000000000..ee2a47161 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-4-add-forum-tags.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_TAG() +VALUES + $forumId->$tagId:() diff --git a/nebula/queries-sf100/interactive-update-4-add-forum.ngql b/nebula/queries-sf100/interactive-update-4-add-forum.ngql new file mode 100644 index 000000000..401da6969 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-4-add-forum.ngql @@ -0,0 +1,4 @@ +INSERT VERTEX IF NOT EXISTS + Forum(title, creationDate) +VALUES + $forumId:($forumTitle, $creationDate) diff --git a/nebula/queries-sf100/interactive-update-5.ngql b/nebula/queries-sf100/interactive-update-5.ngql new file mode 100644 index 000000000..3a11ab255 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-5.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_MEMBER(joinDate) +VALUES + $forumId->$personId:($joinDate) diff --git a/nebula/queries-sf100/interactive-update-6-add-post-forum.ngql b/nebula/queries-sf100/interactive-update-6-add-post-forum.ngql new file mode 100644 index 000000000..56399bda9 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-6-add-post-forum.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + CONTAINER_OF() +VALUES + $forumId->$postId:() diff --git a/nebula/queries-sf100/interactive-update-6-add-post-person.ngql b/nebula/queries-sf100/interactive-update-6-add-post-person.ngql new file mode 100644 index 000000000..888ca7da4 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-6-add-post-person.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + POST_HAS_CREATOR() +VALUES + $postId->$authorPersonId:() diff --git a/nebula/queries-sf100/interactive-update-6-add-post-place.ngql b/nebula/queries-sf100/interactive-update-6-add-post-place.ngql new file mode 100644 index 000000000..43968025b --- /dev/null +++ b/nebula/queries-sf100/interactive-update-6-add-post-place.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + IS_LOCATED_IN() +VALUES + $postId->$countryId:() diff --git a/nebula/queries-sf100/interactive-update-6-add-post-tags.ngql b/nebula/queries-sf100/interactive-update-6-add-post-tags.ngql new file mode 100644 index 000000000..cdbc0da8a --- /dev/null +++ b/nebula/queries-sf100/interactive-update-6-add-post-tags.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_TAG() +VALUES + $postId->$tagId:() diff --git a/nebula/queries-sf100/interactive-update-6-add-post.ngql b/nebula/queries-sf100/interactive-update-6-add-post.ngql new file mode 100644 index 000000000..216b66e97 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-6-add-post.ngql @@ -0,0 +1,4 @@ +INSERT VERTEX IF NOT EXISTS + Post(creationDate, locationIP, browserUsed, language, content, imageFile, length) +VALUES + $postId:($creationDate, $locationIP, $browserUsed, $language, $content, $imageFile, $length) diff --git a/nebula/queries-sf100/interactive-update-7-add-comment-comment.ngql b/nebula/queries-sf100/interactive-update-7-add-comment-comment.ngql new file mode 100644 index 000000000..c861f1a3c --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment-comment.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + REPLY_OF_COMMENT() +VALUES + $commentId->$replyToCommentId:() diff --git a/nebula/queries-sf100/interactive-update-7-add-comment-person.ngql b/nebula/queries-sf100/interactive-update-7-add-comment-person.ngql new file mode 100644 index 000000000..40303a2f0 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment-person.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + COMMENT_HAS_CREATOR() +VALUES + $commentId->$personId:() diff --git a/nebula/queries-sf100/interactive-update-7-add-comment-place.ngql b/nebula/queries-sf100/interactive-update-7-add-comment-place.ngql new file mode 100644 index 000000000..21a60da50 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment-place.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + IS_LOCATED_IN() +VALUES + $commentId->$countryId:() diff --git a/nebula/queries-sf100/interactive-update-7-add-comment-post.ngql b/nebula/queries-sf100/interactive-update-7-add-comment-post.ngql new file mode 100644 index 000000000..ef40bd1e1 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment-post.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + REPLY_OF_POST() +VALUES + $commentId->$replyToPostId:() diff --git a/nebula/queries-sf100/interactive-update-7-add-comment-tags.ngql b/nebula/queries-sf100/interactive-update-7-add-comment-tags.ngql new file mode 100644 index 000000000..887f8d6c2 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment-tags.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + HAS_TAG() +VALUES + $commentId->$tagId:() diff --git a/nebula/queries-sf100/interactive-update-7-add-comment.ngql b/nebula/queries-sf100/interactive-update-7-add-comment.ngql new file mode 100644 index 000000000..95f9b715b --- /dev/null +++ b/nebula/queries-sf100/interactive-update-7-add-comment.ngql @@ -0,0 +1,4 @@ +INSERT VERTEX IF NOT EXISTS + `Comment`(creationDate, locationIP, browserUsed, content, length) +VALUES + $commentId:($creationDate, $locationIP, $browserUsed, $content, $length) diff --git a/nebula/queries-sf100/interactive-update-8.ngql b/nebula/queries-sf100/interactive-update-8.ngql new file mode 100644 index 000000000..f4170f703 --- /dev/null +++ b/nebula/queries-sf100/interactive-update-8.ngql @@ -0,0 +1,4 @@ +INSERT EDGE IF NOT EXISTS + KNOWS(creationDate) +VALUES + $person1Id->$person2Id:($creationDate)