i am new to this. I have a csv file with 48 thousand lines about people who have published articles along with other people. How can I create relationships between these people without repetition?
I have the id of their joint publication, the id of these people and their names. I want to create an offshoot using their collaborative post id. But I'm doing it wrong :( I create relationships for myself
load csv with headers from 'file:///1_.csv' as row with row where row.FIO is not null
Merge (fio:FIO{Name:row.FIO})
merge (fio_2:FIO{Soau:row.FIO})
Merge (fio)-[:WITH{idw:row.IDWORK}]->(fio_2)
Ops, mistake
there should be NAME
load csv with headers from 'file:///1_.csv' as row with row where row.NAME is not null
Merge (fio:NAME{Name:row.NAME})
merge (fio_2:NAME{Soau:row.NAME})
Merge (fio)-[:WITH{idw:row.IDWORK}]->(fio_2)
I am sorry.. I am having a difficult time understanding what is and what is not working.
I you thought you would get one node with the person's name in the below query, that will not happen because in one case you are looking for the property 'Name' to equal row.NAME and in the next it is the property 'Soau' equal to row.NAME. As such, you will get two nodes with the same name, but in different attributes.
load csv with headers from 'file:///1_.csv' as row with row where row.NAME is not null
Merge (fio:NAME{Name:row.NAME})
merge (fio_2:NAME{Soau:row.NAME})
Merge (fio)-[:WITH{idw:row.IDWORK}]->(fio_2)
From what I read, it looks like you have people writing articles, possibly together, and you want to link the authors to these articles. It seems you are linking them with a relationships, where the article's ID is a property of the relationships. This makes the relationships equivalent to the article. This is not the correct way of modeling this data. Relationships are for modeling relationships between two entities and nodes are for modeling entities. In your case, an article is an entity. I suggest you have 'Author' or 'People' nodes and you have 'Article' nodes, and you link the articles to their author nodes with a 'HAS_AUTHOR' relationship for each author.
Yes that's right!
I want to link article authors via IDWORK since it's shared between authors, but I can't figure out how to do it.
I wanted to do it like (author)-[ :WITH {idwork} ]-(author)