How to map data to city and region edge when primary id are different

Hi TG community,

I have designed my graph for city and region vertices as per TG webinar (Graph Gurus 3: Schema Modeling & Data Loading). There is a city and region for the person and for the accident. the accident region/city and person region/city are the same values but come from different variables in the file. Therefore, when I map data to the edge connecting city and region, I am not sure whether to use accident region/city or residential region/city for the region/city primary ID. In the notebook of the webinar I watched, it seems like the edge was mapped twice, once with person region and city variables as the primary ID and once with the accident region and city ID. However, in the graphstudio interface, I cannot map the edge more than once. What is best practice?

Please see screen shot of my graph and the load job that I am referring to from the webinar.

@renatagot Hopefully I’m reading the question correctly. I would use both. There might be an accident in a city/region that a patient doesn’t live in. You would want to capture that relationship.

The notebook is also using concat functions to create a unique ID (City+Region). To use the concat function in GraphStudio look for the image icon

When inserting in the edge you would want the ID’s to match

Patient CSV
City1 | Region1
City2 | Region1

Accident CSV
City1 | Region1
City3 | Region2

Using the concat function you would have:
Concat (City1+Region1) to get the City ID of City1Region1
Concat (Region1+City1) to get the Region ID of Region1+City1

City (Vertex)
ID: City1Region1

Region (Vertex)
ID Region1City1

We have weekly developer hour sessions (Tue 9:30am CST) on Discord if you’re interested in connecting with the Developer Relations team directly via virtual chat TigerGraph Graphe`

1 Like

Hi renatagot,

GraphStudio supports map each file to each vertex and edge type multiple times, each time with a different mapping
If the limit is because the mapping from the file to the same edge is overlapping, it’s a visualization limit, and the walkaround is to add the same source file twice, and create the different mappings


1 Like