From 63966c15a688d3b246f4579b2d0d4df7edfef45a Mon Sep 17 00:00:00 2001 From: florijan Date: Thu, 7 Sep 2017 15:31:37 +0200 Subject: [PATCH] LDBC Query1 converted Summary: Ugly formatting and bad variable naming due to 1024 limit on neo4j client. Reviewers: buda, teon.banek Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D748 --- .../ldbc/test_cases/params/query_1.params | 2 + .../ldbc/test_cases/queries/query_1.cyp | 45 +++++++++++++++++++ .../ldbc/test_cases/queries/query_1.oc | 45 +++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 tests/public_benchmark/ldbc/test_cases/params/query_1.params create mode 100644 tests/public_benchmark/ldbc/test_cases/queries/query_1.cyp create mode 100644 tests/public_benchmark/ldbc/test_cases/queries/query_1.oc diff --git a/tests/public_benchmark/ldbc/test_cases/params/query_1.params b/tests/public_benchmark/ldbc/test_cases/params/query_1.params new file mode 100644 index 000000000..ddbf3bfbf --- /dev/null +++ b/tests/public_benchmark/ldbc/test_cases/params/query_1.params @@ -0,0 +1,2 @@ +Person,Name +30786325583618,Chau diff --git a/tests/public_benchmark/ldbc/test_cases/queries/query_1.cyp b/tests/public_benchmark/ldbc/test_cases/queries/query_1.cyp new file mode 100644 index 000000000..f4bc364ea --- /dev/null +++ b/tests/public_benchmark/ldbc/test_cases/queries/query_1.cyp @@ -0,0 +1,45 @@ +MATCH (:Person {id:"30786325583618"})-[p:KNOWS*1..3]-(f:Person) +WHERE f.firstName = "Chau" +WITH f, min(length(p)) AS d +ORDER BY d ASC, f.lastName ASC, toint(f.id) ASC +LIMIT 20 +MATCH (f)-[:IS_LOCATED_IN]->(fCity:Place) +OPTIONAL MATCH (f)-[studyAt:STUDY_AT]->(uni:Organisation)-[:IS_LOCATED_IN]->(uniCity:Place) +WITH +f, +collect( +CASE uni.name +WHEN null THEN null +ELSE [uni.name, studyAt.classYear, uniCity.name] +END +) AS unis, +fCity, +d +OPTIONAL MATCH (f)-[worksAt:WORK_AT]->(c:Organisation)-[:IS_LOCATED_IN]->(cCountry:Place) +WITH +f, +collect( +CASE c.name +WHEN null THEN null +ELSE [c.name, worksAt.workFrom, cCountry.name] +END +) AS companies, +unis, +fCity, +d +RETURN +f.id AS id, +f.lastName AS lastName, +d as distance, +f.birthday AS birthday, +f.creationDate AS creationDate, +f.gender AS gender, +f.browserUsed AS browser, +f.locationIP AS locationIp, +f.email AS emails, +f.speaks AS languages, +fCity.name AS cityName, +unis, +companies +ORDER BY distance ASC, f.lastName ASC, toint(f.id) ASC +LIMIT 20; diff --git a/tests/public_benchmark/ldbc/test_cases/queries/query_1.oc b/tests/public_benchmark/ldbc/test_cases/queries/query_1.oc new file mode 100644 index 000000000..dbf4e86f8 --- /dev/null +++ b/tests/public_benchmark/ldbc/test_cases/queries/query_1.oc @@ -0,0 +1,45 @@ +MATCH (:Person {id:"30786325583618"})-[p:KNOWS*1..3]-(f:Person) +WHERE f.firstName = "Chau" +WITH f, min(size(p)) AS d +ORDER BY d ASC, f.lastName ASC, tointeger(f.id) ASC +LIMIT 20 +MATCH (f)-[:IS_LOCATED_IN]->(fCity:Place) +OPTIONAL MATCH (f)-[studyAt:STUDY_AT]->(uni:Organisation)-[:IS_LOCATED_IN]->(uniCity:Place) +WITH +f, +collect( +CASE uni.name +WHEN null THEN null +ELSE [uni.name, studyAt.classYear, uniCity.name] +END +) AS unis, +fCity, +d +OPTIONAL MATCH (f)-[worksAt:WORK_AT]->(c:Organisation)-[:IS_LOCATED_IN]->(cCountry:Place) +WITH +f, +collect( +CASE c.name +WHEN null THEN null +ELSE [c.name, worksAt.workFrom, cCountry.name] +END +) AS companies, +unis, +fCity, +d +RETURN +f.id AS id, +f.lastName AS lastName, +d as distance, +f.birthday AS birthday, +f.creationDate AS creationDate, +f.gender AS gender, +f.browserUsed AS browser, +f.locationIP AS locationIp, +f.email AS emails, +f.speaks AS languages, +fCity.name AS cityName, +unis, +companies +ORDER BY distance ASC, f.lastName ASC, tointeger(f.id) ASC +LIMIT 20;