Skip to content
Achim Brandt edited this page Jun 13, 2014 · 31 revisions

ArangoDB-Logo

blueprints-arangodb-graph is an implementation of the Blueprints API for ArangoDB.

Example ArangoDBGraph

try {
  String graphName = "MyFirstGraph";
  String vertices = "MyVerticesCollection";
  String edges = "MyEdgesCollection";

  // create a connection configuration
  ArangoDBConfiguration configuration = new ArangoDBConfiguration();
  configuration.setHost("localhost");
  configuration.setPort(8529);
  // configuration.setDb("myTestDB");

  // create a ArangoDB graph
  ArangoDBGraph graph = new ArangoDBGraph(configuration, graphName, vertices, edges);
  			
  // create two vertices
  Vertex v1 = graph.addVertex("v1");
  Vertex v2 = graph.addVertex("v2");

  // create edge
  Edge e1 = graph.addEdge("e1", v1, v2, "knows");

  // close the graph
  graph.shutdown();
} catch (ArangoDBGraphException e) {
  e.printStackTrace();
  fail(e.getMessage());
}

More

Clone this wiki locally