I have books and authors. In SQL, I would have two tables and then I would create relations between them.
How does this work in the graph world? Should books and authors be separate nodes or are authors just additional node properties?
I've come up with the following code, but I'm not sure if it is redundant. I added authors both to Book node, and I've created a relationship to Author node.
CREATE
(b1:Book {title: "The Catcher in the Rye", author: "J.D. Salinger"}),
(b2:Book {title: "The Great Gatsby", author: "F. Scott Fitzgerald"}),
(b3:Book {title: "The Old Man and the Sea", author: "Ernest Hemingway"}),
(b4:Book {title: "For Whom The Bell Tolls", author: "Ernest Hemingway"}),
(a1:Author {name: "J.D. Salinger"}),
(a2:Author {name: "F. Scott Fitzgerald"}),
(a3:Author {name: "Ernest Hemingway"}),
(a1)-[:WROTE]->(b1),
(a1)-[:WROTE]->(b2),
(a3)-[:WROTE]->(b3),
(a3)-[:WROTE]->(b4)
Is adding authors to Book nodes redundant?