I am testing ArangoDb for using the graph features provided by the framework.
I am trying to create a very simple graph like below, similar to the Java driver example provided here, https://github.com/arangodb/arangodb-java-driver/
List<EdgeDefinitionEntity> edgeDefinitions = new ArrayList<EdgeDefinitionEntity>();
EdgeDefinitionEntity edgeDefinition = new EdgeDefinitionEntity();
edgeDefinition.setCollection("myEdgeCollection");
List<String> from = new ArrayList<String>();
from.add("myCollection1");
edgeDefinition.setFrom(from);
List<String> to = new ArrayList<String>();
to.add("myCollection2");
edgeDefinition.setTo(to);
edgeDefinitions.add(edgeDefinition);
GraphEntity graph = arangoDriver.createGraph("myGraph",
edgeDefinitions, null, true);
User myObject1 = new User("Homer", 38);
User myObject2 = new User("Bart", 36);
User myObject3 = new User("Marge", 39);
User myObject4 = new User("Lisa", 40);
DocumentEntity<User> vertexFrom1 = arangoDriver.graphCreateVertex(
"myGraph", "myCollection1", myObject1, true);
DocumentEntity<User> vertexFrom2 = arangoDriver.graphCreateVertex(
"myGraph", "myCollection1", myObject2, true);
DocumentEntity<User> vertexTo1 = arangoDriver.graphCreateVertex(
"myGraph", "myCollection2", myObject3, true);
DocumentEntity<User> vertexTo2 = arangoDriver.graphCreateVertex(
"myGraph", "myCollection2", myObject4, true);
EdgeEntity<?> edge1 = arangoDriver.graphCreateEdge("myGraph",
"myEdgeCollection", null, vertexFrom1.getDocumentHandle(),
vertexTo1.getDocumentHandle(), null, null);
EdgeEntity<?> edge2 = arangoDriver.graphCreateEdge("myGraph",
"myEdgeCollection", null, vertexFrom2.getDocumentHandle(),
vertexTo2.getDocumentHandle(), null, null);
The edge collection seems to have a right mapping,
{"_from":"myCollection1/1544266710","_to":"myCollection2/1544987606"}
{"_from":"myCollection1/1544528854","_to":"myCollection2/1545249750"}
I am trying to visualise this graph in the web interface. Graph visualization is showing some weird behaviour which I do not understand. In the above setup, I expect four nodes in the graph with edges between "Homer" -- "Marge" and "Bart" -- "Lisa" but I see only two nodes and one edge, i.e. Homer -- Marge.
Visulaization view itself sometimes shows that there are no nodes and on revisit to the same page nodes appear.