Feature request: being able to create relationships without a link table.
Kushal Mohnot
If I understand correctly, in the data import wizard I am only able to create relationships if both the columns that have the index for my start node and end node are in the same CSV. I wonder if it is possible to not be rigid like that, for example if I have a basketball player dataset and another dataset for swimmers, I want to be able to join nodes from both datasets if they have the same name. Is something like this possible already and I just don't know how to do it?
Gregory King
Hi, it's not really an exact use case we intend to support, but you can sort of workaround it in the import tool.
Using your example, you could use either of the
Swimmer
and Basket Baller
files to define a SAME_PERSON_AS
relationship. See screen grabs for an illustration of using the name
in one of those files to link different Swimmer and BBaller nodes with the same name at each end of the relationship. You'll need to set the To
first and then the From
as the UI tries to stop you from setting both From
and To
as the same column, which usually doesn't make sense.You could also use Cypher to create the relationship after loading the nodes like so, but be warned this may not scale well as it creates a cartesian product.
```MATCH (bb:BBaller), (s:Swimmer)
WHERE bb.Name = s.Name
MERGE (bb)-[:SAME_PERSON_AS]->(s)```
Whether you want to do this and it's good data modelling for your graph is another question :)
Hope that helps!