Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

RedisGraph SNB interactive benchmark support #1

Open
wants to merge 251 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
9cc948d
Re-order env variables in the PostgreSQL loader script and docs
jmarton Mar 31, 2019
5fa9731
Add option to generate message file (of posts and comments) PostgreSQ…
jmarton Mar 31, 2019
59dd882
Use 0.4.0-SNAPSHOT version of the driver
szarnyasg Dec 6, 2019
f36f816
Update links. Fixes #97
szarnyasg Jan 17, 2020
3dfd4dd
Classes for Cypher delete queries
szarnyasg Jan 23, 2020
2773770
Fix CI
szarnyasg Jan 23, 2020
bb67f38
initial cypher delete queries
jackwaudby Jan 23, 2020
73a7979
Add newlines at the ends of file
szarnyasg Feb 3, 2020
7047d78
Bump Neo4j version to 4.0.0
szarnyasg Feb 3, 2020
d987d5c
Merge branch 'neo4j-4' into cypher-delete
szarnyasg Feb 3, 2020
54c5508
Bump Java version
szarnyasg Feb 3, 2020
2ac3fa2
Fix function call on pattern comprehension
szarnyasg Feb 3, 2020
20dd563
Adjust Neo4j import scripts and variables to 4.0
szarnyasg Feb 3, 2020
c979142
Merge branch 'cypher-deletes' into cypher-delete
szarnyasg Feb 26, 2020
7e972c8
Adjust CSVs to new Datagen output (draft)
szarnyasg Feb 29, 2020
552fed6
Remove typo from hashbang
szarnyasg Mar 6, 2020
4359487
Show Neo4j log after importing/restarting the database
szarnyasg Mar 6, 2020
f27be93
Rework Neo4j setup and import process
szarnyasg Mar 6, 2020
67eeba9
Fix README instructions
szarnyasg Mar 6, 2020
bb5b6a5
Minor improvements in Neo4j scripts
szarnyasg Mar 6, 2020
9dc10de
Use Date and DateTime types when importing data to Neo4j
szarnyasg Mar 6, 2020
8bd062e
Update Neo4j test data to match schema
szarnyasg Mar 6, 2020
cb2d9e3
Fix import
szarnyasg Mar 6, 2020
f02d19c
Update Travis configuration to match env var names
szarnyasg Mar 6, 2020
ee101ad
Remove tests for deprecated BI queries
szarnyasg Mar 6, 2020
4ba371a
Remove deprecated Cypher queries
szarnyasg Mar 7, 2020
248aba0
Drop curly braces around Neo4j parameters. Fixes #103
szarnyasg Mar 7, 2020
61b8ca8
Use native date type in Neo4j, update parameter syntax
szarnyasg Mar 7, 2020
e3e5bdd
Optimize Cypher implementation of BI Q7
szarnyasg Mar 7, 2020
821daa9
Extend Postgres with creationDate and deletionDate attributes. Fixes …
szarnyasg Mar 7, 2020
94a0318
Make Postgres load scripts fail on errors #105
szarnyasg Mar 7, 2020
876807d
Rename PG_DATA_DIR to PG_CSV_DIR
szarnyasg Mar 7, 2020
56a2e8f
Optimize and document BI Q7 Cypher
szarnyasg Mar 7, 2020
03e67aa
Fix PG environment variable in CI conf
szarnyasg Mar 8, 2020
0ac0bfc
Ignore Postgres update tests for the time being
szarnyasg Mar 8, 2020
c912a36
Change joinDate to creationDate in Postgres queries
szarnyasg Mar 8, 2020
40d2870
Bump Postgres version on Travis
szarnyasg Mar 8, 2020
4e2e56e
Drop PG port
szarnyasg Mar 8, 2020
bb5cc96
Update Postgres test data
szarnyasg Mar 8, 2020
8ad2943
Fix indentation
szarnyasg Mar 8, 2020
49395f2
Push parameters inside BI Q3
szarnyasg Mar 8, 2020
a8ebe4c
Further cosmetic changes in Q3
szarnyasg Mar 8, 2020
b54194c
Update Neo4j syntax for example parameters in BI queries #103
szarnyasg Mar 8, 2020
db3e970
fix README
szarnyasg Mar 8, 2020
2c43761
Don't use absolute paths to PostgreSQL tools
petere Mar 18, 2020
93cf3e9
[add] clarify how to change update_interleave property which is of ex…
filipecosta90 Feb 26, 2020
d32e79b
Fix typo
szarnyasg Feb 26, 2020
3621b95
[add] updated interactive read query frequencies to match SF1
filipecosta90 Feb 27, 2020
396ca22
Use Java 11. Fixes #106
szarnyasg Mar 16, 2020
c08327b
Cleanup Cypher scripts #90
szarnyasg Mar 18, 2020
b27b70e
Merge pull request #107 from petere/postgres-path
szarnyasg Mar 19, 2020
50c7dec
Fix driver branch in CI configuration
szarnyasg Apr 9, 2020
474b96a
Use ed instead of sed to speed up conversion of CSV files
szarnyasg Apr 17, 2020
df84142
Use simpler method for changing headers
szarnyasg Apr 21, 2020
1207b86
Fix Neo4j CSV headers to keep up with Datagen
szarnyasg Apr 25, 2020
43d47b9
Add Cypher test files
szarnyasg Apr 26, 2020
da3f62f
Make SparqlConverter thread-safe
szarnyasg Apr 26, 2020
966a149
Change occurrences of SimpleDateFormat to DateTimeFormatter
szarnyasg Apr 26, 2020
93d540b
Merge pull request #118 from ldbc/thread-safe-datetimeconverter
szarnyasg Apr 26, 2020
e2c48a4
Fix compile errors in Cypher queries
szarnyasg Apr 26, 2020
492cdd1
Fix Interactive Q1 implementations: exclude start Person from results
szarnyasg May 3, 2020
bd83427
Use uniform frequencies
szarnyasg May 3, 2020
eabdf64
Add script to temporarily disable updates in Postgres runs
szarnyasg May 3, 2020
4051934
Remove unused results_log configuration parameter. Fixes #122
szarnyasg May 9, 2020
7e580a3
Merge pull request #124 from ldbc/fix-cypher-queries
szarnyasg May 9, 2020
47b9af2
Remove redundant implementations
szarnyasg May 9, 2020
08e754a
Fix use of datetime in Cypher
szarnyasg May 9, 2020
f0b8b45
Add 'disable-updates.sh' script to Cypher implementation
szarnyasg May 9, 2020
c319e60
Use new driver_mode flag in scripts #126
szarnyasg May 9, 2020
8b14c33
Add notice to SPARQL implementation on lack of maintenance
szarnyasg May 9, 2020
3e52195
Add new delete operation to the configurations (currently disabled)
szarnyasg May 9, 2020
4c71f5d
Revert "Fix Neo4j CSV headers to keep up with Datagen"
szarnyasg May 9, 2020
f72ed29
Track branch renaming
szarnyasg Jul 6, 2020
a0923bd
Fix Travis configuration
szarnyasg Jul 6, 2020
17bbdc5
Fix Travis CI build
szarnyasg Jul 7, 2020
b02c90a
Remove unused example
szarnyasg Jul 7, 2020
f9d858d
Drop unused deletionDate attribute from headers
szarnyasg Jul 7, 2020
3958c7a
Support Forum labels (Wall/Album/Group)
szarnyasg Jul 7, 2020
8688622
Adjust headers
szarnyasg Jul 7, 2020
3f505b5
Add note on citations
szarnyasg Aug 14, 2020
f6616d2
Add compatibility matrix
szarnyasg Sep 10, 2020
df14a34
Bump Neo4j version
szarnyasg Sep 18, 2020
4ee3bd7
Check that environment variables are set before loading
szarnyasg Sep 18, 2020
6ac9539
Fix CSV header
szarnyasg Sep 24, 2020
7165811
Update README
szarnyasg Sep 24, 2020
4ed912b
Update README
szarnyasg Sep 24, 2020
fbbbe1f
Merge branch 'dev' into postgresql-csv-generate-options
szarnyasg Oct 2, 2020
a10f6b8
Update Cypher test data
szarnyasg Oct 2, 2020
26f1afb
Update Cypher test data
szarnyasg Oct 2, 2020
55426f3
Merge pull request #125 from ldbc/postgresql-csv-generate-options
szarnyasg Oct 2, 2020
808cc1d
Cleanup READMEs
szarnyasg Oct 2, 2020
e4e428c
Rename old BI queries, add new ones (mix of implementations/skeletons)
szarnyasg Oct 2, 2020
05cbfac
Use consistent capitalization in Interactive short queries
szarnyasg Oct 3, 2020
62e33df
Initial Cypher implementations of Q16-Q20 completed
szarnyasg Oct 3, 2020
bd71a63
Fix counting interactions in BI Q19
szarnyasg Oct 3, 2020
6ffd1d6
Remove unmaintained subprojects (SPARQL and DBToaster)
szarnyasg Oct 4, 2020
7d34e5b
Add instructions on how to generate small test data
szarnyasg Oct 4, 2020
00ffb00
Remove old BI classes
szarnyasg Oct 4, 2020
fe4d37a
Add Cypher glue code for new BI queries
szarnyasg Oct 4, 2020
fd6b2e0
Fix example parameters
szarnyasg Oct 8, 2020
18204e9
Bump junit from 4.12 to 4.13.1 in /common
dependabot[bot] Oct 13, 2020
f7bcdac
Adjust BI query numbering in Postgres
szarnyasg Oct 16, 2020
137ac7d
Put new BI Q16-20 queries on ignore until we have SQL implementations
szarnyasg Oct 16, 2020
c1a6c43
Configure Neo4j after loading the data in CI
szarnyasg Oct 16, 2020
0b5b123
Merge pull request #137 from ldbc/cleanup-bi-queries
szarnyasg Oct 16, 2020
e9cf1bf
Merge pull request #138 from ldbc/dependabot/maven/common/junit-junit…
szarnyasg Oct 16, 2020
2353739
Fix Interactive Q2 reference implementations to use exclusive upper b…
szarnyasg Oct 19, 2020
becbaa8
Adjust Postgres load script and test data to the latest Datagen
szarnyasg Oct 23, 2020
08f9ac0
Change birthday type from 'timestamp' to 'date'
szarnyasg Oct 23, 2020
5c20529
Update Postgres update queries to match new schema
szarnyasg Oct 30, 2020
16f11e4
Print env vars used by the PostgreSQL load script
szarnyasg Nov 8, 2020
f56465c
Fix possible infinite loop in IC-13 query by recording the path.
jmarton Jun 1, 2020
1320b22
Bump Neo4j and GDS versions
szarnyasg Nov 12, 2020
2cbe65e
Check PG_USER
szarnyasg Nov 12, 2020
c3c22bb
Add tie-breaking to BI Q19
szarnyasg Nov 13, 2020
0d70ab9
Remove comment from Cypher params code
szarnyasg Nov 13, 2020
7acc874
Fix Cypher queries using weighted shortest paths
szarnyasg Nov 13, 2020
456cd87
Migrate build to CircleCI #146
szarnyasg Nov 14, 2020
9765bb6
Install cURL in CI
szarnyasg Nov 14, 2020
672f1e8
Change CI badge
szarnyasg Nov 14, 2020
605b1ba
Merge pull request #142 from ldbc/update-postgres-update-queries
szarnyasg Nov 14, 2020
a3f79c3
Merge pull request #147 from ldbc/neo4j-version-bump
szarnyasg Nov 14, 2020
cb25311
Bump Neo4j version
szarnyasg Nov 17, 2020
75236cf
Add missing space
szarnyasg Nov 17, 2020
783154f
Refine Neo4j load script
szarnyasg Nov 17, 2020
82eb168
Create indices in Neo4j load
szarnyasg Nov 17, 2020
1fefd76
Use one step load script in CI
szarnyasg Nov 17, 2020
be26b2a
Add missing netcat package
szarnyasg Nov 17, 2020
7a12532
Rework Neo4j default env vars and scripts, use path based on the dire…
szarnyasg Nov 17, 2020
236bc48
Use consistent directory names for projects
szarnyasg Nov 18, 2020
3a624ad
Update Postgres README
szarnyasg Nov 18, 2020
6b1bcbe
Fix Datagen configuration
szarnyasg Nov 18, 2020
1d28348
Update headers in accordance with the Datagen repository
szarnyasg Nov 18, 2020
8fc2e26
Download deployed generated data sets instead of storing them in this…
szarnyasg Nov 18, 2020
8c42e44
Omit changing labels to uppercase
szarnyasg Nov 24, 2020
36d170a
Run scripts in their directory
szarnyasg Nov 24, 2020
9e648ce
Removing executable bit from env var configuration script
szarnyasg Dec 5, 2020
72ea4bb
User cypher-shell for testing whether DB is running
szarnyasg Dec 15, 2020
1e55e6f
Update queries and their Cypher implementation to match implementation
szarnyasg Dec 15, 2020
99a3d65
Revise PostgreSQL BI queries
szarnyasg Dec 15, 2020
c86e2a1
Add comment on handling Posts/Comments
szarnyasg Dec 15, 2020
bbaf3c3
Use Message in BI Q3 and Q4
szarnyasg Dec 15, 2020
11e51f1
Use 'date' parameter in BI Q2 instead of year/month
szarnyasg Dec 15, 2020
bec75c5
Dockerize Cypher implementation
szarnyasg Dec 15, 2020
59a934c
Use non-Docker CI image to allow running Docker
szarnyasg Dec 15, 2020
3643318
Cleanup Cypher scripts, adjust CI configuration
szarnyasg Dec 15, 2020
b125c25
Use sudo in CI
szarnyasg Dec 15, 2020
5271354
Cleanup tests, remove authentication
szarnyasg Dec 15, 2020
b03ccfc
Fix GitHub URL (broke on some git versions with a trailing slash)
szarnyasg Dec 15, 2020
fb3b9c8
Ignore Postgres tests
szarnyasg Dec 15, 2020
e9690d7
Specify CSV dir for Neo4j
szarnyasg Dec 15, 2020
403bdc1
Add dummy user/pw
szarnyasg Dec 15, 2020
eeb4756
Use common interface to reduce code duplication
szarnyasg Dec 15, 2020
11a326c
Revise Neo4j scripts, run GDS library in Docker
szarnyasg Dec 16, 2020
363870b
Unignore BI unit tests
szarnyasg Dec 16, 2020
64cc0ce
Simplify Cypher/GDS queries
szarnyasg Dec 16, 2020
19d2ad3
Add checks and pv to Cypher script
szarnyasg Dec 18, 2020
e27297d
Rename script
szarnyasg Dec 18, 2020
525633f
Run APOC in the Neo4j Docker container
szarnyasg Dec 18, 2020
8698895
Rework Cypher implementation of Q10
szarnyasg Dec 18, 2020
5262b1b
Format parameters
szarnyasg Dec 18, 2020
6f3a86d
Cleanup Cypher queries and add more checks
szarnyasg Dec 18, 2020
075248c
Add alternative BI Q10 Cypher implementation
szarnyasg Dec 18, 2020
a19e269
Remove deprecated script from README
szarnyasg Dec 28, 2020
e5c0f33
Rename Neo4j env var
szarnyasg Dec 28, 2020
7688c11
Add example graph covering BI Q1-Q15
szarnyasg Jan 3, 2021
a4a166c
Extend example to cover BI Q16-Q20
szarnyasg Jan 3, 2021
31b2919
Clarify extra requirements of Cypher queries
szarnyasg Jan 3, 2021
c825565
Clarify comment
szarnyasg Jan 4, 2021
bccb47e
Remove alternative queries
szarnyasg Jan 4, 2021
0445b05
Fix dates
szarnyasg Jan 4, 2021
110f979
Formatting
szarnyasg Jan 4, 2021
8179457
Slight adjustments to example graph
szarnyasg Jan 4, 2021
f3621f0
Do not nuke database with example graph query
szarnyasg Jan 4, 2021
29d4214
Add/update some properties in example graph
szarnyasg Jan 4, 2021
8dd99b2
Clarify BI Q6 comments
szarnyasg Jan 4, 2021
d64840a
Optimize BI Q5. Fixes #104
szarnyasg Jan 4, 2021
a12adf6
Minor fixes to the example graph
szarnyasg Jan 4, 2021
02ca463
Clarify versioning
szarnyasg Jan 6, 2021
6bcb4c2
Rename variable in recursive CTEs in SQL queries: s/depth/level/g
szarnyasg Jan 21, 2021
365cebc
Fix direction of edge in BI Q20
szarnyasg Jan 21, 2021
13a589b
Cleanup Cypher README
szarnyasg Jan 21, 2021
d0a9413
Add missing 'ORDER BY' clause
szarnyasg Jan 22, 2021
2af8a2c
Change error message
szarnyasg Jan 23, 2021
ab32c6f
Add docs to releases table
szarnyasg Jan 27, 2021
be4d39a
Remove typo, fix direction of edge
szarnyasg Jan 27, 2021
988e425
Newline
szarnyasg Jan 30, 2021
5c45b76
Add tmp file to gitignore
szarnyasg Jan 30, 2021
55d51e4
Add 'e' flag to Bash scripts
szarnyasg Jan 30, 2021
cf03bf1
Drop '-e' flag from sourced script
szarnyasg Feb 1, 2021
8c1c260
Add e/pipefail options to Neo4j scripts
szarnyasg Feb 1, 2021
70684a4
Use working data set
szarnyasg Feb 3, 2021
e5125c0
Update cityIds for new example data set
szarnyasg Feb 3, 2021
7294731
Add test Python script
szarnyasg Feb 3, 2021
0750b07
Run BI script in CI
szarnyasg Feb 3, 2021
7314c6e
Use type designators for parameter files
szarnyasg Feb 3, 2021
963b129
Fix BI Q11: add projection to only count each triangle once
szarnyasg Feb 9, 2021
fb9363f
Use correct type (DateTime -> Date) in the example parameters/scripts…
szarnyasg Feb 11, 2021
4034a1f
Make env vars script zsh-compatible
szarnyasg Feb 15, 2021
acfa0fe
Spell out locale verbosely (POSIX=C), see issue #157
szarnyasg Mar 14, 2021
2804124
Spell out query ids (necessitated by Q14a/b)
szarnyasg Mar 15, 2021
b240abe
Add conversion script for parameters files
szarnyasg Mar 15, 2021
1e4b570
Fix Python script running Cypher queries
szarnyasg Mar 15, 2021
475ce05
Add instructions on using the example data set
szarnyasg Mar 15, 2021
bf0bc7f
Fix parameters: separate date/datetime parameters
szarnyasg Mar 15, 2021
0c90eae
Use new filenames (with PascalCase node label names)
szarnyasg Mar 16, 2021
d6afe84
Wip: RedisGraph v2.4 support.
filipecosta90 Mar 25, 2021
6b33bc6
Wip: removed wrong testing data folder
filipecosta90 Mar 25, 2021
1eb2227
Build appropriate nodes with multiple labels
jeffreylovitz Mar 25, 2021
2291cac
Merge pull request #2 from RedisGraph/multi-label-import
filipecosta90 Mar 25, 2021
026499b
[wip] fixed redisgraph artifact build. working on fixing the empty qu…
filipecosta90 Mar 27, 2021
5ecee2c
Merge branch 'redisgraph.unstable' of https://github.com/RedisGraph/l…
filipecosta90 Mar 27, 2021
ed5ab45
[wip] working as expected redisgraph ( prior state )
filipecosta90 Mar 27, 2021
ba130cc
[wip] working as expected redisgraph ( prior state )
filipecosta90 Mar 27, 2021
8edb0b4
[wip] eanabled all queries on RedisGraphCypherInteractiveDb()
filipecosta90 Mar 27, 2021
58015e5
[wip] eanabled all queries on RedisGraphCypherInteractiveDb()
filipecosta90 Mar 27, 2021
faca708
[add] Updated RedisGraph readme to match the current tool status/auto…
filipecosta90 Mar 27, 2021
56d7702
Include headers.txt file
jeffreylovitz Mar 29, 2021
963265f
Rewrite 3 unsupported queries
jeffreylovitz Mar 29, 2021
a76c7d8
Merge pull request #3 from RedisGraph/rewrite-unsupported-queries
filipecosta90 Mar 29, 2021
be9ce12
[add] Added validator
filipecosta90 Mar 30, 2021
664f253
[add] Added validation scripts description
filipecosta90 Mar 30, 2021
6b9b1cf
[add] Added get-neo4j.sh script
filipecosta90 Mar 30, 2021
9ababe7
Rewrite IC-12
jeffreylovitz Mar 30, 2021
152fa13
Add indexes on each place sub-label
jeffreylovitz Mar 30, 2021
8e3ec12
Merge remote-tracking branch 'upstream/main' into redisgraph.unstable
jeffreylovitz Aug 5, 2021
98ecf67
Post-merge fixes
jeffreylovitz Aug 5, 2021
a7547c0
WIP
jeffreylovitz Aug 5, 2021
8221d21
WIP
jeffreylovitz Aug 6, 2021
0a997a2
WIP
jeffreylovitz Aug 9, 2021
faf22ec
WIP
jeffreylovitz Aug 9, 2021
8d1024c
Fixes to Java RedisGraph query implementations
jeffreylovitz Aug 10, 2021
5446751
Only run handled queries
jeffreylovitz Aug 10, 2021
356b547
WIP
jeffreylovitz Aug 12, 2021
09f9698
WIP
jeffreylovitz Aug 18, 2021
9407475
Disable failing complex tests
jeffreylovitz Aug 18, 2021
00231a5
Merge pull request #8 from RedisGraph/redisgraph-cross-validation
filipecosta90 Aug 18, 2021
4badd41
RedisGraph driver corrections and query modifications
jeffreylovitz Aug 19, 2021
d0cf32e
Enable all queries but IC-14
jeffreylovitz Sep 1, 2021
86c18a3
Revert to upstream queries
jeffreylovitz Nov 15, 2021
5fdac1b
Revert to upstream queries
jeffreylovitz Dec 6, 2021
801e13c
Update Neo4j driver for cross-validation
jeffreylovitz Dec 14, 2021
dd7d070
Merge branch 'main' into redisgraph.unstable
filipecosta90 Feb 3, 2022
c288437
Updated project according to origin
filipecosta90 Feb 3, 2022
601b49e
Updated validate and run scripts
filipecosta90 Feb 3, 2022
d23fa64
Merge pull request #11 from RedisGraph/sync.origin
jeffreylovitz Feb 3, 2022
ade8a8f
Extended import-to-redisgraph.sh script to allow for remote insertion
filipecosta90 Feb 3, 2022
b04626d
Further improved datagen and run scripts for redisgraph
filipecosta90 Feb 3, 2022
75e4079
Enable debug log on graph runnre
filipecosta90 Feb 3, 2022
b33889d
Removed offending ; of IC7
filipecosta90 Apr 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ To get started with the LDBC SNB benchmarks, check out our introductory presenta
We provide two reference implementations:

