How to map data from two files to one edge or vertex where vertex ID is not available in both files

Hi TG community,

In the TG documentation, it says that data can be mapped many-to-many meaning that two files should be able to be mapped to the same vertex or edge. However, I am unable to do this because TG requires the vertex ID to be identified from both of the files in the data mapping. In my case, the vertex ID is a concatenation of two variables that exist in one of the files but not the other. This means that I can’t map an attribute when in my csv file they are easily connected by an ID. One of the examples in my graph:

I have 2 vertices (“Accident” and “Consult”) that are connected by an edge. I have 2 csv files, one is called claims (that contains the attributes - cliamID, personID and acciToFirstConsult) and the other is called payments (that contains the attributes - claimID and paymentID). The “Accident” vertex primary ID is the concat of personID and claimID, the “Consult” vertex primary ID is the concat of paymentID and the constant “1”. I want to add the attribute acciToFirstConsult to the edge that connects the Accident and Consult Vertices but can’t because the claims csv file does not contain the paymentID from the payments file even though they can be connected via the claimID that exists in both files.

Is there a way to map this attribute on TG? Note, I am mapping the data via the TG interface.

Thanks for your help in advance!

@renatagot Is there anyway you can share a few screenshots (if you’re data isn’t sensitive)? GraphStudio data mapping allows for you to map your CSV files to the schema. If you’re CSV contains both IDs for both Vertex ID’s it should be possible. It sounds like you have multiple CSVs and one of the primary ID’s isn’t listed meaning you cannot connect the two attributes?

@Jon_Herke thank you for your quick response!

Yes that is correct, one of the CSV’s does not have the primary ID of one of the vertices. But I have done some basic analyses of this data with python and bc both files have the claimID, I was able to create this relationship and produce the attribute that I can’t map onto TG.

As a “new user” to the community I can only upload one image so I think this one is the most useful but I can send more.

I could prepare the data files to have the primary IDs in them but this seems inefficient. Is there any other way around this?


@renatagot Checking in to see if any additional help was needed on this thread?

Hi Jon, I wasn’t able to solve this so decided to create the node that I wanted to map data to, once the data has been loaded. Thank you for following up!

1 Like