0

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!

1 Answer 1

3

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”
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Didn't know about the --create-collection-type. Documentation (arangodb.com/docs/stable/programs-arangoimport-details.html) needs to be updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.