* [Neo4j (Cypher) implementation](cypher/README.md)
* [RedisGraph (Cypher) implementation](postgres/README.md)
* [PostgreSQL (SQL) implementation](postgres/README.md)

There are additional implementations are avaiable but these are less well-tested:
Expand Down
3 changes: 3 additions & 0 deletions build_redisgraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

mvn clean package -DskipTests -Pcypher,redisgraph
5 changes: 3 additions & 2 deletions cypher/driver/create-validation-parameters.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ password=admin
queryDir=queries/

printQueryNames=true
printQueryStrings=false
printQueryStrings=true
printQueryResults=false

status=1
Expand Down Expand Up @@ -69,7 +69,7 @@ ldbc.snb.interactive.LdbcQuery10_enable=true
ldbc.snb.interactive.LdbcQuery11_enable=true
ldbc.snb.interactive.LdbcQuery12_enable=true
ldbc.snb.interactive.LdbcQuery13_enable=true
ldbc.snb.interactive.LdbcQuery14_enable=true
ldbc.snb.interactive.LdbcQuery14_enable=false

ldbc.snb.interactive.LdbcShortQuery1PersonProfile_enable=true
ldbc.snb.interactive.LdbcShortQuery2PersonPosts_enable=true
Expand All @@ -87,3 +87,4 @@ ldbc.snb.interactive.LdbcUpdate5AddForumMembership_enable=true
ldbc.snb.interactive.LdbcUpdate6AddPost_enable=true
ldbc.snb.interactive.LdbcUpdate7AddComment_enable=true
ldbc.snb.interactive.LdbcUpdate8AddFriendship_enable=true
ldbc.snb.interactive.LdbcDelete1RemovePerson_enable=true
7 changes: 4 additions & 3 deletions cypher/driver/validate.properties
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ ldbc.snb.interactive.LdbcQuery9_enable=true
ldbc.snb.interactive.LdbcQuery10_enable=true
ldbc.snb.interactive.LdbcQuery11_enable=true
ldbc.snb.interactive.LdbcQuery12_enable=true
ldbc.snb.interactive.LdbcQuery13_enable=true
ldbc.snb.interactive.LdbcQuery14_enable=true
ldbc.snb.interactive.LdbcQuery13_enable=false
ldbc.snb.interactive.LdbcQuery14_enable=false

