3. Importing data from CSV files
Prev | Chapter 6. Advanced tutorial: real use cases |

## 3. Importing data from CSV files

### Importing new nodes from CSV file

The example below represents graph with ten entities. We will see how to import this graph in Tulip with the CSV import.

`
node_id;second_major;gender;major_index;year;dorm;high_school;student_fac
0;0;2;205;2006;169;15903;1
1;0;2;207;2005;0;3029;2
2;0;1;208;0;0;3699;2
3;0;2;228;2006;169;17763;1
4;206;2;204;2006;0;2790;1
5;0;2;228;2005;169;50029;2
6;0;1;223;2006;169;3523;1
7;0;1;208;2007;169;2780;1
8;0;2;205;2006;170;5477;1
9;0;1;228;0;0;23675;1
`

1. Launch Tulip.

2. Click on "File->New"

3. Click on “Import CSV data.”

4. Edit the location field and select the file created from the example.

5. Choose the “;” character as separator.

6. Click on next.

7. Choose the columns you want to import (in our case all).

8. Click on next.

9. Select “New entities” in the “Import data on” list.

10. Click on the “Finish” button to launch the import.

11. You can now work with the imported graph.

### Importing new entities from CSV file

The example below represents graph with ten entities and eighteen relations. We will see how to import this graph in Tulip with the CSV import.

`
"Source","Target","second_major","gender","major_index"
0,3,0,2,205
0,4,0,2,207
0,5,0,1,208
0,6,0,2,228
0,8,206,2,204
0,9,0,2,228
1,2,0,1,223
2,3,0,1,208
2,4,0,2,205
2,6,0,1,228
2,7,200,1,201
3,6,0,2,199
3,7,0,2,202
3,9,0,2,199
4,8,0,2,209
4,9,200,1,201
5,7,206,2,223
8,9,0,1,223
`

1. Launch Tulip.

2. Click on "File->New"

3. Click on “Import CSV data.”

4. Edit the location field and select the file created from the example.

5. Choose the “,” character as separator.

6. Choose the “ ” ” character as text delimiter.

7. Click on next.

8. Choose the columns you want to import (in our case all).

9. Click on next.

10. Select “New relations” in the “Import data on” list.

11. Choose the “Source” column in the “Choose CSV column containing source entities id”.

12. Choose the “Target” column in the “Choose CSV column containing target entities id”.

13. Choose the “viewLabel” property in the “ Choose the property containing existing entities ids”.

14. Check the Create missing entities to force the creation of missing entities.

15. Click on the “Finish” button to launch the import.

16. You can now work with the imported graph.

Prev | Up |
2. People in InfoVis | Home |