Edges in ArangoDB are also just document. So you can load both vertices and edges using the same bulk document import. Here are two examples:
– Csv documents/vertices:
arangoimp --file <path/filename> --collection <collectionName> --create-collection true --type csv --server.database <databaseName> —server.username <username>
– Csv edges:
arangoimp --file <path/filename> --collection <collectionName> --create-collection true --type csv --create-collection-type edge --server.database <databaseName> —server.username <username>
Notice that the only major difference is the create-collection-type argument set to edge when loading edges. Additionally the file containing the edge data should have the appropriate values for the _from and the _to attributes
Here are a few more options you may find useful:
Translating column names:
arangoimport --file "data.csv" --type csv --translate "from=_from" --translate "to=_to"
Ignore empty values (instead of throwing warnings and not loading data), use the flag:
--ignore-missing
ignore column in the import file:
arangoimport --file "data.csv" --type csv --remove-attribute “attributeName”