From c02b1d7e9006e75a70feb1e8b5687bdd64ffa608 Mon Sep 17 00:00:00 2001 From: BingqingLyu Date: Thu, 12 Dec 2024 19:57:27 +0800 Subject: [PATCH] fix(interactive): Update README.md for compiler and experiment queries (#4357) ## What do these changes do? As titled. ## Related issue number Fixes --- .../cypher_queries/experiments/BI1.cypher | 40 ++++++++++++++ .../cypher_queries/experiments/BI10.cypher | 14 +++++ .../cypher_queries/experiments/BI11.cypher | 13 +++++ .../cypher_queries/experiments/BI12.cypher | 10 ++++ .../cypher_queries/experiments/BI13.cypher | 44 ++++++++++++++++ .../cypher_queries/experiments/BI14.cypher | 17 ++++++ .../cypher_queries/experiments/BI16.cypher | 8 +++ .../cypher_queries/experiments/BI17.cypher | 8 +++ .../cypher_queries/experiments/BI18.cypher | 6 +++ .../cypher_queries/experiments/BI2.cypher | 26 ++++++++++ .../cypher_queries/experiments/BI3.cypher | 13 +++++ .../cypher_queries/experiments/BI4.cypher | 25 +++++++++ .../cypher_queries/experiments/BI5.cypher | 20 +++++++ .../cypher_queries/experiments/BI6.cypher | 11 ++++ .../cypher_queries/experiments/BI7.cypher | 12 +++++ .../cypher_queries/experiments/BI8.cypher | 7 +++ .../cypher_queries/experiments/BI9.cypher | 19 +++++++ .../cypher_queries/experiments/IC1.cypher | 52 +++++++++++++++++++ .../cypher_queries/experiments/IC10.cypher | 36 +++++++++++++ .../cypher_queries/experiments/IC11.cypher | 19 +++++++ .../cypher_queries/experiments/IC12.cypher | 17 ++++++ .../cypher_queries/experiments/IC2.cypher | 17 ++++++ .../cypher_queries/experiments/IC3.cypher | 28 ++++++++++ .../cypher_queries/experiments/IC4.cypher | 17 ++++++ .../cypher_queries/experiments/IC5.cypher | 22 ++++++++ .../cypher_queries/experiments/IC6.cypher | 17 ++++++ .../cypher_queries/experiments/IC7.cypher | 23 ++++++++ .../cypher_queries/experiments/IC8.cypher | 14 +++++ .../cypher_queries/experiments/IC9.cypher | 19 +++++++ .../experiments/{gopt => }/Qc1(a).cypher | 0 .../experiments/{gopt => }/Qc1(b).cypher | 0 .../experiments/{gopt => }/Qc2(a).cypher | 0 .../experiments/{gopt => }/Qc2(b).cypher | 0 .../experiments/{gopt => }/Qc3(a).cypher | 0 .../experiments/{gopt => }/Qc3(b).cypher | 0 .../cypher_queries/experiments/Qc4(a).cypher | 7 +++ .../cypher_queries/experiments/Qc4(b).cypher | 7 +++ .../{gopt/Qr5.cypher => Qr1.cypher} | 0 .../cypher_queries/experiments/Qr1.gremlin | 3 ++ .../{gopt/Qr6.cypher => Qr2.cypher} | 0 .../cypher_queries/experiments/Qr2.gremlin | 4 ++ .../{gopt/Qr1.cypher => Qr3.cypher} | 0 .../cypher_queries/experiments/Qr3.gremlin | 1 + .../{gopt/Qr2.cypher => Qr4.cypher} | 0 .../cypher_queries/experiments/Qr4.gremlin | 1 + .../cypher_queries/experiments/Qr5.cypher | 4 ++ .../cypher_queries/experiments/Qr5.gremlin | 7 +++ .../cypher_queries/experiments/Qr6.cypher | 5 ++ .../cypher_queries/experiments/Qr6.gremlin | 6 +++ .../cypher_queries/experiments/Qr7.cypher | 3 ++ .../cypher_queries/experiments/Qr7.gremlin | 3 ++ .../experiments/{gopt => }/Qr8.cypher | 0 .../cypher_queries/experiments/Qr8.gremlin | 3 ++ .../experiments/{gopt => }/Qt1.cypher | 0 .../experiments/{gopt => }/Qt2.cypher | 0 .../experiments/{gopt => }/Qt3.cypher | 0 .../experiments/{gopt => }/Qt4.cypher | 0 .../experiments/{gopt => }/Qt5.cypher | 0 .../experiments/gopt/Qc4(a).cypher | 7 --- .../experiments/gopt/Qc4(b).cypher | 7 --- .../experiments/gopt/Qr3.cypher | 2 - .../experiments/gopt/Qr4.cypher | 2 - .../experiments/gopt/Qr7.cypher | 3 -- .../experiments/neo4j/Qc1(a).cypher | 4 -- .../experiments/neo4j/Qc1(b).cypher | 4 -- .../experiments/neo4j/Qc2(a).cypher | 5 -- .../experiments/neo4j/Qc2(b).cypher | 5 -- .../experiments/neo4j/Qc3(a).cypher | 5 -- .../experiments/neo4j/Qc3(b).cypher | 4 -- .../experiments/neo4j/Qc4(a).cypher | 7 --- .../experiments/neo4j/Qc4(b).cypher | 7 --- .../experiments/neo4j/Qr1.cypher | 3 -- .../experiments/neo4j/Qr2.cypher | 5 -- .../experiments/neo4j/Qr3.cypher | 1 - .../experiments/neo4j/Qr4.cypher | 1 - .../experiments/neo4j/Qt1.cypher | 1 - .../experiments/neo4j/Qt2.cypher | 1 - .../experiments/neo4j/Qt3.cypher | 1 - .../experiments/neo4j/Qt4.cypher | 3 -- .../experiments/neo4j/Qt5.cypher | 1 - interactive_engine/compiler/README.md | 34 ++++++++++++ 81 files changed, 662 insertions(+), 79 deletions(-) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI1.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI10.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI11.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI12.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI13.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI14.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI16.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI17.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI18.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI2.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI3.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI4.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI5.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI6.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI7.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI8.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/BI9.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC1.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC10.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC11.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC12.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC2.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC3.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC4.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC5.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC6.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC7.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC8.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/IC9.cypher rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc1(a).cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc1(b).cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc2(a).cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc2(b).cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc3(a).cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qc3(b).cypher (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(a).cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(b).cypher rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt/Qr5.cypher => Qr1.cypher} (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.gremlin rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt/Qr6.cypher => Qr2.cypher} (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.gremlin rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt/Qr1.cypher => Qr3.cypher} (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.gremlin rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt/Qr2.cypher => Qr4.cypher} (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.gremlin create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.gremlin create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.gremlin create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.cypher create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.gremlin rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qr8.cypher (100%) create mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.gremlin rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qt1.cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qt2.cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qt3.cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qt4.cypher (100%) rename interactive_engine/benchmark/queries/cypher_queries/experiments/{gopt => }/Qt5.cypher (100%) delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(a).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(b).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr3.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr4.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr7.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(a).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(b).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(a).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(b).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(a).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(b).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(a).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(b).cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr1.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr2.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr3.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr4.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt1.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt2.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt3.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt4.cypher delete mode 100644 interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt5.cypher create mode 100644 interactive_engine/compiler/README.md diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI1.cypher new file mode 100644 index 000000000000..b43ca43e5448 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI1.cypher @@ -0,0 +1,40 @@ +MATCH (message:COMMENT) +WHERE message.creationDate < $datetime +WITH count(message) AS totalMessageCount + +MATCH (message:COMMENT) +WHERE message.creationDate < $datetime +AND message.length > 0 +WITH + totalMessageCount, + message, + date(datetime({epochMillis: message.creationDate})) AS date +WITH + totalMessageCount, + date.year AS year, + CASE + WHEN 'POST' in labels(message) THEN 0 + ELSE 1 + END AS isComment, + CASE + WHEN message.length < 40 THEN 0 + WHEN message.length < 80 THEN 1 + WHEN message.length < 160 THEN 2 + ELSE 3 + END AS lengthCategory, + count(message) AS messageCount, + sum(message.length) / count(message) AS averageMessageLength, + count(message.length) AS sumMessageLength + +RETURN + year, + isComment, + lengthCategory, + messageCount, + averageMessageLength, + sumMessageLength, + messageCount / totalMessageCount AS percentageOfMessages + ORDER BY + year DESC, + isComment ASC, + lengthCategory ASC; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI10.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI10.cypher new file mode 100644 index 000000000000..f866c6672629 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI10.cypher @@ -0,0 +1,14 @@ +MATCH (p1:PERSON {id : $personId})-[:KNOWS*1..4]-(expert:PERSON), + (expert)-[:ISLOCATEDIN]->(:PLACE)-[:ISPARTOF]->(country:PLACE {name: $country}), + (expert)<-[:HASCREATOR]-(message)-[:HASTAG]->(:TAG)-[:HASTYPE]->(:TAGCLASS {name: $tagClass}) +WITH DISTINCT expert, message +MATCH (message)-[:HASTAG]->(tag:TAG) +RETURN + expert.id as id, + tag.name as name, + count(message) AS messageCount +ORDER BY + messageCount DESC, + name ASC, + id ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI11.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI11.cypher new file mode 100644 index 000000000000..dbaa9b4d87dc --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI11.cypher @@ -0,0 +1,13 @@ +MATCH (a:PERSON)-[:ISLOCATEDIN]->(:PLACE)-[:ISPARTOF]->(country:PLACE {name: $country}), + (b)-[:ISLOCATEDIN]->(:PLACE)-[:ISPARTOF]->(country), + (c)-[:ISLOCATEDIN]->(:PLACE)-[:ISPARTOF]->(country), + (a)-[k1:KNOWS]-(b:PERSON), + (b)-[k2:KNOWS]-(c:PERSON), + (c)-[k3:KNOWS]-(a) +WHERE a.id < b.id + AND b.id < c.id + AND $startDate <= k1.creationDate AND k1.creationDate <= $endDate + AND $startDate <= k2.creationDate AND k2.creationDate <= $endDate + AND $startDate <= k3.creationDate AND k3.creationDate <= $endDate +WITH DISTINCT country, a, b +RETURN count(*) AS count; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI12.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI12.cypher new file mode 100644 index 000000000000..be0a0fa7855f --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI12.cypher @@ -0,0 +1,10 @@ +MATCH (person:PERSON)<-[:HASCREATOR]-(message), + (message)-[:REPLYOF * 0..30]->(post:POST) +WHERE message.length < $lengthThreshold + AND message.creationDate > $startDate + AND post.language IN languages +WITH person, count(message) as msgCnt +RETURN msgCnt, count(person) as personCnt +ORDER BY + personCnt DESC, + msgCnt DESC; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI13.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI13.cypher new file mode 100644 index 000000000000..ba813dc7befe --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI13.cypher @@ -0,0 +1,44 @@ +MATCH (country:PLACE {name: $country})<-[:ISPARTOF]-(:PLACE)<-[:ISLOCATEDIN]-(zombie:PERSON) +WHERE zombie.creationDate < $endDate +OPTIONAL MATCH (zombie)<-[:HASCREATOR]-(message) +WHERE message.creationDate < $endDate +WITH + country, + zombie, + date(datetime({epochMillis: $endDate})) as idate, + date(datetime({epochMillis: zombie.creationDate})) as zdate, + count(message) AS messageCount +WITH + country, + zombie, + 12 * (idate.year - zdate.year ) + + (idate.month - zdate.month) + + 1 AS months, + messageCount +WHERE messageCount / months < 1 +WITH + country, + collect(zombie) AS zombies +UNWIND zombies AS zombie +MATCH // Match1 + (zombie)<-[:HASCREATOR]-()<-[:LIKES]-(likerZombie:PERSON) +WHERE likerZombie IN zombies +MATCH // Match2 + (zombie)<-[:HASCREATOR]-()<-[:LIKES]-(likerPerson:PERSON) +WHERE likerPerson.creationDate < $endDate +WITH + zombie, + count(distinct likerZombie) AS zombieLikeCount, // Aggregate1 + count(distinct likerPerson) AS totalLikeCount // Aggregate2 +RETURN + zombie.id AS zid, + zombieLikeCount, + totalLikeCount, + CASE totalLikeCount + WHEN 0 THEN 0.0 + ELSE zombieLikeCount / totalLikeCount + END AS zombieScore +ORDER BY + zombieScore DESC, + zid ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI14.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI14.cypher new file mode 100644 index 000000000000..dce89ab3c336 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI14.cypher @@ -0,0 +1,17 @@ +MATCH + (country1:PLACE {name: $country1})<-[:ISPARTOF]-(city1:PLACE)<-[:ISLOCATEDIN]-(person1:PERSON), + (country2:PLACE {name: $country2})<-[:ISPARTOF]-(city2:PLACE)<-[:ISLOCATEDIN]-(person2:PERSON), + (person1)-[knows:KNOWS]-(person2) +// Match1 +MATCH (person1)<-[:HASCREATOR]-(c:COMMENT)-[:REPLYOF]->()-[:HASCREATOR]->(person2:PERSON) +WITH person1, person2, city1, 4 as score1 +// Match2 +MATCH (person1)-[:LIKES]->(m)-[:HASCREATOR]->(person2) +WITH person1, person2, city1, score1, 10 as score2 +WITH + person1, + person2, + city1, + sum(distinct score1) as score1, // Aggregate1 + sum(distinct score2) as score2 // Aggregate2 +RETURN count(*); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI16.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI16.cypher new file mode 100644 index 000000000000..ee047b7f8543 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI16.cypher @@ -0,0 +1,8 @@ +MATCH (person1:PERSON)<-[:HASCREATOR]-(message1)-[:HASTAG]->(tag:TAG {name: $tagName}) +WHERE message1.creationDate > $date +OPTIONAL MATCH (person1)-[:KNOWS]-(person2:PERSON)<-[:HASCREATOR]-(message2)-[:HASTAG]->(tag) +WHERE message2.creationDate = $date +WITH person1, count(DISTINCT message1) AS cm, count(DISTINCT person2) AS cp2 +WHERE cp2 <= 4 +// return count +RETURN person1, cm; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI17.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI17.cypher new file mode 100644 index 000000000000..c9f75979beb4 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI17.cypher @@ -0,0 +1,8 @@ +MATCH + (comment)-[:HASTAG]->(tag:TAG {name: $tag}), + (comment)-[:REPLYOF]->(message2), + (message2)-[:HASTAG]->(tag), + (message1)-[:HASTAG]->(tag:TAG {name: $tag}), + (message1)-[:REPLYOF*0..10]->(post1:POST)<-[:CONTAINEROF]-(forum1:FORUM), + (forum1)-[:HASMEMBER]->(person3:PERSON)<-[:HASCREATOR]-(message2) +RETURN count(*); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI18.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI18.cypher new file mode 100644 index 000000000000..e35d58a141d0 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI18.cypher @@ -0,0 +1,6 @@ +MATCH (tag:TAG {name: $tag})<-[:HASINTEREST]-(person1:PERSON)-[:KNOWS]-(mutualFriend:PERSON)-[:KNOWS]-(person2:PERSON)-[:HASINTEREST]->(tag2 {name: $tag}) +WHERE person1 <> person2 + AND NOT (person1)-[:KNOWS]-(person2) +RETURN person1.id AS person1Id, person2.id AS person2Id, count(DISTINCT mutualFriend) AS mutualFriendCount +ORDER BY mutualFriendCount DESC, person1Id ASC, person2Id ASC +LIMIT 20; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI2.cypher new file mode 100644 index 000000000000..bf692b8b435d --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI2.cypher @@ -0,0 +1,26 @@ +MATCH (tag:TAG)-[:HASTYPE]->(:TAGCLASS {name: $tagClass}), (tag:TAG)<-[:HASTAG]-(message) +WITH + tag, + CASE + WHEN message.creationDate < $dateEnd1 + AND message.creationDate >= $date THEN 1 + ELSE 0 + END AS count1, + CASE + WHEN message.creationDate < $dateEnd2 + AND message.creationDate >= $dateEnd1 THEN 1 + ELSE 0 + END AS count2 +WITH + tag, + sum(count1) AS countWindow1, + sum(count2) AS countWindow2 +RETURN + tag.name as name, + countWindow1, + countWindow2, + abs(countWindow1 - countWindow2) AS diff +ORDER BY +diff DESC, +name ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI3.cypher new file mode 100644 index 000000000000..e82ef50a581c --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI3.cypher @@ -0,0 +1,13 @@ +MATCH + (country:PLACE {name: $country})<-[:ISPARTOF]-()<-[:ISLOCATEDIN]- + (person:PERSON)<-[:HASMODERATOR]-(forum:FORUM)-[:CONTAINEROF]->(post:POST)<-[:REPLYOF*0..30]-(message)-[:HASTAG]->(:TAG)-[:HASTYPE]->(:TAGCLASS {name: $tagClass}) +RETURN + forum.id as id, + forum.title, + forum.creationDate, + person.id as personId, + count(DISTINCT message) AS messageCount + ORDER BY + messageCount DESC, + id ASC + LIMIT 20; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI4.cypher new file mode 100644 index 000000000000..e339ad7402e0 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI4.cypher @@ -0,0 +1,25 @@ +MATCH (country:PLACE)<-[:ISPARTOF]-(:PLACE)<-[:ISLOCATEDIN]-(person:PERSON)<-[:HASMEMBER]-(forum:FORUM) +WHERE forum.creationDate > $date +WITH country, forum, count(person) AS numberOfMembers +ORDER BY numberOfMembers DESC, forum.id ASC, country.id +WITH DISTINCT forum AS topForum +LIMIT 100 + +WITH collect(topForum) AS topForums + +UNWIND topForums AS topForum2 +MATCH (topForum1)-[:CONTAINEROF]->(post:POST)<-[:REPLYOF*0..30]-(message)-[:HASCREATOR]->(person:PERSON)<-[:HASMEMBER]-(topForum2:FORUM) +WITH person, message, topForum1 +WHERE topForum1 IN topForums +WITH person, count(DISTINCT message) AS messageCount + +RETURN + person.id AS personId, + person.firstName AS personFirstName, + person.lastName AS personLastName, + person.creationDate AS personCreationDate, + sum(messageCount) AS messageCount +ORDER BY + messageCount DESC, + person.id ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI5.cypher new file mode 100644 index 000000000000..ba069a89352d --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI5.cypher @@ -0,0 +1,20 @@ +Match (tag:TAG {name: $tag})<-[:HASTAG]-(message) +OPTIONAL MATCH (message)<-[:LIKES]-(liker:PERSON) +OPTIONAL MATCH (message)<-[:REPLYOF]-(comment:COMMENT) +MATCH (message)-[:HASCREATOR]->(person:PERSON) +WITH message, person, count(distinct liker) as likeCount, count(distinct comment) as replyCount +WITH + person.id AS id, + sum(replyCount) as replyCount, + sum(likeCount) as likeCount, + count(message) as messageCount +RETURN + id, + replyCount, + likeCount, + messageCount, + 1*messageCount + 2*replyCount + 10*likeCount AS score +ORDER BY + score DESC, + id ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI6.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI6.cypher new file mode 100644 index 000000000000..790c11f98a2f --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI6.cypher @@ -0,0 +1,11 @@ +MATCH (tag:TAG {name: $tag})<-[:HASTAG]-(message1)-[:HASCREATOR]->(person1:PERSON), + (message1)<-[:LIKES]-(person2:PERSON), + (person2)<-[:HASCREATOR]-(message2)<-[like:LIKES]-(person3:PERSON) +RETURN + person1.id, + // Using 'DISTINCT like' here ensures that each person2's popularity score is only added once for each person1 + count(DISTINCT like) AS authorityScore +ORDER BY + authorityScore DESC, + person1.id ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI7.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI7.cypher new file mode 100644 index 000000000000..97ece1da7c6e --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI7.cypher @@ -0,0 +1,12 @@ +MATCH + (tag:TAG {name: $tag})<-[:HASTAG]-(message:COMMENT), + (message)<-[:REPLYOF]-(comment:COMMENT), + (comment:COMMENT)-[:HASTAG]->(relatedTag:TAG) +WHERE NOT (comment:COMMENT)-[:HASTAG]->(tag:TAG {name: $tag}) +RETURN + relatedTag.name as name, + count(DISTINCT comment) AS count +ORDER BY + count DESC, + name ASC +LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI8.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI8.cypher new file mode 100644 index 000000000000..a8c63514cf65 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI8.cypher @@ -0,0 +1,7 @@ +MATCH (tag:TAG {name: $tag}) +// score +OPTIONAL MATCH (tag)<-[interest:HASINTEREST]-(person:PERSON) +OPTIONAL MATCH (tag)<-[:HASTAG]-(message)-[:HASCREATOR]->(person:PERSON) +WHERE $startDate < message.creationDate + AND message.creationDate < $endDate +RETURN tag, count(person) AS totalCount; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/BI9.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI9.cypher new file mode 100644 index 000000000000..753336cd49e2 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/BI9.cypher @@ -0,0 +1,19 @@ +MATCH + (person:PERSON)<-[:HASCREATOR]-(post:POST)<-[:REPLYOF*0..7]-(message) +WHERE + post.creationDate >= $startDate AND post.creationDate <= $endDate AND + message.creationDate >= $startDate AND message.creationDate <= $endDate +WITH + person, + count(distinct post) as threadCnt, + count(message) as msgCnt +RETURN + person.id as id, + person.firstName, + person.lastName, + threadCnt, + msgCnt + ORDER BY + msgCnt DESC, + id ASC + LIMIT 100; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC1.cypher new file mode 100644 index 000000000000..bf378b9f488a --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC1.cypher @@ -0,0 +1,52 @@ +MATCH k = shortestPath((p: PERSON{id: $personId})-[:KNOWS*1..4]-(f: PERSON {firstName: $firstName})) +MATCH (f:PERSON)-[:ISLOCATEDIN]->(locationCity:PLACE) + +WHERE + p <> f + +OPTIONAL MATCH (f: PERSON)-[workAt:WORKAT]->(company:ORGANISATION)-[:ISLOCATEDIN]->(country:PLACE) +// append one new column +WITH + f, k, locationCity, + CASE + WHEN company is null Then null + ELSE [company.name, workAt.workFrom, country.name] + END as companies + +WITH f, k, locationCity, collect(companies) as company_info + +OPTIONAL MATCH (f: PERSON)-[studyAt:STUDYAT]->(university)-[:ISLOCATEDIN]->(universityCity:PLACE) +// append one new column +WITH f, k, locationCity, company_info, + CASE + WHEN university is null Then null + ELSE [university.name, studyAt.classYear, universityCity.name] + END as universities + +WITH f, k, locationCity, company_info, collect(universities) as university_info + +// apend one new column +WITH + f, + k, + locationCity, + company_info, + university_info, + length(k) as distance + +ORDER BY distance ASC, f.lastName ASC, f.id ASC +LIMIT 20 + +return f.id AS friendId, + f.lastName AS friendLastName, + distance AS distanceFromPerson, + f.birthday AS friendBirthday, + f.creationDate AS friendCreationDate, + f.gender AS friendGender, + f.browserUsed AS friendBrowserUsed, + f.locationIP AS friendLocationIp, + f.email AS friendEmail, + f.language AS friendLanguage, + locationCity.name AS friendCityName, + university_info AS friendUniversities, + company_info AS friendCompanies; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC10.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC10.cypher new file mode 100644 index 000000000000..dc727f2a7179 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC10.cypher @@ -0,0 +1,36 @@ +MATCH (person:PERSON {id: $personId})-[:KNOWS*2..3]-(friend: PERSON) +OPTIONAL MATCH (friend : PERSON)<-[:HASCREATOR]-(post:POST) +OPTIONAL MATCH (friend)<-[:HASCREATOR]-(post1:POST)-[:HASTAG]->(tag:TAG)<-[:HASINTEREST]-(person: PERSON {id: $personId}) + +// Anti-Pattern +WHERE + NOT friend=person + AND NOT (friend:PERSON)-[:KNOWS]-(person :PERSON {id: $personId}) + +WITH + person, + friend, + post, + post1, + date(datetime({epochMillis: friend.birthday})) as birthday + +// datetime(friend.birthday) as birthday + +WHERE (birthday.month=$month AND birthday.day>=21) OR + (birthday.month=($month%12)+1 AND birthday.day<22) + +// Aggregate +WITH friend, count(distinct post) as postCount, count(distinct post1) as commonPostCount + +WITH friend, commonPostCount - (postCount - commonPostCount) AS commonInterestScore +ORDER BY commonInterestScore DESC, friend.id ASC +LIMIT 10 + +MATCH (friend:PERSON)-[:ISLOCATEDIN]->(city:PLACE) + +RETURN friend.id AS personId, + friend.firstName AS personFirstName, + friend.lastName AS personLastName, + commonInterestScore, + friend.gender AS personGender, + city.name AS personCityName; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC11.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC11.cypher new file mode 100644 index 000000000000..4f4e440552eb --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC11.cypher @@ -0,0 +1,19 @@ +MATCH (p:PERSON {id: $personId})-[:KNOWS*1..3]-(friend:PERSON), + (friend:PERSON)-[wa:WORKAT]->(com:ORGANISATION)-[:ISLOCATEDIN]->(:PLACE {name: $countryName}) +WHERE p <> friend + AND wa.workFrom < $workFromYear + +WITH DISTINCT friend as friend, + com AS com, + wa.workFrom as organizationWorkFromYear + +ORDER BY + organizationWorkFromYear ASC, + friend.id ASC, com.name DESC +LIMIT 10 +return + friend.id AS personId, + friend.firstName AS personFirstName, + friend.lastName AS personLastName, + com.name as organizationName, + organizationWorkFromYear as organizationWorkFromYear; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC12.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC12.cypher new file mode 100644 index 000000000000..57596896d5f4 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC12.cypher @@ -0,0 +1,17 @@ +MATCH + (unused:PERSON {id: $personId })-[:KNOWS]-(friend:PERSON)<-[:HASCREATOR]-(comments:COMMENT)-[:REPLYOF]->(:POST)-[:HASTAG]->(tags:TAG), + (tags:TAG)-[:HASTYPE]->(:TAGCLASS)-[:ISSUBCLASSOF*0..10]->(:TAGCLASS {name: $tagClassName}) +WITH + friend AS friend, + collect(DISTINCT tags.name) AS tagNames, + count(DISTINCT comments) AS replyCount +ORDER BY + replyCount DESC, + friend.id ASC +LIMIT 20 +RETURN + friend.id AS personId, + friend.firstName AS personFirstName, + friend.lastName AS personLastName, + tagNames, + replyCount \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC2.cypher new file mode 100644 index 000000000000..0f7aa8814cb3 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC2.cypher @@ -0,0 +1,17 @@ +MATCH (p :PERSON {id: $personId})-[:KNOWS]-(friend:PERSON)<-[:HASCREATOR]-(message) +WHERE + message.creationDate <= $maxDate +WITH + friend, + message +ORDER BY + message.creationDate DESC, + message.id ASC LIMIT 20 +return + friend.id AS personId, + friend.firstName AS personFirstName, + friend.lastName AS personLastName, + message.id AS postOrCommentId, + message.content AS content, + message.imageFile AS imageFile, + message.creationDate AS postOrCommentCreationDate; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC3.cypher new file mode 100644 index 000000000000..f5f483c1250a --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC3.cypher @@ -0,0 +1,28 @@ +MATCH + (p:PERSON {id: $personId})-[:KNOWS*1..3]-(otherP:PERSON) +MATCH (country:PLACE)<-[:ISLOCATEDIN]-(message)-[:HASCREATOR]->(otherP:PERSON)-[ISLOCATEDIN]->(city:PLACE)-[:ISPARTOF]-> (country2:PLACE) +WHERE + otherP.id<> $personId + AND (country.name = $countryXName OR country.name = $countryYName) + AND (country2.name <> $countryXName AND country2.name <> $countryYName) + AND message.creationDate >= $startDate + AND message.creationDate < $endDate +WITH + DISTINCT + message, + otherP, + country + +WITH otherP, + CASE WHEN country.name=$countryXName THEN 1 ELSE 0 END AS messageX, + CASE WHEN country.name=$countryYName THEN 1 ELSE 0 END AS messageY +WITH otherP, sum(messageX) AS xCount, sum(messageY) AS yCount +WHERE xCount > 0 AND yCount > 0 +RETURN + otherP.id as id, + otherP.firstName as firstName, + otherP.lastName as lastName, + xCount, + yCount, + xCount + yCount as total +ORDER BY total DESC, id ASC LIMIT 20; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC4.cypher new file mode 100644 index 000000000000..096916c2f243 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC4.cypher @@ -0,0 +1,17 @@ +MATCH (person:PERSON {id: $personId})-[:KNOWS]-(friend:PERSON)<-[:HASCREATOR]-(post:POST)-[:HASTAG]->(tag: TAG) +WITH DISTINCT tag, post +WITH tag, + CASE + WHEN post.creationDate < $endDate AND post.creationDate >= $startDate THEN 1 + ELSE 0 + END AS valid, + CASE + WHEN $startDate > post.creationDate THEN 1 + ELSE 0 + END AS inValid +WITH tag, sum(valid) AS postCount, sum(inValid) AS inValidPostCount +WHERE postCount>0 AND inValidPostCount=0 + +RETURN tag.name AS tagName, postCount +ORDER BY postCount DESC, tagName ASC +LIMIT 10; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC5.cypher new file mode 100644 index 000000000000..7b6a0727ae13 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC5.cypher @@ -0,0 +1,22 @@ +MATCH (person:PERSON { id: $personId })-[:KNOWS*1..3]-(friend), + (friend)<-[membership:HASMEMBER]-(forum) +OPTIONAL MATCH (friend)<-[:HASCREATOR]-(post)<-[:CONTAINEROF]-(forum) +WHERE + NOT friend.id = $personId + AND membership.joinDate > $minDate +WITH + DISTINCT + friend AS friend, + forum AS forum, + post as post + +WITH + forum, + count(post) AS postCount +ORDER BY + postCount DESC, + forum.id ASC +LIMIT 20 +RETURN + forum.title AS forumName, + postCount; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC6.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC6.cypher new file mode 100644 index 000000000000..8aa2b01d0830 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC6.cypher @@ -0,0 +1,17 @@ +MATCH (p_:PERSON {id: $personId})-[:KNOWS*1..3]-(other:PERSON), + (other)<-[:HASCREATOR]-(p:POST)-[:HASTAG]->(t:TAG {name: $tagName}), + (p:POST)-[:HASTAG]->(otherTag:TAG) + +WHERE other.id <> $personId AND otherTag <> t + +WITH DISTINCT + otherTag, + p + +RETURN + otherTag.name as name, + count(p) as postCnt +ORDER BY + postCnt desc, + name asc +LIMIT 10; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC7.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC7.cypher new file mode 100644 index 000000000000..c3bdea288f40 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC7.cypher @@ -0,0 +1,23 @@ + MATCH (person:PERSON {id: $personId})<-[:HASCREATOR]-(message)<-[like:LIKES]-(liker:PERSON) + OPTIONAL MATCH (liker: PERSON)-[k:KNOWS]-(p2: PERSON {id: $personId}) + WITH liker, message, like.creationDate AS likeTime, person, + CASE + WHEN k is null THEN true + ELSE false + END AS isNew + ORDER BY likeTime DESC, message.id ASC + WITH liker, person, head(collect(message)) as message, head(collect(likeTime)) AS likeTime, isNew + RETURN + liker.id AS personId, + liker.firstName AS personFirstName, + liker.lastName AS personLastName, + likeTime AS likeCreationDate, + message.id AS commentOrPostId, + message.content AS messageContent, + message.imageFile AS messageImageFile, + (likeTime - message.creationDate)/1000/60 AS minutesLatency, + isNew + ORDER BY + likeCreationDate DESC, + personId ASC + LIMIT 20; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC8.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC8.cypher new file mode 100644 index 000000000000..71c8d15659b5 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC8.cypher @@ -0,0 +1,14 @@ +MATCH(p:PERSON {id: $personId}) <-[:HASCREATOR] -(msg) <- [:REPLYOF] - (cmt: COMMENT) - [:HASCREATOR] -> (author : PERSON) +WITH + p, msg, cmt, author +ORDER BY + cmt.creationDate DESC, + cmt.id ASC +LIMIT 20 +RETURN + author.id, + author.firstName, + author.lastName, + cmt.creationDate, + cmt.id, + cmt.content; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/IC9.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC9.cypher new file mode 100644 index 000000000000..a2e5d30ba94d --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/IC9.cypher @@ -0,0 +1,19 @@ +MATCH (p:PERSON {id: $personId})-[:KNOWS*1..3]-(friend:PERSON) +MATCH (message)-[:HASCREATOR]->(friend:PERSON) +where message.creationDate < $maxDate + AND friend.id <> $personId + +WITH DISTINCT friend, message + +RETURN + friend.id AS personId, + friend.firstName AS personFirstName, + friend.lastName AS personLastName, + message.id AS commentOrPostId, + message.content AS messageContent, + message.imageFile AS messageImageFile, + message.creationDate AS commentOrPostCreationDate +ORDER BY + commentOrPostCreationDate DESC, + commentOrPostId ASC +LIMIT 20; \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc1(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc1(a).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc1(a).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc1(a).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc1(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc1(b).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc1(b).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc1(b).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc2(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc2(a).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc2(a).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc2(a).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc2(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc2(b).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc2(b).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc2(b).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc3(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc3(a).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc3(a).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc3(a).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc3(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc3(b).cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc3(b).cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qc3(b).cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(a).cypher new file mode 100644 index 000000000000..a8e2e91696c0 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(a).cypher @@ -0,0 +1,7 @@ +Match (c:PLACE {name: $name})<-[:ISLOCATEDIN]-(p1:PERSON), + (c)<-[:ISLOCATEDIN]-(p2:PERSON), + (p1)<-[:HASCREATOR]-(m1:COMMENT)<-[:LIKES]->(p2:PERSON), + (c:PLACE {name: $name})<-[:ISLOCATEDIN]-(p3:PERSON), + (c)<-[:ISLOCATEDIN]-(p4:PERSON), + (p3)<-[:HASCREATOR]-(m2:COMMENT)<-[:LIKES]->(p4:PERSON) +RETURN count(c) \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(b).cypher new file mode 100644 index 000000000000..3aaaa5989227 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qc4(b).cypher @@ -0,0 +1,7 @@ +Match (c:PLACE {name: $name})<-[:ISLOCATEDIN]-(p1:PERSON), + (c)<-[:ISLOCATEDIN]-(p2:PERSON), + (p1)<-[:HASCREATOR]-(m1:COMMENT)<-[:LIKES]->(p2:PERSON), + (c:PLACE {name: $name})<-[:ISLOCATEDIN]-(p3:PERSON), + (c)<-[:ISLOCATEDIN]-(p4:PERSON), + (p3)-[:KNOWS|HASMODERATOR]-(m2:FORUM|PERSON)-[:KNOWS|HASMODERATOR]-(p4:PERSON) +RETURN count(c) \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr5.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.gremlin new file mode 100644 index 000000000000..a812f447c1c5 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr1.gremlin @@ -0,0 +1,3 @@ +g.V().match( + __.as('p1').hasLabel('PERSON').out('KNOWS').hasLabel('PERSON').as('p2') +).select('p1').has('id', $id1).select('p2').has('id', $id2).count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr6.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr6.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.gremlin new file mode 100644 index 000000000000..97b8a42c17a7 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr2.gremlin @@ -0,0 +1,4 @@ +g.V().match( + __.as('p1').hasLabel('PERSON').out('KNOWS').as('p2'), + __.as('p2').out('LIKES').hasLabel('COMMENT').as('c1')). +select('p1').has('id', $id1).select('p2').has('id', $id2).select('c1').has('length', P.gt($len)).count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr1.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.gremlin new file mode 100644 index 000000000000..6028e32c5b87 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr3.gremlin @@ -0,0 +1 @@ +g.V().hasLabel('FORUM').as('forum').out('CONTAINEROF').as('c1').in('REPLYOF').as('r1').out('HASCREATOR').as('h1').select('forum').out('HASMEMBER').as('h2').count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr2.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.gremlin new file mode 100644 index 000000000000..b8c93bd1f806 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr4.gremlin @@ -0,0 +1 @@ +g.V().hasLabel('PLACE').as('p1').in('ISLOCATEDIN').as('i1').in('HASCREATOR').hasLabel('COMMENT').as('c1').in('LIKES', 'REPLYOF').as('r1').out('HASTAG', 'HASINTEREST').as('h1').count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.cypher new file mode 100644 index 000000000000..e318e289dfdd --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.cypher @@ -0,0 +1,4 @@ +MATCH (p: PERSON{id: $personId})-[k:KNOWS*1..4]-(f: PERSON {firstName: $firstName}) +WITH f, p +MATCH (f: PERSON {firstName: $firstName})-[:ISLOCATEDIN]->(locationCity:PLACE) +RETURN count(p); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.gremlin new file mode 100644 index 000000000000..76d061578b7c --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr5.gremlin @@ -0,0 +1,7 @@ +g.V(). +match( + __.as('p').has('PERSON', 'id', 6592).out('KNOWS').out('KNOWS').out('KNOWS').has('PERSON', 'firstName', 'Mikhail').as('f') +).select('f').as('f').select('p').as('p'). +match( + __.as('f').out('ISLOCATEDIN').as('e2') +).count(f); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.cypher new file mode 100644 index 000000000000..d8b97cccb8aa --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.cypher @@ -0,0 +1,5 @@ +MATCH (p: PERSON)-[k:KNOWS]-(f: PERSON) +WITH f +LIMIT 1000 +MATCH (f:PERSON)-[:ISLOCATEDIN]->(locationCity:PLACE) +RETURN count(f); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.gremlin new file mode 100644 index 000000000000..7f4520ca845d --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr6.gremlin @@ -0,0 +1,6 @@ +g.V().match( + __.as('p').hasLabel('PERSON').out('KNOWS').hasLabel('PERSON').as('f') +).select('f').as('f').limit(1000). +match( + __.as('f').out('ISLOCATEDIN').as('p') +).count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.cypher new file mode 100644 index 000000000000..5fd54d184b81 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.cypher @@ -0,0 +1,3 @@ +Match (p1: PERSON {id:$id})-[:KNOWS*3..4]->(:PERSON) +UNION (p1: PERSON {id:$id})-[:KNOWS*4..5]->(:PERSON), +Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.gremlin new file mode 100644 index 000000000000..769ee91e4838 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr7.gremlin @@ -0,0 +1,3 @@ +g.V().union( + has('PERSON', 'id', $id).out('3..4', 'KNOWS').hasLabel('PERSON'), + has('PERSON', 'id', $id).out('4..5', 'KNOWS').hasLabel('PERSON')).count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr8.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr8.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.gremlin b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.gremlin new file mode 100644 index 000000000000..2898411049d3 --- /dev/null +++ b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qr8.gremlin @@ -0,0 +1,3 @@ +g.V().union( + has('PERSON', 'id', $id).out('4..5', 'KNOWS').hasLabel('PERSON'), + has('PERSON', 'id', $id).out('5..6', 'KNOWS').hasLabel('PERSON')).count() \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qt1.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt1.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qt1.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qt2.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt2.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qt2.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qt3.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt3.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qt3.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qt4.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt4.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qt4.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/Qt5.cypher similarity index 100% rename from interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qt5.cypher rename to interactive_engine/benchmark/queries/cypher_queries/experiments/Qt5.cypher diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(a).cypher deleted file mode 100644 index 25e085e2afa2..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(a).cypher +++ /dev/null @@ -1,7 +0,0 @@ -Match (forum:FORUM)-[:CONTAINEROF]->(post:POST), -(forum:FORUM)-[:HASMEMBER]->(person1:PERSON), -(forum:FORUM)-[:HASMEMBER]->(person2:PERSON), -(person1:PERSON)-[:KNOWS]->(person2:PERSON), -(person1:PERSON)-[:LIKES]->(post:POST), -(person2:PERSON)-[:LIKES]->(post:POST) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(b).cypher deleted file mode 100644 index f77da135517e..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qc4(b).cypher +++ /dev/null @@ -1,7 +0,0 @@ -Match (forum:FORUM)-[:HASTAG]->(post:TAG), -(forum:FORUM)-[:HASMODERATOR]->(person1:PERSON), -(forum:FORUM)-[:HASMODERATOR|CONTAINEROF]->(person2:PERSON|POST), -(person1:PERSON)-[:KNOWS|LIKES]->(person2:PERSON|POST), -(person1:PERSON)-[:HASINTEREST]->(post:TAG), -(person2:PERSON|POST)-[:HASINTEREST|HASTAG]->(post:TAG) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr3.cypher deleted file mode 100644 index 8ab6bc52abf1..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr3.cypher +++ /dev/null @@ -1,2 +0,0 @@ -Match (author:PERSON)<-[:HASCREATOR]-(msg1:POST|COMMENT) -Return count(author); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr4.cypher deleted file mode 100644 index cab0b9fd3181..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr4.cypher +++ /dev/null @@ -1,2 +0,0 @@ -Match (author:PERSON)<-[:HASCREATOR]-(msg1:POST|COMMENT)<-[:REPLYOF]-(msg2:POST|COMMENT) -Return count(author); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr7.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr7.cypher deleted file mode 100644 index 4c6be7d078c6..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/gopt/Qr7.cypher +++ /dev/null @@ -1,3 +0,0 @@ -Match (p1: PERSON {id:1243})-[:KNOWS*3..4]->(:PERSON) -UNION (p1: PERSON {id:1243})-[:KNOWS*4..5]->(:PERSON), -Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(a).cypher deleted file mode 100644 index f0602e726e02..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(a).cypher +++ /dev/null @@ -1,4 +0,0 @@ -Match (message:Post)-[:HAS_CREATOR]->(person), - (message:Post)-[:HAS_TAG]->(tag:Tag), - (person)-[:HAS_INTEREST]->(tag:Tag) -Return count(person); diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(b).cypher deleted file mode 100644 index a0330fee7c19..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc1(b).cypher +++ /dev/null @@ -1,4 +0,0 @@ -Match (message)-[:KNOWS|HAS_MODERATOR]->(person:Person), - (message)-[]->(tag:Tag), - (person)-[]->(tag) -Return count(person); diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(a).cypher deleted file mode 100644 index 7095af2b83ea..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(a).cypher +++ /dev/null @@ -1,5 +0,0 @@ -Match (person1:Person)-[:LIKES]->(message:Post), - (message:Post)<-[:CONTAINER_OF]-(person2:Forum), - (person1:Person)-[:KNOWS]->(place), - (person2:Forum)-[:HAS_MODERATOR]->(place) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(b).cypher deleted file mode 100644 index 40900bd64928..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc2(b).cypher +++ /dev/null @@ -1,5 +0,0 @@ -Match (person1:Person)-[:LIKES]->(message:Post), - (message:Post)<-[:CONTAINER_OF]-(person2:Forum), - (person1:Person)-[:KNOWS|HAS_INTEREST]->(place), - (person2:Forum)-[:HAS_MODERATOR|HAS_TAG]->(place) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(a).cypher deleted file mode 100644 index 8744f49df441..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(a).cypher +++ /dev/null @@ -1,5 +0,0 @@ -Match (person1)<-[:HAS_CREATOR]-(comment:Comment), - (comment:Comment)-[:REPLY_OF]->(post:Post), - (post:Post)<-[:CONTAINER_OF]-(forum), - (forum)-[:HAS_MEMBER]->(person2) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(b).cypher deleted file mode 100644 index 50b5115a0f1a..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc3(b).cypher +++ /dev/null @@ -1,4 +0,0 @@ -Match (p:Comment)-[]->(:Person)-[]->(:Place), - (p)<-[]-(message), - (message)-[]->(tag:Tag) -Return count(p); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(a).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(a).cypher deleted file mode 100644 index 0efd33b6581a..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(a).cypher +++ /dev/null @@ -1,7 +0,0 @@ -Match (forum)-[:CONTAINER_OF]->(post:Post), - (forum)-[:HAS_MEMBER]->(person1:Person), - (forum)-[:HAS_MEMBER]->(person2:Person), - (person1:Person)-[:KNOWS]->(person2:Person), - (person1:Person)-[:LIKES]->(post:Post), - (person2:Person)-[:LIKES]->(post:Post) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(b).cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(b).cypher deleted file mode 100644 index 4f18cdb43be9..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qc4(b).cypher +++ /dev/null @@ -1,7 +0,0 @@ -Match (forum)-[:HAS_TAG]->(post:Tag), - (forum)-[:HAS_MODERATOR]->(person1), - (forum)-[:HAS_MODERATOR|CONTAINER_OF]->(person2), - (person1)-[:KNOWS|LIKES]->(person2), - (person1)-[:HAS_INTEREST]->(post:Tag), - (person2)-[:HAS_INTEREST|HAS_TAG]->(post:Tag) -Return count(person1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr1.cypher deleted file mode 100644 index 63eb639aae0a..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr1.cypher +++ /dev/null @@ -1,3 +0,0 @@ -Match (p1:Person)-[:KNOWS]->(p2:Person) -Where p1.id < 933 -Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr2.cypher deleted file mode 100644 index 1b9e67c2329e..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr2.cypher +++ /dev/null @@ -1,5 +0,0 @@ -Match (p1:Person)<-[:HAS_MODERATOR]-(forum:Forum), - (p1:Person)<-[:HAS_CREATOR]-(post:Post), - (post)<-[:CONTAINER_OF]-(forum) -Where p1.id < 933 -Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr3.cypher deleted file mode 100644 index 33a6aeabcaa1..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr3.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p1:Person)-[:KNOWS]->(p2:Person)-[:KNOWS]->(p3:Person) Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr4.cypher deleted file mode 100644 index e669e04dc6a0..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qr4.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p1:Person)<-[:HAS_MODERATOR]-(forum:Forum)-[:CONTAINER_OF]->(post:Post)-[:HAS_CREATOR]->(p2:Person) Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt1.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt1.cypher deleted file mode 100644 index a685b75f3ded..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt1.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p1:Person)<-[:HAS_CREATOR]-()<-[:CONTAINER_OF]-(p2) Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt2.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt2.cypher deleted file mode 100644 index 4bacf99d040b..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt2.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p)-[]->(:Organisation)-[]->(:Place) Return count(p); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt3.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt3.cypher deleted file mode 100644 index d12671012651..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt3.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p1)<-[:IS_LOCATED_IN]-(p2:Comment)-[]->(:Tag) Return count(p1); \ No newline at end of file diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt4.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt4.cypher deleted file mode 100644 index 223fddf6f96d..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt4.cypher +++ /dev/null @@ -1,3 +0,0 @@ -Match (p1)<-[]-(p2:Post), - (p1)<-[:HAS_MODERATOR]-()-[]->(p2) -Return count(p1); diff --git a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt5.cypher b/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt5.cypher deleted file mode 100644 index 2543e68b708b..000000000000 --- a/interactive_engine/benchmark/queries/cypher_queries/experiments/neo4j/Qt5.cypher +++ /dev/null @@ -1 +0,0 @@ -Match (p:Post)-[]->(p1), (p1)-[]->(:Place) Return count(p1); \ No newline at end of file diff --git a/interactive_engine/compiler/README.md b/interactive_engine/compiler/README.md new file mode 100644 index 000000000000..7f9cf0a488eb --- /dev/null +++ b/interactive_engine/compiler/README.md @@ -0,0 +1,34 @@ +# GOpt: A Modular Graph-Native Query Optimization Framework + +## Introducing GOpt + +GOpt is a modular, graph-native query optimization framework designed to accelerate graph query execution on industrial-scale graph systems. It excels in handling complex graph patterns that combine graph pattern matching with relational operations on large graphs. GOpt is not aware of the underlying storage data and focuses solely on computation on top of the data, which makes it easy and fast to be integrated into other graph or relational databases. + +### Core Features + +1. **Multiple Query Languages Support**: GOpt supports standard [Gremlin](https://tinkerpop.apache.org/gremlin.html) and [Cypher](https://neo4j.com/docs/cypher-manual/current/introduction/) languages, with upcoming [GQL](https://www.gqlstandards.org/) support. +2. **Lightweight, Serverless Integration**: GOpt provides modular interfaces to integrate with various platforms. It has already been integrated into GraphScope and Neo4j. +3. **Advanced Graph-native Optimization**: GOpt introduces a comprehensive set of heuristic rules, an automatic type inference algorithm, and advanced cost-based optimization techniques. + +:::{figure-md} + + + +GOpt System Overview +::: + +### Why GOpt + +1. **High Performance** + + GOpt is designed and implemented based on years of academic research, with key techniques published in prestigious systems conferences. Our experiments, as documented in our [papers](https://arxiv.org/abs/2401.17786), demonstrate that GOpt outperforms most graph and relational databases in both standard ([LDBC](https://ldbcouncil.org/)) and real-world (Alibaba) graph workloads. +2. **User-Friendly Interface** + + GOpt offers different layers of SDK tailored to various user requirements. It provides Cypher and Gremlin language support to lower the barrier of entry. User-provided Cypher or Gremlin queries can be more flexible and ambiguous, with GOpt automatically validating and completing the query information based on property graph modeling. Additionally, it provides lower-level APIs for developers who require deeper integration. +3. **Seamless Integration** + + GOpt is lightweight and serverless, facilitating seamless integration into other databases through a small-sized JAR file deployment. Built on the Calcite framework, GOpt leverages Calcite's extensive range of adapters, simplifying the integration with various data formats. This advantage allows GOpt to seamlessly integrate with mainstream relational databases that has been powered by Calcite. Additionally, GOpt is equipped with graph-native algorithms, enhancing its compatibility with graph-native database APIs. + +For more details, please refer to the [GOpt Documentation](https://graphscope.io/docs/latest/interactive_engine/gopt).