Skip to content

Commit

Permalink
fix: Adapt test to changes in my book repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-simons committed Feb 7, 2024
1 parent 9dbf633 commit a05db54
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public R050__LoadBookData() {
public Query getQuery() {
// language=cypher
return new Query("""
LOAD CSV FROM '%s' AS row FIELDTERMINATOR ';'
MERGE (b:Book {title: trim(row[1])})
SET b.type = row[2], b.state = row[3]
LOAD CSV WITH HEADERS FROM '%s' AS row FIELDTERMINATOR ','
MERGE (b:Book {title: trim(row.Title)})
SET b.type = row.Type, b.state = row.State
WITH b, row
UNWIND split(row[0], '&') AS author
UNWIND split(row.Author, '&') AS author
WITH b, split(author, ',') AS author
WITH b, ((trim(coalesce(author[1], '')) + ' ') + trim(author[0])) AS author
MERGE (a:Person {name: trim(author)})
Expand Down

0 comments on commit a05db54

Please sign in to comment.