While there is no wizard to import data, importing data into ArangoDB is also trivial assuming you are comfortable with the command line (which since you are in this site, I bet you are):
- use Arango import tool to import your CSV files into two collections
- Create your edge collection
- use a simple AQL query to insert data into the edge collection
Here is a sample syntax to import csv with arangoimp:
arangoimp --file <path/filename> --collection <collectionName> --create-collection true --type csv --server.database <databaseName> —server.username <username>
And here are some common options:
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”
Additionally, if you have the edge collection in a csv file already you can also import that directly:
arangoimp --file <path/filename> --collection <collectionName> --create-collection true --type csv --create-collection-type edge --server.database <databaseName>
Finally, note that 2 and 3 in the list above can be done in the Arango GUI if you are more comfortable there. The statement for 3 could be something like
let newEdges = ( for csv1rec in csv1_collection
for csv2rec in csv2_collection
filter csv1rec.id = csv2rec.colA
return {from : csv1rec.id , to : csv2rec.colA} )
for rec in newEdges
insert {_from: rec.from, _to: rec.to} in edgeCollection
Note that I am writing the AQL above for step 3 from memory, so it may need a little tweaking.