I’ve just started using TigerGraph, and I saw in the import example that the edges files: friendship.csv is separated from the vertices files: person.csv.
Does it mean that if I have, say, 10 edges types I need or it would be better, to have 10 distinct csv files, each for a specific edge type ?
Honestly it is down to your preference for how you want to structure CSVs. If you are creating your own datasets, I would recommend trying to consolidate as many relations into a single file as possible. This can be done by specifying attributes and relationships for one vertex in a single CSV line.
Here is an example based on the file structure in the docs (be sure to scroll through the entire code to see the WHERE check for the person load):
CREATE LOADING JOB load_social FOR GRAPH social {
DEFINE FILENAME file1="/home/tigergraph/personAndFriendship.csv";
LOAD file1 TO VERTEX person VALUES ($"name", $"name", $"age", $"gender", $"state") WHERE NOT ($"age" IS EMPTY) USING header="true", separator=",";
LOAD file1 TO EDGE friendship VALUES ($0, $1, $5) USING header="true", separator=",";
}
This is how rows of data could look like in personAndFriendship.csv in order to specify both attributes and relationships:
Leo | Leo | 19 | Male | New York | Jon
Leo | Leo | | | | Mike
Leo | Leo | | | | Sara
The loading job language will understand that line 1 specifies attributes and a relationship with Jon, while lines 2 and 3 only specify a single relationship with Mike and Sara, respectively (since they are missing the attribute-defining cells).