I have imported the csv files to arangodb, which are virtualmachine and server. Now, I would like to create the graph to show the relationship of virtualmachine and server.
I read the manual and try to define the Edge to correlate both collections. However I am not clear about how to define the edge. (i.e. I need to correlate the name of server with virtualhost of virtualmachine)
arangosh> myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
arangosh> myGraph.v2 = db.vertex.insert({ name : "vertex 2" });
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1, myGraph.v2, ........> { label : "knows"});
In this example, how to define myGraph?
JavaScript exception: ReferenceError: myGraph is not defined
!myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
!^
stacktrace: ReferenceError: myGraph is not defined
at <shell command>:1:1
Also, I should define the attribute of collection one by one? myGraph.v1 = db.server.insert({ name : "server" }); myGraph.v2 = db.virtualmachine.insert({ name : "virtualhost" });
Thanks for your help.