Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-09-2019 08:44 PM
Here are the two datasets named books and genres both having columns Genre.
I want to create a relationship where books will be mapped to their respective genres(Please note: Each book has multiple genres)
The following code was run :
MATCH(B:Books),(G:Genres)
WHERE B.Genres CONTAINS G.Genres
CREATE (B)-[r:BelongsTo]->(G) RETURN type(r)
And the result obtained was :
By executing the above query, only the books belonging to Fiction Genre were mapped , but the other books belonging to the other categories were not mapped. Someone help please
10-10-2019 06:41 PM
It's hard to tell what design you want to achieve.
I wonder if you're just looking for a design that lets you run
MATCH (b:Book)-[:HAS_GENRE]->[g:Genre]
That's fine, so long as you've designed your data to be ready for this question. Perhaps you can provide more info on your end goals.
10-14-2019 01:13 PM
You may want to review your :Genre nodes and ensure there are no leading or trailing spaces, as that could be a reason why your matching isn't working as expected.
On a :Book node, is Genres
a list property, or is it one large string? Is there a reason why you're wanting to use substring matching instead of equality, for each genre in the list?
All the sessions of the conference are now available online