Skip to content

Commit 475ce05

Browse files
committed
Add instructions on using the example data set
1 parent 1e4b570 commit 475ce05

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

cypher/README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[Cypher](http://www.opencypher.org/) implementation of the [LDBC SNB benchmark](https://github.com/ldbc/ldbc_snb_docs).
44
Note that some BI queries are not expressed using pure Cypher, instead, they make use of the [APOC](https://neo4j.com/labs/) and [Graph Data Science](https://neo4j.com/product/graph-data-science-library/) Neo4j libraries.
55

6-
## Loading the Data in Neo4j
6+
## Loading the data in Neo4j
77

88
The Neo4j instance is run in Docker. To initialize the environment variables, use:
99

@@ -23,3 +23,19 @@ scripts/load-in-one-step.sh
2323
```
2424

2525
This script replaces the headers in the input CSVs, load them, starts Neo4j, and creates indices.
26+
27+
## Loading the example data set
28+
29+
Transform the example data set in the [data converter](https://github.com/ldbc/ldbc_snb_data_converter) repository, then rename it:
30+
31+
```bash
32+
./rename.sh
33+
```
34+
35+
In this repository, run
36+
```bash
37+
. scripts/environment-variables-default.sh
38+
export NEO4J_CSV_DIR=${DATA_CONVERTER_DIR}/ldbc_snb_data_converter/data/csv-composite-projected-fk-legacy-filenames
39+
export NEO4J_CSV_POSTFIX=.csv
40+
scripts/load-in-one-step.sh
41+
```

cypher/scripts/headers.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ dynamic/forum creationDate:DATETIME|id:ID(Forum)|title:STRING
1111
dynamic/person creationDate:DATETIME|id:ID(Person)|firstName:STRING|lastName:STRING|gender:STRING|birthday:DATE|locationIP:STRING|browserUsed:STRING|speaks:STRING[]|email:STRING[]
1212
dynamic/post creationDate:DATETIME|id:ID(Post)|imageFile:STRING|locationIP:STRING|browserUsed:STRING|language:STRING|content:STRING|length:LONG
1313
dynamic/comment_hasCreator_person creationDate:DATETIME|:START_ID(Comment)|:END_ID(Person)
14-
dynamic/comment_isLocatedIn_place creationDate:DATETIME|:START_ID(Comment)|:END_ID(Place)
14+
dynamic/comment_isLocatedIn_country creationDate:DATETIME|:START_ID(Comment)|:END_ID(Place)
1515
dynamic/comment_replyOf_comment creationDate:DATETIME|:START_ID(Comment)|:END_ID(Comment)
1616
dynamic/comment_replyOf_post creationDate:DATETIME|:START_ID(Comment)|:END_ID(Post)
1717
dynamic/forum_containerOf_post creationDate:DATETIME|:START_ID(Forum)|:END_ID(Post)
1818
dynamic/forum_hasMember_person creationDate:DATETIME|:START_ID(Forum)|:END_ID(Person)
1919
dynamic/forum_hasModerator_person creationDate:DATETIME|:START_ID(Forum)|:END_ID(Person)
2020
dynamic/forum_hasTag_tag creationDate:DATETIME|:START_ID(Forum)|:END_ID(Tag)
2121
dynamic/person_hasInterest_tag creationDate:DATETIME|:START_ID(Person)|:END_ID(Tag)
22-
dynamic/person_isLocatedIn_place creationDate:DATETIME|:START_ID(Person)|:END_ID(Place)
22+
dynamic/person_isLocatedIn_city creationDate:DATETIME|:START_ID(Person)|:END_ID(Place)
2323
dynamic/person_knows_person creationDate:DATETIME|:START_ID(Person)|:END_ID(Person)
2424
dynamic/person_likes_comment creationDate:DATETIME|:START_ID(Person)|:END_ID(Comment)
2525
dynamic/person_likes_post creationDate:DATETIME|:START_ID(Person)|:END_ID(Post)
@@ -28,4 +28,4 @@ dynamic/person_workAt_organisation creationDate:DATETIME|:START_ID(Person)|:END_
2828
dynamic/post_hasCreator_person creationDate:DATETIME|:START_ID(Post)|:END_ID(Person)
2929
dynamic/comment_hasTag_tag creationDate:DATETIME|:START_ID(Comment)|:END_ID(Tag)
3030
dynamic/post_hasTag_tag creationDate:DATETIME|:START_ID(Post)|:END_ID(Tag)
31-
dynamic/post_isLocatedIn_place creationDate:DATETIME|:START_ID(Post)|:END_ID(Place)
31+
dynamic/post_isLocatedIn_country creationDate:DATETIME|:START_ID(Post)|:END_ID(Place)

cypher/scripts/import-to-neo4j.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ docker run --rm \
4242
--relationships=IS_LOCATED_IN="/import/static/organisation_isLocatedIn_place${NEO4J_CSV_POSTFIX}" \
4343
--relationships=HAS_TYPE="/import/static/tag_hasType_tagclass${NEO4J_CSV_POSTFIX}" \
4444
--relationships=HAS_CREATOR="/import/dynamic/comment_hasCreator_person${NEO4J_CSV_POSTFIX}" \
45-
--relationships=IS_LOCATED_IN="/import/dynamic/comment_isLocatedIn_place${NEO4J_CSV_POSTFIX}" \
45+
--relationships=IS_LOCATED_IN="/import/dynamic/comment_isLocatedIn_country${NEO4J_CSV_POSTFIX}" \
4646
--relationships=REPLY_OF="/import/dynamic/comment_replyOf_comment${NEO4J_CSV_POSTFIX}" \
4747
--relationships=REPLY_OF="/import/dynamic/comment_replyOf_post${NEO4J_CSV_POSTFIX}" \
4848
--relationships=CONTAINER_OF="/import/dynamic/forum_containerOf_post${NEO4J_CSV_POSTFIX}" \
4949
--relationships=HAS_MEMBER="/import/dynamic/forum_hasMember_person${NEO4J_CSV_POSTFIX}" \
5050
--relationships=HAS_MODERATOR="/import/dynamic/forum_hasModerator_person${NEO4J_CSV_POSTFIX}" \
5151
--relationships=HAS_TAG="/import/dynamic/forum_hasTag_tag${NEO4J_CSV_POSTFIX}" \
5252
--relationships=HAS_INTEREST="/import/dynamic/person_hasInterest_tag${NEO4J_CSV_POSTFIX}" \
53-
--relationships=IS_LOCATED_IN="/import/dynamic/person_isLocatedIn_place${NEO4J_CSV_POSTFIX}" \
53+
--relationships=IS_LOCATED_IN="/import/dynamic/person_isLocatedIn_city${NEO4J_CSV_POSTFIX}" \
5454
--relationships=KNOWS="/import/dynamic/person_knows_person${NEO4J_CSV_POSTFIX}" \
5555
--relationships=LIKES="/import/dynamic/person_likes_comment${NEO4J_CSV_POSTFIX}" \
5656
--relationships=LIKES="/import/dynamic/person_likes_post${NEO4J_CSV_POSTFIX}" \
5757
--relationships=HAS_CREATOR="/import/dynamic/post_hasCreator_person${NEO4J_CSV_POSTFIX}" \
5858
--relationships=HAS_TAG="/import/dynamic/comment_hasTag_tag${NEO4J_CSV_POSTFIX}" \
5959
--relationships=HAS_TAG="/import/dynamic/post_hasTag_tag${NEO4J_CSV_POSTFIX}" \
60-
--relationships=IS_LOCATED_IN="/import/dynamic/post_isLocatedIn_place${NEO4J_CSV_POSTFIX}" \
60+
--relationships=IS_LOCATED_IN="/import/dynamic/post_isLocatedIn_country${NEO4J_CSV_POSTFIX}" \
6161
--relationships=STUDY_AT="/import/dynamic/person_studyAt_organisation${NEO4J_CSV_POSTFIX}" \
6262
--relationships=WORK_AT="/import/dynamic/person_workAt_organisation${NEO4J_CSV_POSTFIX}" \
6363
--delimiter '|'

0 commit comments

Comments
 (0)