ldbc.snb.interactive.LdbcShortQuery1PersonProfile_enable=true
ldbc.snb.interactive.LdbcShortQuery2PersonPosts_enable=true
ldbc.snb.interactive.LdbcShortQuery2PersonPosts_enable=false
ldbc.snb.interactive.LdbcShortQuery3PersonFriends_enable=true
ldbc.snb.interactive.LdbcShortQuery4MessageContent_enable=true
ldbc.snb.interactive.LdbcShortQuery5MessageCreator_enable=true
Expand All @@ -79,3 +79,4 @@ ldbc.snb.interactive.LdbcUpdate5AddForumMembership_enable=true
ldbc.snb.interactive.LdbcUpdate6AddPost_enable=true
ldbc.snb.interactive.LdbcUpdate7AddComment_enable=true
ldbc.snb.interactive.LdbcUpdate8AddFriendship_enable=true
ldbc.snb.interactive.LdbcDelete1RemovePerson_enable=true
2 changes: 1 addition & 1 deletion cypher/queries/check-feature.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FEATURE=$1

for i in `seq 1 25`; do
for i in $(seq 1 25); do
if grep -q "$FEATURE" bi-$i.cypher; then
echo x
else
Expand Down
95 changes: 48 additions & 47 deletions cypher/queries/interactive-complex-1.cypher
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
// Q1. Transitive friends with certain name
/*
:param [{ personId, firstName }] => { RETURN
4398046511333 AS personId,
"Jose" AS firstName
}
*/
MATCH (p:Person {id: $personId}), (friend:Person {firstName: $firstName})
WHERE NOT p=friend
WITH p, friend
MATCH path = shortestPath((p)-[:KNOWS*1..3]-(friend))
WITH min(length(path)) AS distance, friend
ORDER BY
distance ASC,
friend.lastName ASC,
toInteger(friend.id) ASC
LIMIT 20

