Is there some ways to bulk load graph data into arangoDB?

57 views
Skip to first unread message

Yichao Li

unread,
Jan 17, 2020, 12:55:19 AM1/17/20
to ArangoDB
According to the docs, I could only find ways to load data in collection/document ways.

Dave Challis

unread,
Jan 17, 2020, 4:29:38 AM1/17/20
to ArangoDB
You can also import graph edges in the same way (i.e. they're just an edge collection), so can import some documents, then bulk import edges to that collection with e.g.:

{"_from":"someCollection/1", "_to":"someCollection/2"}

etc.

Wilfried Gösgens

unread,
Jan 17, 2020, 4:57:09 AM1/17/20
to ArangoDB
Please have a look at ArangoImport:

If you prefer to roll your own, you can use the bulk document API:

Cheers,
Willi

Wilfried Gösgens

unread,
Jan 17, 2020, 5:00:03 AM1/17/20
to ArangoDB

Please Note that in ArangoDB Vertices are regular documents, and Edges are basically Documents with `_from` and `_to` attributes.

So whatever representation your graph comes in, you need to break it down to this.

Cheers,
Willi

lych4o

unread,
Jan 17, 2020, 5:56:21 AM1/17/20
to ArangoDB
I'm using arangoDB tinkerpop-provider in JAVA. If I load the collections with arangoimp, it would be a collection in the database without attached to a general graph in arangoDB graph module. So that I could not use a graph name to cite these collections together. 
To be more specific, if I use arangoimp, I would do something like this:
arangoimport --file "data.jsonl" --type jsonl --collection users --server.database "myDB"

This command would load the users collection into "myDB". Whereas in graph module under arangosh, I would operate a graph like this:
arangosh> var graph_module = require("@arangodb/general-graph");
arangosh
> var graph = graph_module._create("myGraph");
arangosh
> graph._addVertexCollection("shop");

Or this to load a existing graph:
arangosh> graph = graph_module._graph("social");

Also, in tinkerpop java provider I need to provide a graph name to indicate a general graph:
ArangoDBConfigurationBuilder builder = new ArangoDBConfigurationBuilder();
builder
.graph("modern").arangoUser("username").arangoPassword("password").
       withEdgeCollection("e").withVertexCollection("v").configureEdge("e", "v", "v");
Graph graph = GraphFactory.open(builder.build());


So the main gap between use collections and graph module is the graph name part. 
I wonder if there is some way to transfer a set of collections to a graph so that I could operate in graph module or some other ways.

在 2020年1月17日星期五 UTC+8下午6:00:03,Wilfried Gösgens写道:

Wilfried Gösgens

unread,
Jan 27, 2020, 3:38:40 AM1/27/20
to aran...@googlegroups.com
Hi,
You can still use a named graph that spans these collections.
However, feeding it via document operations means that you have to maintain the integrity of the graph - i.e. not to create dangling edges.

Cheers,
Willi

--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arangodb/76ef273e-4f83-401e-96e5-8fd90ef3fb34%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages