Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-01-2022 09:32 AM
Hi,
I have some data in the following format,
1.There are n columns with different locations.
2. Each row is associated with a unique token.
loc 1 loc 2 ..... loc n Token
Mumbai Maharashtra Dubai qwendnj1232
Delhi Assam Goa lkfdmglm00d
Hyderabad Orissa Chennai 98ufhwjbsfhd
Pune Kashmir Vizag aisdjidsanajk89
Create a relationship between Token values and remaining loc values such that, the relationship should be named after their respect loc column names.
From little knowledge, I have about Neo4J(Still learning), I used the following code but it associates all rows to all token values via a single relationship
LOAD CSV WITH HEADERS FROM 'file:///locations.csv' as row WITH row
WHERE row IS NOT NULL
CREATE (l:locations {name:row.name})
CREATE (t:tokens {name:row.Token})
SET l+={name:row.name}
CREATE (l) -[:RELATED_TO]->(t)
01-02-2022 08:19 PM
All the sessions of the conference are now available online