简体   繁体   中英

How To Bulk Load Graph Data into ArangoDB

While bulk document import is described in the ArangoDB documentation here , I was not able to find the equivalent documentation for bulk graph import. I suppose since vertices are documents in ArangoDB's data model that the former should be able to be used for loading vertices, but how are edges to be loaded?

Thanks for any help!

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”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM