Create relation between nodes (Person)-[:Member]-(Academy)

apoc
cypher
relationship
import

(Moji Tavoni) #1

Somehow I'm lost to create the relation between my nodes I have 3 CSV files trying to connect books to person s and the academies.
I have read and watched a lot's of videos and posts about creating and merging the relations between nodes but I'm still novel to creating them,
I have tried to import my data with ETL tool also with other ways import CSV with headers and so on .. and create the relations: but what I mean is to connect them by Ids and show the info's

MATCH (p:Person),(b:Book)
MERGE (b)-[:WRITE_BY]->(p)
MATCH (p:Person),(a:Academy)
MERGE (p)-[:MEMBER]->(a)
MATCH (b:Book),(a:Academy)
...

It would be great if anyone could help me specifically with my data to create the relations :pray:

we should also avoid creating NULL nodes, we have {
itacitemperson.id to itacitembook.ArtistIds,
itacitemacademy.id to itacitembook.AcademyIds
}

Thanks in advance


☢️ Ask for help importing data to neo4j
(Benoit Simard) #2

Can you share the headers of yours CSV ?

If the image correspond to your CSV, then I don't see the join between Person and Academy.


(Moji Tavoni) #3

The image is the MySQL diagram, these are CSV headers:

Person.csv

"Id","Surname","Forename","DateText","BirthDate","DeathDate","RecordId","Anagram","Nationality","PersonalTitles","Roles","TypographicalReference","Pseudonyms","Notes","EngraverReference","Name","Gender"

Book.csv

"Id","RecordId","Shelfmarks","SortedShelfmarks","AcademyIds","ArtistId","AuthorIds","CensorIds","CensorsAgreement","Content","DedicationPlace","Illustrations","Marginalia","Pagination","PublicationPlaceItalianNameId","PublicationPlaceFictitiousName","PrinterId","PrinterOrnament","Subjects","ShortTitle","LongTitle","PublicationYear","EditorIds","Formats","Languages","DedicateeIds","IllustratorIds","LibraryLocation","Edition","ContributorIds","Notes","PublicationPlaceLatinNameId","PublisherId","EngraverReference","PublicationPlaceEnglishNameId"

Academy.csv

"id","Name","StartDate","EndDate","DateText","Motto","Notes","EmblemDescription","RecordId","CityId","Roles","Alternativename","CityItalianName","CityEnglishName","CityLatinName"

Member.csv

"id","nickname","academyId","memberEmblemDescription","motto","personId"