MATCH path=(person:Person {id: $personId})-[:KNOWS*1..3]-(friend:Person)
WHERE friend.firstName = $firstName
AND person <> friend
WITH friend, min(length(path)) AS distance
ORDER BY distance ASC, friend.lastName ASC, friend.id ASC
LIMIT 20
MATCH (friend)-[:IS_LOCATED_IN]->(friendCity:City)
OPTIONAL MATCH (friend)-[studyAt:STUDY_AT]->(uni:University)-[:IS_LOCATED_IN]->(uniCity:City)
WITH friend, collect(
CASE uni.name
WHEN null THEN null
ELSE [uni.name, studyAt.classYear, uniCity.name]
END ) AS unis, friendCity, distance

OPTIONAL MATCH (friend)-[workAt:WORK_AT]->(company:Company)-[:IS_LOCATED_IN]->(companyCountry:Country)
WITH friend, collect(
CASE company.name
WHEN null THEN null
ELSE [company.name, workAt.workFrom, companyCountry.name]
END ) AS companies, unis, friendCity, distance

WHEN NULL THEN NULL
ELSE [uni.name, studyAt.classYear, uniCity.name]
END
) AS unis,
friendCity,
distance
OPTIONAL MATCH (friend)-[workAt:WORK_AT]->(company:Organisation)-[:IS_LOCATED_IN]->(companyCountry:Country)
WITH
friend,
company.name AS companyName,
companyCountry.name AS companyCountryName,
workAt.workFrom AS workFrom,
unis,
friendCity,
distance
ORDER BY company.name
WITH
friend,
collect(
CASE companyName
WHEN NULL THEN NULL
ELSE [companyName, workFrom, companyCountryName]
END
) AS companies,
unis,
friendCity,
distance
RETURN
friend.id AS friendId,
friend.lastName AS friendLastName,
distance AS distanceFromPerson,
friend.birthday AS friendBirthday,
friend.creationDate AS friendCreationDate,
friend.gender AS friendGender,
friend.browserUsed AS friendBrowserUsed,
friend.locationIP AS friendLocationIp,
friend.email AS friendEmails,
friend.speaks AS friendLanguages,
friendCity.name AS friendCityName,
unis AS friendUniversities,
companies AS friendCompanies
ORDER BY
distanceFromPerson ASC,
friendLastName ASC,
toInteger(friendId) ASC
LIMIT 20
friend.id AS friendId,
friend.lastName AS friendLastName,
distance AS distanceFromPerson,
friend.birthday AS friendBirthday,
friend.creationDate AS friendCreationDate,
friend.gender AS friendGender,
friend.browserUsed AS friendBrowserUsed,
friend.locationIP AS friendLocationIp,
friend.email AS friendEmails,
friend.speaks AS friendLanguages,
friendCity.name AS friendCityName,
unis AS friendUniversities,
companies AS friendCompanies
ORDER BY distance ASC, friend.lastName ASC, friend.id ASC
LIMIT 20
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
MATCH (person:Person {id: $personId})-[:KNOWS*2..2]-(friend:Person)-[:IS_LOCATED_IN]->(city:Place)
WHERE
((friend.birthday / 100 % 100 = $month AND friend.birthday % 100 >= 21) OR
(friend.birthday / 100 % 100 = $nextMonth AND friend.birthday % 100 < 22))
AND NOT(friend = person)
AND NOT((friend)-[:KNOWS]-(person))
WITH DISTINCT friend, city, person
OPTIONAL MATCH (friend)<-[:HAS_CREATOR]-(post:Post)
WITH friend, city, collect(post) + [null] AS posts, count(post) AS postCount, person
UNWIND posts AS commonPostCandidate
WITH
friend,
city,
commonPostCandidate,
postCount,
person
WHERE (commonPostCandidate)-[:HAS_TAG]->(:Tag)<-[:HAS_INTEREST]-(person) OR commonPostCandidate IS NULL
WITH
friend,
city,
postCount,
count(commonPostCandidate) AS commonPostCount
RETURN
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
commonPostCount - (postCount- commonPostCount) AS commonInterestScore,
commonPostCount,
postCount,
friend.gender AS personGender,
city.name AS personCityName
ORDER BY commonInterestScore DESC, toInteger(personId) ASC
LIMIT 10
47 changes: 21 additions & 26 deletions cypher/queries/interactive-complex-10.cypher
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
// Q10. Friend recommendation
/*
:param [{ personId, month }] => { RETURN
4398046511333 AS personId,
5 AS month
}
*/
MATCH (person:Person {id: $personId})-[:KNOWS*2..2]-(friend),
(friend)-[:IS_LOCATED_IN]->(city:City)
WHERE NOT friend=person AND
NOT (friend)-[:KNOWS]-(person)
WITH person, city, friend, datetime({epochMillis: friend.birthday}) as birthday
WHERE (birthday.month=$month AND birthday.day>=21) OR
(birthday.month=($month%12)+1 AND birthday.day<22)
MATCH (person:Person {id: $personId})-[:KNOWS*2..2]-(friend:Person)-[:IS_LOCATED_IN]->(city:Place)
WHERE
((friend.birthday / 100 % 100 = $month AND friend.birthday % 100 >= 21) OR
(friend.birthday / 100 % 100 = $month % 12 + 1 AND friend.birthday % 100 < 22))
AND NOT(friend = person)
AND NOT((friend)-[:KNOWS]-(person))
WITH DISTINCT friend, city, person
OPTIONAL MATCH (friend)<-[:HAS_CREATOR]-(post:Post)
WITH friend, city, collect(post) AS posts, person
WITH friend,
city,
size(posts) AS postCount,
size([p IN posts WHERE (p)-[:HAS_TAG]->()<-[:HAS_INTEREST]-(person)]) AS commonPostCount
RETURN friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
commonPostCount - (postCount - commonPostCount) AS commonInterestScore,
friend.gender AS personGender,
city.name AS personCityName
ORDER BY commonInterestScore DESC, personId ASC
OPTIONAL MATCH (post)-[:HAS_TAG]->(commonPost:Tag)<-[:HAS_INTEREST]-(person)
WITH friend, city, collect(post) AS posts, person, count(commonPost) AS commonPostCount
WITH
friend,
city,
size(posts) AS postCount,
commonPostCount
RETURN
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
commonPostCount - (postCount- commonPostCount) AS commonInterestScore,
friend.gender AS personGender,
city.name AS personCityName
ORDER BY commonInterestScore DESC, toInteger(personId) ASC
LIMIT 10
33 changes: 11 additions & 22 deletions cypher/queries/interactive-complex-11.cypher
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
// Q11. Job referral
/*
:param [{ personId, countryName, workFromYear }] => { RETURN
10995116277918 AS personId,
"Hungary" AS countryName,
2011 AS workFromYear
}
*/
MATCH (person:Person {id: $personId })-[:KNOWS*1..2]-(friend:Person)
WHERE not(person=friend)
MATCH (person:Person {id: $personId})-[:KNOWS*1..2]-(friend:Person)
WHERE NOT(person = friend)
WITH DISTINCT friend
MATCH (friend)-[workAt:WORK_AT]->(company:Company)-[:IS_LOCATED_IN]->(:Country {name: $countryName })
WHERE workAt.workFrom < $workFromYear
MATCH (friend)-[workAt:WORK_AT]->(company:Organisation)-[:IS_LOCATED_IN]->(:Place {name: $countryName})
WHERE workAt.workFrom < $workFromYear
RETURN
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
company.name AS organizationName,
workAt.workFrom AS organizationWorkFromYear
ORDER BY
organizationWorkFromYear ASC,
toInteger(personId) ASC,
organizationName DESC
LIMIT 10
friend.id,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
company.name AS organizationName,
workAt.workFrom AS organizationWorkFromYear
ORDER BY organizationWorkFromYear ASC, toInteger(friend.id) ASC, organizationName DESC
LIMIT 10
34 changes: 13 additions & 21 deletions cypher/queries/interactive-complex-12.cypher
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
// Q12. Expert search
/*
:param [{ personId, tagClassName }] => { RETURN
10995116278009 AS personId,
"Monarch" AS tagClassName
}
*/
MATCH (tag:Tag)-[:HAS_TYPE|IS_SUBCLASS_OF*0..]->(baseTagClass:TagClass)
WHERE tag.name = $tagClassName OR baseTagClass.name = $tagClassName
WITH collect(tag.id) as tags
MATCH (:Person {id: $personId })-[:KNOWS]-(friend:Person)<-[:HAS_CREATOR]-(comment:Comment)-[:REPLY_OF]->(:Post)-[:HAS_TAG]->(tag:Tag)
WHERE tag.id in tags
MATCH (p:Person {id: $personId})
WITH p
MATCH (p)-[:KNOWS]-(friend:Person)<-[:HAS_CREATOR]-(comment:Message)-[:REPLY_OF]->(:Message)
-[:HAS_TAG]->(tag:Tag),
(tag)-[:HAS_TYPE]->(tagClass:TagClass)-[:IS_SUBCLASS_OF*0..]->(baseTagClass:TagClass)
WHERE tagClass.name = $tagClassName OR baseTagClass.name = $tagClassName
RETURN
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
collect(DISTINCT tag.name) AS tagNames,
count(DISTINCT comment) AS replyCount
ORDER BY
replyCount DESC,
toInteger(personId) ASC
LIMIT 20
friend.id,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
collect(DISTINCT tag.name) AS tagNames,
count(DISTINCT comment) AS replyCount
ORDER BY replyCount DESC, friend.id ASC
LIMIT 20
21 changes: 6 additions & 15 deletions cypher/queries/interactive-complex-13.cypher
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// Q13. Single shortest path
/*
:param [{ person1Id, person2Id }] => { RETURN
8796093022390 AS person1Id,
8796093022357 AS person2Id
}
*/
MATCH
(person1:Person {id: $person1Id}),
(person2:Person {id: $person2Id}),
path = shortestPath((person1)-[:KNOWS*]-(person2))
MATCH (person1:Person {id: $person1Id}), (person2:Person {id: $person2Id})
WITH shortestPath((person1)-[:KNOWS*]->(person2)) AS path
RETURN
CASE path IS NULL
WHEN true THEN -1
ELSE length(path)
END AS shortestPathLength
CASE path IS NULL
WHEN true THEN -1
ELSE length(path)
END AS shortestPathLength;
43 changes: 9 additions & 34 deletions cypher/queries/interactive-complex-14.cypher
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
// Q14. Trusted connection paths
/*
:param [{ person1Id, person2Id }] => { RETURN
8796093022357 AS person1Id,
8796093022390 AS person2Id
}
*/
MATCH path = allShortestPaths((person1:Person { id: $person1Id })-[:KNOWS*0..]-(person2:Person { id: $person2Id }))
WITH collect(path) as paths
UNWIND paths as path
WITH path, relationships(path) as rels_in_path
WITH
[n in nodes(path) | n.id ] as personIdsInPath,
[r in rels_in_path |
reduce(w=0.0, v in [
(a:Person)<-[:HAS_CREATOR]-(:Comment)-[:REPLY_OF]->(:Post)-[:HAS_CREATOR]->(b:Person)
WHERE
(a.id = startNode(r).id and b.id=endNode(r).id) OR (a.id=endNode(r).id and b.id=startNode(r).id)
| 1.0] | w+v)
] as weight1,
[r in rels_in_path |
reduce(w=0.0,v in [
(a:Person)<-[:HAS_CREATOR]-(:Comment)-[:REPLY_OF]->(:Comment)-[:HAS_CREATOR]->(b:Person)
WHERE
(a.id = startNode(r).id and b.id=endNode(r).id) OR (a.id=endNode(r).id and b.id=startNode(r).id)
| 0.5] | w+v)
] as weight2
WITH
personIdsInPath,
reduce(w=0.0,v in weight1| w+v) as w1,
reduce(w=0.0,v in weight2| w+v) as w2
MATCH path = allShortestPaths((person1:Person {id: $person1Id})-[:KNOWS*..15]-(person2:Person {id: $person2Id}))
WITH nodes(path) AS pathNodes
RETURN
personIdsInPath,
(w1+w2) as pathWeight
ORDER BY pathWeight desc
extract(n IN pathNodes | n.id) AS personIdsInPath,
reduce(weight = 0.0, idx IN range(1, size(pathNodes) - 1) | extract(prev IN [pathNodes[idx - 1]] | extract(curr IN [
pathNodes[idx]] | weight + length((curr)<-[:HAS_CREATOR]-(:Comment)-[:REPLY_OF]->(:Post)
-[:HAS_CREATOR]->(prev)) * 1.0 + length((prev)<-[:HAS_CREATOR]-(:Comment)-[:REPLY_OF]->(:Post)
-[:HAS_CREATOR]->(curr)) * 1.0 + length((prev)-[:HAS_CREATOR]-(:Comment)-[:REPLY_OF]-(:Comment)
-[:HAS_CREATOR]-(curr)) * 0.5))[0][0]) AS pathWight
ORDER BY pathWight DESC
Loading