ArangoDB Graphs

First Steps with Graphs

A Graph consists of vertices and edges. Edges are stored as documents in edge collections. A vertex can be a document of a document collection or of an edge collection (so edges can be used as vertices). Which collections are used within a named graph is defined via edge definitions. A named graph can contain more than one edge definition, at least one is needed. Graphs allow you to structure your models in line with your domain and group them logically in collections and giving you the power to query them in the same graph queries.

New to graphs? Take our free graph course for freshers and get from zero knowledge to advanced query techniques.

Coming from a relational background - what’s a graph?

In SQL you commonly have the construct of a relation table to store n:m relations between two data tables. An edge collection is somewhat similar to these relation tables; vertex collections resemble the data tables with the objects to connect. While simple graph queries with fixed number of hops via the relation table may be doable in SQL with several nested joins, graph databases can handle an arbitrary number of these hops over edge collections - this is called traversal. Also edges in one edge collection may point to several vertex collections. Its common to have attributes attached to edges, i.e. a label naming this interconnection. Edges have a direction, with their relations _from and _to pointing from one document to another document stored in vertex collections. In queries you can define in which directions the edge relations may be followed (OUTBOUND: _from_to, INBOUND: _from_to, ANY: _from_to).

Supported Graph Algorithms

  • Traversal
    • following edges in outbound, inbound, or any direction
    • variable traversal depth between a defined minimum and maximum
    • breadth-first, depth-first, and weighted traversals
    • optionally with prune conditions
  • Shortest Path
  • k Shortest Paths
  • k Paths
  • Distributed Iterative Graph Processing (Pregel)
    • Page Rank
    • Seeded Page Rank
    • Single-Source Shortest Path (SSSP)
    • Connected Components
    • Weakly Connected Components (WCC)
    • Strongly Connected Components (SCC)
    • Hyperlink-Induced Topic Search (HITS)
    • Effective Closeness Vertex Centrality
    • LineRank Vertex Centrality
    • Label Propagation Community Detection
    • Speaker-Listener Label Propagation (SLPA) Community Detection
    • Programmable Pregel Algorithms (experimental)

Named Graphs

Named graphs are completely managed by ArangoDB, and thus also visible in the web interface. They use the full spectrum of ArangoDB’s graph features. You may access them via several interfaces.

Manipulating collections of named graphs with regular document functions

The underlying collections of the named graphs are still accessible using the standard methods for collections. However the graph module adds an additional layer on top of these collections giving you the following guarantees:

  • All modifications are executed transactional
  • If you delete a vertex all edges referring to this vertex will be deleted too
  • If you insert an edge it is checked if the edge matches the edge definitions

Your edge collections will only contain valid edges and you will never have loose ends. These guarantees are lost if you access the collections in any other way than the graph module, so if you delete documents from your vertex collections directly, the edges pointing to them will be remain in place.

Existing inconsistencies in your data will not be corrected when you create a named graph. Therefore, make sure you start with sound data as otherwise there could be dangling edges after all. The graph module guarantees to not introduce new inconsistencies only.

Anonymous graphs

Sometimes you may not need all the powers of named graphs, but some of its bits may be valuable to you. You may use anonymous graphs in the traversals and in the Working with Edges chapter. Anonymous graphs don’t have edge definitions describing which vertex collection is connected by which edge collection. The graph model has to be maintained in the client side code. This gives you more freedom than the strict named graphs.

When to choose anonymous or named graphs?

As noted above, named graphs ensure graph integrity, both when inserting or removing edges or vertices. So you won’t encounter dangling edges, even if you use the same vertex collection in several named graphs. This involves more operations inside the database which come at a cost. Therefore anonymous graphs may be faster in many operations. So this question may be narrowed down to: ‘Can I afford the additional effort or do I need the warranty for integrity?’.

Multiple edge collections vs. FILTERs on edge document attributes

If you want to only traverse edges of a specific type, there are two ways to achieve this. The first would be an attribute in the edge document - i.e. type, where you specify a differentiator for the edge - i.e. "friends", "family", "married" or "workmates", so you can later FILTER e.type = "friends" if you only want to follow the friend edges.

Another way, which may be more efficient in some cases, is to use different edge collections for different types of edges, so you have friend_edges, family_edges, married_edges and workmate_edges as collection names. You can then configure several named graphs including a subset of the available edge and vertex collections - or you use anonymous graph queries, where you specify a list of edge collections to take into account in that query. To only follow friend edges, you would specify friend_edges as sole edge collection.

Both approaches have advantages and disadvantages. FILTER operations on edge attributes will do comparisons on each traversed edge, which may become CPU-intense. When not finding the edges in the first place because of the collection containing them is not traversed at all, there will never be a reason to actually check for their type attribute with FILTER.

The multiple edge collections approach is limited by the number of collections that can be used simultaneously in one query. Every collection used in a query requires some resources inside of ArangoDB and the number is therefore limited to cap the resource requirements. You may also have constraints on other edge attributes, such as a hash index with a unique constraint, which requires the documents to be in a single collection for the uniqueness guarantee, and it may thus not be possible to store the different types of edges in multiple edge collections.

So, if your edges have about a dozen different types, it’s okay to choose the collection approach, otherwise the FILTER approach is preferred. You can still use FILTER operations on edges of course. You can get rid of a FILTER on the type with the former approach, everything else can stay the same.

Which part of my data is an Edge and which a Vertex?

The main objects in your data model, such as users, groups or articles, are usually considered to be vertices. For each type of object, a document collection (also called vertex collection) should store the individual entities. Entities can be connected by edges to express and classify relations between vertices. It often makes sense to have an edge collection per relation type.

ArangoDB does not require you to store your data in graph structures with edges and vertices, you can also decide to embed attributes such as which groups a user is part of, or _ids of documents in another document instead of connecting the documents with edges. It can be a meaningful performance optimization for 1:n relationships, if your data is not focused on relations and you don’t need graph traversal with varying depth. It usually means to introduce some redundancy and possibly inconsistencies if you embed data, but it can be an acceptable tradeoff.

Vertices

Let’s say we have two vertex collections, Users and Groups. Documents in the Groups collection contain the attributes of the Group, i.e. when it was founded, its subject, an icon URL and so on. Users documents contain the data specific to a user - like all names, birthdays, Avatar URLs, hobbies…

Edges

We can use an edge collection to store relations between users and groups. Since multiple users may be in an arbitrary number of groups, this is an m:n relation. The edge collection can be called UsersInGroups with i.e. one edge with _from pointing to Users/John and _to pointing to Groups/BowlingGroupHappyPin. This makes the user John a member of the group Bowling Group Happy Pin. Attributes of this relation may contain qualifiers to this relation, like the permissions of John in this group, the date when he joined the group etc.

User in group example

So roughly put, if you use documents and their attributes in a sentence, nouns would typically be vertices, verbs become the edges. You can see this in the knows graph below:

 Alice knows Bob, who in term knows Charlie.

Advantages of this approach

Graphs give you the advantage of not just being able to have a fixed number of m:n relations in a row, but an arbitrary number. Edges can be traversed in both directions, so it’s easy to determine all groups a user is in, but also to find out which members a certain group has. Users could also be interconnected to create a social network.

Using the graph data model, dealing with data that has lots of relations stays manageable and can be queried in very flexible ways, whereas it would cause headache to handle it in a relational database system.

Backup and restore

For sure you want to have backups of your graph data, you can use arangodump to create the backup, and arangorestore to restore a backup into a new ArangoDB. You should however note that:

  • you need the system collection _graphs if you backup named graphs.
  • you need to backup the complete set of all edge and vertex collections your graph consists of. Partial dump/restore may not work.

Managing graphs

By default you should use the interface your driver provides to manage graphs.

This is i.e. documented in Graphs-Section of the ArangoDB Java driver.

Example Graphs

ArangoDB comes with a set of easily graspable graphs that are used to demonstrate the APIs. You can use the add samples tab in the create graph window in the web interface, or load the module @arangodb/graph-examples/example-graph in arangosh and use it to create instances of these graphs in your ArangoDB. Once you’ve created them, you can inspect them in the web interface - which was used to create the pictures below.

You can easily look into the innards of this script for reference about how to manage graphs programmatically.

The Knows_Graph

A set of persons knowing each other: Persons relation Example Graph

The knows graph consists of one vertex collection persons connected via one edge collection knows. It will contain five persons Alice, Bob, Charlie, Dave and Eve. We will have the following directed relations:

  • Alice knows Bob
  • Bob knows Charlie
  • Bob knows Dave
  • Eve knows Alice
  • Eve knows Bob

This is how we create it, inspect its vertices and edges, and drop it again:

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("knows_graph");
arangosh> db.persons.toArray()
arangosh> db.knows.toArray();
arangosh> examples.dropGraph("knows_graph");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "alice", 
    "_id" : "persons/alice", 
    "_rev" : "_eLY0oiy--A", 
    "name" : "Alice" 
  }, 
  { 
    "_key" : "bob", 
    "_id" : "persons/bob", 
    "_rev" : "_eLY0oiy--B", 
    "name" : "Bob" 
  }, 
  { 
    "_key" : "charlie", 
    "_id" : "persons/charlie", 
    "_rev" : "_eLY0oiy--C", 
    "name" : "Charlie" 
  }, 
  { 
    "_key" : "dave", 
    "_id" : "persons/dave", 
    "_rev" : "_eLY0oiy--D", 
    "name" : "Dave" 
  }, 
  { 
    "_key" : "eve", 
    "_id" : "persons/eve", 
    "_rev" : "_eLY0oi2---", 
    "name" : "Eve" 
  } 
]
[ 
  { 
    "_key" : "81307", 
    "_id" : "knows/81307", 
    "_from" : "persons/alice", 
    "_to" : "persons/bob", 
    "_rev" : "_eLY0oi2--_", 
    "vertex" : "alice" 
  }, 
  { 
    "_key" : "81309", 
    "_id" : "knows/81309", 
    "_from" : "persons/bob", 
    "_to" : "persons/charlie", 
    "_rev" : "_eLY0oi2--A", 
    "vertex" : "bob" 
  }, 
  { 
    "_key" : "81311", 
    "_id" : "knows/81311", 
    "_from" : "persons/bob", 
    "_to" : "persons/dave", 
    "_rev" : "_eLY0oi2--B", 
    "vertex" : "bob" 
  }, 
  { 
    "_key" : "81313", 
    "_id" : "knows/81313", 
    "_from" : "persons/eve", 
    "_to" : "persons/alice", 
    "_rev" : "_eLY0oi2--C", 
    "vertex" : "eve" 
  }, 
  { 
    "_key" : "81315", 
    "_id" : "knows/81315", 
    "_from" : "persons/eve", 
    "_to" : "persons/bob", 
    "_rev" : "_eLY0oi2--D", 
    "vertex" : "eve" 
  } 
]

Note: with the default “Search Depth” of 2 of the graph viewer you may not see all edges of this graph.

The Social Graph

A set of persons and their relations:

Social Example Graph

This example has female and male persons as vertices in two vertex collections - female and male. The edges are their connections in the relation edge collection. This is how we create it, inspect its vertices and edges, and drop it again:

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var graph = examples.loadGraph("social");
arangosh> db.female.toArray()
arangosh> db.male.toArray()
arangosh> db.relation.toArray()
arangosh> examples.dropGraph("social");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "alice", 
    "_id" : "female/alice", 
    "_rev" : "_eLY0oka---", 
    "name" : "Alice" 
  }, 
  { 
    "_key" : "diana", 
    "_id" : "female/diana", 
    "_rev" : "_eLY0oka--B", 
    "name" : "Diana" 
  } 
]
[ 
  { 
    "_key" : "bob", 
    "_id" : "male/bob", 
    "_rev" : "_eLY0oka--_", 
    "name" : "Bob" 
  }, 
  { 
    "_key" : "charly", 
    "_id" : "male/charly", 
    "_rev" : "_eLY0oka--A", 
    "name" : "Charly" 
  } 
]
[ 
  { 
    "_key" : "81561", 
    "_id" : "relation/81561", 
    "_from" : "female/alice", 
    "_to" : "male/bob", 
    "_rev" : "_eLY0oka--C", 
    "type" : "married", 
    "vertex" : "alice" 
  }, 
  { 
    "_key" : "81563", 
    "_id" : "relation/81563", 
    "_from" : "female/alice", 
    "_to" : "male/charly", 
    "_rev" : "_eLY0oka--D", 
    "type" : "friend", 
    "vertex" : "alice" 
  }, 
  { 
    "_key" : "81565", 
    "_id" : "relation/81565", 
    "_from" : "male/charly", 
    "_to" : "female/diana", 
    "_rev" : "_eLY0oka--E", 
    "type" : "married", 
    "vertex" : "charly" 
  }, 
  { 
    "_key" : "81567", 
    "_id" : "relation/81567", 
    "_from" : "male/bob", 
    "_to" : "female/diana", 
    "_rev" : "_eLY0oke---", 
    "type" : "friend", 
    "vertex" : "bob" 
  } 
]

The City Graph

A set of european cities, and their fictional traveling distances as connections:

Cities Example Graph

The example has the cities as vertices in several vertex collections - germanCity and frenchCity. The edges are their interconnections in several edge collections french / german / international Highway. This is how we create it, inspect its edges and vertices, and drop it again:

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("routeplanner");
arangosh> db.frenchCity.toArray();
arangosh> db.germanCity.toArray();
arangosh> db.germanHighway.toArray();
arangosh> db.frenchHighway.toArray();
arangosh> db.internationalHighway.toArray();
arangosh> examples.dropGraph("routeplanner");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "Lyon", 
    "_id" : "frenchCity/Lyon", 
    "_rev" : "_eLY0ohG--B", 
    "population" : 80000, 
    "isCapital" : false, 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 
        4.84, 
        45.76 
      ] 
    } 
  }, 
  { 
    "_key" : "Paris", 
    "_id" : "frenchCity/Paris", 
    "_rev" : "_eLY0ohG--C", 
    "population" : 4000000, 
    "isCapital" : true, 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 
        2.3508, 
        48.8567 
      ] 
    } 
  } 
]
[ 
  { 
    "_key" : "Berlin", 
    "_id" : "germanCity/Berlin", 
    "_rev" : "_eLY0ohG---", 
    "population" : 3000000, 
    "isCapital" : true, 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 
        13.3833, 
        52.5167 
      ] 
    } 
  }, 
  { 
    "_key" : "Cologne", 
    "_id" : "germanCity/Cologne", 
    "_rev" : "_eLY0ohG--_", 
    "population" : 1000000, 
    "isCapital" : false, 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 
        6.9528, 
        50.9364 
      ] 
    } 
  }, 
  { 
    "_key" : "Hamburg", 
    "_id" : "germanCity/Hamburg", 
    "_rev" : "_eLY0ohG--A", 
    "population" : 1000000, 
    "isCapital" : false, 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 
        10.0014, 
        53.5653 
      ] 
    } 
  } 
]
[ 
  { 
    "_key" : "81068", 
    "_id" : "germanHighway/81068", 
    "_from" : "germanCity/Berlin", 
    "_to" : "germanCity/Cologne", 
    "_rev" : "_eLY0ohK--A", 
    "distance" : 850 
  }, 
  { 
    "_key" : "81070", 
    "_id" : "germanHighway/81070", 
    "_from" : "germanCity/Berlin", 
    "_to" : "germanCity/Hamburg", 
    "_rev" : "_eLY0ohK--B", 
    "distance" : 400 
  }, 
  { 
    "_key" : "81072", 
    "_id" : "germanHighway/81072", 
    "_from" : "germanCity/Hamburg", 
    "_to" : "germanCity/Cologne", 
    "_rev" : "_eLY0ohO---", 
    "distance" : 500 
  } 
]
[ 
  { 
    "_key" : "81074", 
    "_id" : "frenchHighway/81074", 
    "_from" : "frenchCity/Paris", 
    "_to" : "frenchCity/Lyon", 
    "_rev" : "_eLY0ohO--_", 
    "distance" : 550 
  } 
]
[ 
  { 
    "_key" : "81076", 
    "_id" : "internationalHighway/81076", 
    "_from" : "germanCity/Berlin", 
    "_to" : "frenchCity/Lyon", 
    "_rev" : "_eLY0ohO--A", 
    "distance" : 1100 
  }, 
  { 
    "_key" : "81078", 
    "_id" : "internationalHighway/81078", 
    "_from" : "germanCity/Berlin", 
    "_to" : "frenchCity/Paris", 
    "_rev" : "_eLY0ohO--B", 
    "distance" : 1200 
  }, 
  { 
    "_key" : "81080", 
    "_id" : "internationalHighway/81080", 
    "_from" : "germanCity/Hamburg", 
    "_to" : "frenchCity/Paris", 
    "_rev" : "_eLY0ohO--C", 
    "distance" : 900 
  }, 
  { 
    "_key" : "81082", 
    "_id" : "internationalHighway/81082", 
    "_from" : "germanCity/Hamburg", 
    "_to" : "frenchCity/Lyon", 
    "_rev" : "_eLY0ohO--D", 
    "distance" : 1300 
  }, 
  { 
    "_key" : "81084", 
    "_id" : "internationalHighway/81084", 
    "_from" : "germanCity/Cologne", 
    "_to" : "frenchCity/Lyon", 
    "_rev" : "_eLY0ohO--E", 
    "distance" : 700 
  }, 
  { 
    "_key" : "81086", 
    "_id" : "internationalHighway/81086", 
    "_from" : "germanCity/Cologne", 
    "_to" : "frenchCity/Paris", 
    "_rev" : "_eLY0ohO--F", 
    "distance" : 550 
  } 
]

The Traversal Graph

This graph was designed to demonstrate filters in traversals. It has some labels to filter on it.

Traversal Graph

The example has all its vertices in the circles collection, and an edges edge collection to connect them. Circles have unique numeric labels. Edges have two boolean attributes (theFalse always being false, theTruth always being true) and a label sorting B - D to the left side, G - K to the right side. Left and right side split into Paths - at B and G which are each direct neighbours of the root-node A. Starting from A the graph has a depth of 3 on all its paths.

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("traversalGraph");
arangosh> db.circles.toArray();
arangosh> db.edges.toArray();
arangosh> examples.dropGraph("traversalGraph");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "A", 
    "_id" : "circles/A", 
    "_rev" : "_eLY0oku--A", 
    "label" : "1" 
  }, 
  { 
    "_key" : "B", 
    "_id" : "circles/B", 
    "_rev" : "_eLY0oku--B", 
    "label" : "2" 
  }, 
  { 
    "_key" : "C", 
    "_id" : "circles/C", 
    "_rev" : "_eLY0oku--C", 
    "label" : "3" 
  }, 
  { 
    "_key" : "D", 
    "_id" : "circles/D", 
    "_rev" : "_eLY0oky---", 
    "label" : "4" 
  }, 
  { 
    "_key" : "E", 
    "_id" : "circles/E", 
    "_rev" : "_eLY0oky--_", 
    "label" : "5" 
  }, 
  { 
    "_key" : "F", 
    "_id" : "circles/F", 
    "_rev" : "_eLY0oky--A", 
    "label" : "6" 
  }, 
  { 
    "_key" : "G", 
    "_id" : "circles/G", 
    "_rev" : "_eLY0oky--B", 
    "label" : "7" 
  }, 
  { 
    "_key" : "H", 
    "_id" : "circles/H", 
    "_rev" : "_eLY0oky--C", 
    "label" : "8" 
  }, 
  { 
    "_key" : "I", 
    "_id" : "circles/I", 
    "_rev" : "_eLY0oky--D", 
    "label" : "9" 
  }, 
  { 
    "_key" : "J", 
    "_id" : "circles/J", 
    "_rev" : "_eLY0oky--E", 
    "label" : "10" 
  }, 
  { 
    "_key" : "K", 
    "_id" : "circles/K", 
    "_rev" : "_eLY0oky--F", 
    "label" : "11" 
  } 
]
[ 
  { 
    "_key" : "81629", 
    "_id" : "edges/81629", 
    "_from" : "circles/A", 
    "_to" : "circles/B", 
    "_rev" : "_eLY0oky--G", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "left_bar" 
  }, 
  { 
    "_key" : "81631", 
    "_id" : "edges/81631", 
    "_from" : "circles/B", 
    "_to" : "circles/C", 
    "_rev" : "_eLY0oky--H", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "left_blarg" 
  }, 
  { 
    "_key" : "81633", 
    "_id" : "edges/81633", 
    "_from" : "circles/C", 
    "_to" : "circles/D", 
    "_rev" : "_eLY0oky--I", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "left_blorg" 
  }, 
  { 
    "_key" : "81635", 
    "_id" : "edges/81635", 
    "_from" : "circles/B", 
    "_to" : "circles/E", 
    "_rev" : "_eLY0oky--J", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "left_blub" 
  }, 
  { 
    "_key" : "81637", 
    "_id" : "edges/81637", 
    "_from" : "circles/E", 
    "_to" : "circles/F", 
    "_rev" : "_eLY0ok2---", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "left_schubi" 
  }, 
  { 
    "_key" : "81639", 
    "_id" : "edges/81639", 
    "_from" : "circles/A", 
    "_to" : "circles/G", 
    "_rev" : "_eLY0ok2--_", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "right_foo" 
  }, 
  { 
    "_key" : "81641", 
    "_id" : "edges/81641", 
    "_from" : "circles/G", 
    "_to" : "circles/H", 
    "_rev" : "_eLY0ok2--A", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "right_blob" 
  }, 
  { 
    "_key" : "81643", 
    "_id" : "edges/81643", 
    "_from" : "circles/H", 
    "_to" : "circles/I", 
    "_rev" : "_eLY0ok2--B", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "right_blub" 
  }, 
  { 
    "_key" : "81645", 
    "_id" : "edges/81645", 
    "_from" : "circles/G", 
    "_to" : "circles/J", 
    "_rev" : "_eLY0ok2--C", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "right_zip" 
  }, 
  { 
    "_key" : "81647", 
    "_id" : "edges/81647", 
    "_from" : "circles/J", 
    "_to" : "circles/K", 
    "_rev" : "_eLY0ok2--D", 
    "theFalse" : false, 
    "theTruth" : true, 
    "label" : "right_zup" 
  } 
]

Note: with the default “Search Depth” of 2 of the graph viewer you may not see all nodes of this graph.

The k Shortest Paths Graph

The vertices in this graph are train stations of cities in Europe and North America and the edges represent train connections between them, with the travel time for both directions as edge weight.

Train Connection Map

See the k Shortest Paths page for query examples.

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("kShortestPathsGraph");
arangosh> db.places.toArray();
arangosh> db.connections.toArray();
arangosh> examples.dropGraph("kShortestPathsGraph");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "Inverness", 
    "_id" : "places/Inverness", 
    "_rev" : "_eLY0ojK---", 
    "label" : "Inverness" 
  }, 
  { 
    "_key" : "Aberdeen", 
    "_id" : "places/Aberdeen", 
    "_rev" : "_eLY0ojK--_", 
    "label" : "Aberdeen" 
  }, 
  { 
    "_key" : "Leuchars", 
    "_id" : "places/Leuchars", 
    "_rev" : "_eLY0ojK--A", 
    "label" : "Leuchars" 
  }, 
  { 
    "_key" : "StAndrews", 
    "_id" : "places/StAndrews", 
    "_rev" : "_eLY0ojK--B", 
    "label" : "StAndrews" 
  }, 
  { 
    "_key" : "Edinburgh", 
    "_id" : "places/Edinburgh", 
    "_rev" : "_eLY0ojK--C", 
    "label" : "Edinburgh" 
  }, 
  { 
    "_key" : "Glasgow", 
    "_id" : "places/Glasgow", 
    "_rev" : "_eLY0ojK--D", 
    "label" : "Glasgow" 
  }, 
  { 
    "_key" : "York", 
    "_id" : "places/York", 
    "_rev" : "_eLY0ojK--E", 
    "label" : "York" 
  }, 
  { 
    "_key" : "Carlisle", 
    "_id" : "places/Carlisle", 
    "_rev" : "_eLY0ojK--F", 
    "label" : "Carlisle" 
  }, 
  { 
    "_key" : "Birmingham", 
    "_id" : "places/Birmingham", 
    "_rev" : "_eLY0ojK--G", 
    "label" : "Birmingham" 
  }, 
  { 
    "_key" : "London", 
    "_id" : "places/London", 
    "_rev" : "_eLY0ojK--H", 
    "label" : "London" 
  }, 
  { 
    "_key" : "Brussels", 
    "_id" : "places/Brussels", 
    "_rev" : "_eLY0ojO---", 
    "label" : "Brussels" 
  }, 
  { 
    "_key" : "Cologne", 
    "_id" : "places/Cologne", 
    "_rev" : "_eLY0ojO--_", 
    "label" : "Cologne" 
  }, 
  { 
    "_key" : "Toronto", 
    "_id" : "places/Toronto", 
    "_rev" : "_eLY0ojO--A", 
    "label" : "Toronto" 
  }, 
  { 
    "_key" : "Winnipeg", 
    "_id" : "places/Winnipeg", 
    "_rev" : "_eLY0ojO--B", 
    "label" : "Winnipeg" 
  }, 
  { 
    "_key" : "Saskatoon", 
    "_id" : "places/Saskatoon", 
    "_rev" : "_eLY0ojO--C", 
    "label" : "Saskatoon" 
  }, 
  { 
    "_key" : "Edmonton", 
    "_id" : "places/Edmonton", 
    "_rev" : "_eLY0ojO--D", 
    "label" : "Edmonton" 
  }, 
  { 
    "_key" : "Jasper", 
    "_id" : "places/Jasper", 
    "_rev" : "_eLY0ojO--E", 
    "label" : "Jasper" 
  }, 
  { 
    "_key" : "Vancouver", 
    "_id" : "places/Vancouver", 
    "_rev" : "_eLY0ojO--F", 
    "label" : "Vancouver" 
  } 
]
[ 
  { 
    "_key" : "81376", 
    "_id" : "connections/81376", 
    "_from" : "places/Inverness", 
    "_to" : "places/Aberdeen", 
    "_rev" : "_eLY0ojO--G", 
    "travelTime" : 3 
  }, 
  { 
    "_key" : "81378", 
    "_id" : "connections/81378", 
    "_from" : "places/Aberdeen", 
    "_to" : "places/Inverness", 
    "_rev" : "_eLY0ojO--H", 
    "travelTime" : 2.5 
  }, 
  { 
    "_key" : "81380", 
    "_id" : "connections/81380", 
    "_from" : "places/Aberdeen", 
    "_to" : "places/Leuchars", 
    "_rev" : "_eLY0ojO--I", 
    "travelTime" : 1.5 
  }, 
  { 
    "_key" : "81382", 
    "_id" : "connections/81382", 
    "_from" : "places/Leuchars", 
    "_to" : "places/Aberdeen", 
    "_rev" : "_eLY0ojO--J", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81384", 
    "_id" : "connections/81384", 
    "_from" : "places/Leuchars", 
    "_to" : "places/Edinburgh", 
    "_rev" : "_eLY0ojS---", 
    "travelTime" : 1.5 
  }, 
  { 
    "_key" : "81386", 
    "_id" : "connections/81386", 
    "_from" : "places/Edinburgh", 
    "_to" : "places/Leuchars", 
    "_rev" : "_eLY0ojS--_", 
    "travelTime" : 3 
  }, 
  { 
    "_key" : "81388", 
    "_id" : "connections/81388", 
    "_from" : "places/Edinburgh", 
    "_to" : "places/Glasgow", 
    "_rev" : "_eLY0ojS--A", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81390", 
    "_id" : "connections/81390", 
    "_from" : "places/Glasgow", 
    "_to" : "places/Edinburgh", 
    "_rev" : "_eLY0ojS--B", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81392", 
    "_id" : "connections/81392", 
    "_from" : "places/Edinburgh", 
    "_to" : "places/York", 
    "_rev" : "_eLY0ojS--C", 
    "travelTime" : 3.5 
  }, 
  { 
    "_key" : "81394", 
    "_id" : "connections/81394", 
    "_from" : "places/York", 
    "_to" : "places/Edinburgh", 
    "_rev" : "_eLY0ojS--D", 
    "travelTime" : 4 
  }, 
  { 
    "_key" : "81396", 
    "_id" : "connections/81396", 
    "_from" : "places/Glasgow", 
    "_to" : "places/Carlisle", 
    "_rev" : "_eLY0ojS--E", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81398", 
    "_id" : "connections/81398", 
    "_from" : "places/Carlisle", 
    "_to" : "places/Glasgow", 
    "_rev" : "_eLY0ojS--F", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81400", 
    "_id" : "connections/81400", 
    "_from" : "places/Carlisle", 
    "_to" : "places/York", 
    "_rev" : "_eLY0ojS--G", 
    "travelTime" : 2.5 
  }, 
  { 
    "_key" : "81402", 
    "_id" : "connections/81402", 
    "_from" : "places/York", 
    "_to" : "places/Carlisle", 
    "_rev" : "_eLY0ojS--H", 
    "travelTime" : 3.5 
  }, 
  { 
    "_key" : "81404", 
    "_id" : "connections/81404", 
    "_from" : "places/Carlisle", 
    "_to" : "places/Birmingham", 
    "_rev" : "_eLY0ojW---", 
    "travelTime" : 2 
  }, 
  { 
    "_key" : "81406", 
    "_id" : "connections/81406", 
    "_from" : "places/Birmingham", 
    "_to" : "places/Carlisle", 
    "_rev" : "_eLY0ojW--_", 
    "travelTime" : 1 
  }, 
  { 
    "_key" : "81408", 
    "_id" : "connections/81408", 
    "_from" : "places/Birmingham", 
    "_to" : "places/London", 
    "_rev" : "_eLY0ojW--A", 
    "travelTime" : 1.5 
  }, 
  { 
    "_key" : "81410", 
    "_id" : "connections/81410", 
    "_from" : "places/London", 
    "_to" : "places/Birmingham", 
    "_rev" : "_eLY0ojW--B", 
    "travelTime" : 2.5 
  }, 
  { 
    "_key" : "81412", 
    "_id" : "connections/81412", 
    "_from" : "places/Leuchars", 
    "_to" : "places/StAndrews", 
    "_rev" : "_eLY0ojW--C", 
    "travelTime" : 0.2 
  }, 
  { 
    "_key" : "81414", 
    "_id" : "connections/81414", 
    "_from" : "places/StAndrews", 
    "_to" : "places/Leuchars", 
    "_rev" : "_eLY0ojW--D", 
    "travelTime" : 0.2 
  }, 
  { 
    "_key" : "81416", 
    "_id" : "connections/81416", 
    "_from" : "places/York", 
    "_to" : "places/London", 
    "_rev" : "_eLY0ojW--E", 
    "travelTime" : 1.8 
  }, 
  { 
    "_key" : "81418", 
    "_id" : "connections/81418", 
    "_from" : "places/London", 
    "_to" : "places/York", 
    "_rev" : "_eLY0ojW--F", 
    "travelTime" : 2 
  }, 
  { 
    "_key" : "81420", 
    "_id" : "connections/81420", 
    "_from" : "places/London", 
    "_to" : "places/Brussels", 
    "_rev" : "_eLY0ojW--G", 
    "travelTime" : 2.5 
  }, 
  { 
    "_key" : "81422", 
    "_id" : "connections/81422", 
    "_from" : "places/Brussels", 
    "_to" : "places/London", 
    "_rev" : "_eLY0ojW--H", 
    "travelTime" : 3.5 
  }, 
  { 
    "_key" : "81424", 
    "_id" : "connections/81424", 
    "_from" : "places/Brussels", 
    "_to" : "places/Cologne", 
    "_rev" : "_eLY0ojW--I", 
    "travelTime" : 2 
  }, 
  { 
    "_key" : "81426", 
    "_id" : "connections/81426", 
    "_from" : "places/Cologne", 
    "_to" : "places/Brussels", 
    "_rev" : "_eLY0oja---", 
    "travelTime" : 1.5 
  }, 
  { 
    "_key" : "81428", 
    "_id" : "connections/81428", 
    "_from" : "places/Toronto", 
    "_to" : "places/Winnipeg", 
    "_rev" : "_eLY0oja--_", 
    "travelTime" : 36 
  }, 
  { 
    "_key" : "81430", 
    "_id" : "connections/81430", 
    "_from" : "places/Winnipeg", 
    "_to" : "places/Toronto", 
    "_rev" : "_eLY0oja--A", 
    "travelTime" : 35 
  }, 
  { 
    "_key" : "81432", 
    "_id" : "connections/81432", 
    "_from" : "places/Winnipeg", 
    "_to" : "places/Saskatoon", 
    "_rev" : "_eLY0oja--B", 
    "travelTime" : 12 
  }, 
  { 
    "_key" : "81434", 
    "_id" : "connections/81434", 
    "_from" : "places/Saskatoon", 
    "_to" : "places/Winnipeg", 
    "_rev" : "_eLY0oja--C", 
    "travelTime" : 5 
  }, 
  { 
    "_key" : "81436", 
    "_id" : "connections/81436", 
    "_from" : "places/Saskatoon", 
    "_to" : "places/Edmonton", 
    "_rev" : "_eLY0oja--D", 
    "travelTime" : 12 
  }, 
  { 
    "_key" : "81438", 
    "_id" : "connections/81438", 
    "_from" : "places/Edmonton", 
    "_to" : "places/Saskatoon", 
    "_rev" : "_eLY0oja--E", 
    "travelTime" : 17 
  }, 
  { 
    "_key" : "81440", 
    "_id" : "connections/81440", 
    "_from" : "places/Edmonton", 
    "_to" : "places/Jasper", 
    "_rev" : "_eLY0oja--F", 
    "travelTime" : 6 
  }, 
  { 
    "_key" : "81442", 
    "_id" : "connections/81442", 
    "_from" : "places/Jasper", 
    "_to" : "places/Edmonton", 
    "_rev" : "_eLY0oja--G", 
    "travelTime" : 5 
  }, 
  { 
    "_key" : "81444", 
    "_id" : "connections/81444", 
    "_from" : "places/Jasper", 
    "_to" : "places/Vancouver", 
    "_rev" : "_eLY0oja--H", 
    "travelTime" : 12 
  }, 
  { 
    "_key" : "81446", 
    "_id" : "connections/81446", 
    "_from" : "places/Vancouver", 
    "_to" : "places/Jasper", 
    "_rev" : "_eLY0oja--I", 
    "travelTime" : 13 
  } 
]

The World Graph

World Graph

The world country graph structures its nodes like that: world → continent → country → capital. In some cases edge directions aren’t forward (therefore it will be displayed disjunct in the graph viewer). It has two ways of creating it. One using the named graph utilities (worldCountry), one without (worldCountryUnManaged). It is used to demonstrate raw traversal operations.

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("worldCountry");
arangosh> db.worldVertices.toArray();
arangosh> db.worldEdges.toArray();
arangosh> examples.dropGraph("worldCountry");
arangosh> var g = examples.loadGraph("worldCountryUnManaged");
arangosh> examples.dropGraph("worldCountryUnManaged");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "world", 
    "_id" : "worldVertices/world", 
    "_rev" : "_eLY0olW---", 
    "name" : "World", 
    "type" : "root" 
  }, 
  { 
    "_key" : "continent-africa", 
    "_id" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0olW--_", 
    "name" : "Africa", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "continent-asia", 
    "_id" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0olW--A", 
    "name" : "Asia", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "continent-australia", 
    "_id" : "worldVertices/continent-australia", 
    "_rev" : "_eLY0olW--B", 
    "name" : "Australia", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "continent-europe", 
    "_id" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0olW--C", 
    "name" : "Europe", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "continent-north-america", 
    "_id" : "worldVertices/continent-north-america", 
    "_rev" : "_eLY0olW--D", 
    "name" : "North America", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "continent-south-america", 
    "_id" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0olW--E", 
    "name" : "South America", 
    "type" : "continent" 
  }, 
  { 
    "_key" : "country-afghanistan", 
    "_id" : "worldVertices/country-afghanistan", 
    "_rev" : "_eLY0olW--F", 
    "name" : "Afghanistan", 
    "type" : "country", 
    "code" : "AFG" 
  }, 
  { 
    "_key" : "country-albania", 
    "_id" : "worldVertices/country-albania", 
    "_rev" : "_eLY0olW--G", 
    "name" : "Albania", 
    "type" : "country", 
    "code" : "ALB" 
  }, 
  { 
    "_key" : "country-algeria", 
    "_id" : "worldVertices/country-algeria", 
    "_rev" : "_eLY0olW--H", 
    "name" : "Algeria", 
    "type" : "country", 
    "code" : "DZA" 
  }, 
  { 
    "_key" : "country-andorra", 
    "_id" : "worldVertices/country-andorra", 
    "_rev" : "_eLY0olW--I", 
    "name" : "Andorra", 
    "type" : "country", 
    "code" : "AND" 
  }, 
  { 
    "_key" : "country-angola", 
    "_id" : "worldVertices/country-angola", 
    "_rev" : "_eLY0ola---", 
    "name" : "Angola", 
    "type" : "country", 
    "code" : "AGO" 
  }, 
  { 
    "_key" : "country-antigua-and-barbuda", 
    "_id" : "worldVertices/country-antigua-and-barbuda", 
    "_rev" : "_eLY0ola--_", 
    "name" : "Antigua and Barbuda", 
    "type" : "country", 
    "code" : "ATG" 
  }, 
  { 
    "_key" : "country-argentina", 
    "_id" : "worldVertices/country-argentina", 
    "_rev" : "_eLY0ola--A", 
    "name" : "Argentina", 
    "type" : "country", 
    "code" : "ARG" 
  }, 
  { 
    "_key" : "country-australia", 
    "_id" : "worldVertices/country-australia", 
    "_rev" : "_eLY0ola--B", 
    "name" : "Australia", 
    "type" : "country", 
    "code" : "AUS" 
  }, 
  { 
    "_key" : "country-austria", 
    "_id" : "worldVertices/country-austria", 
    "_rev" : "_eLY0ola--C", 
    "name" : "Austria", 
    "type" : "country", 
    "code" : "AUT" 
  }, 
  { 
    "_key" : "country-bahamas", 
    "_id" : "worldVertices/country-bahamas", 
    "_rev" : "_eLY0ola--D", 
    "name" : "Bahamas", 
    "type" : "country", 
    "code" : "BHS" 
  }, 
  { 
    "_key" : "country-bahrain", 
    "_id" : "worldVertices/country-bahrain", 
    "_rev" : "_eLY0ola--E", 
    "name" : "Bahrain", 
    "type" : "country", 
    "code" : "BHR" 
  }, 
  { 
    "_key" : "country-bangladesh", 
    "_id" : "worldVertices/country-bangladesh", 
    "_rev" : "_eLY0ola--F", 
    "name" : "Bangladesh", 
    "type" : "country", 
    "code" : "BGD" 
  }, 
  { 
    "_key" : "country-barbados", 
    "_id" : "worldVertices/country-barbados", 
    "_rev" : "_eLY0ola--G", 
    "name" : "Barbados", 
    "type" : "country", 
    "code" : "BRB" 
  }, 
  { 
    "_key" : "country-belgium", 
    "_id" : "worldVertices/country-belgium", 
    "_rev" : "_eLY0ola--H", 
    "name" : "Belgium", 
    "type" : "country", 
    "code" : "BEL" 
  }, 
  { 
    "_key" : "country-bhutan", 
    "_id" : "worldVertices/country-bhutan", 
    "_rev" : "_eLY0ola--I", 
    "name" : "Bhutan", 
    "type" : "country", 
    "code" : "BTN" 
  }, 
  { 
    "_key" : "country-bolivia", 
    "_id" : "worldVertices/country-bolivia", 
    "_rev" : "_eLY0ola--J", 
    "name" : "Bolivia", 
    "type" : "country", 
    "code" : "BOL" 
  }, 
  { 
    "_key" : "country-bosnia-and-herzegovina", 
    "_id" : "worldVertices/country-bosnia-and-herzegovina", 
    "_rev" : "_eLY0ola--K", 
    "name" : "Bosnia and Herzegovina", 
    "type" : "country", 
    "code" : "BIH" 
  }, 
  { 
    "_key" : "country-botswana", 
    "_id" : "worldVertices/country-botswana", 
    "_rev" : "_eLY0ole---", 
    "name" : "Botswana", 
    "type" : "country", 
    "code" : "BWA" 
  }, 
  { 
    "_key" : "country-brazil", 
    "_id" : "worldVertices/country-brazil", 
    "_rev" : "_eLY0ole--_", 
    "name" : "Brazil", 
    "type" : "country", 
    "code" : "BRA" 
  }, 
  { 
    "_key" : "country-brunei", 
    "_id" : "worldVertices/country-brunei", 
    "_rev" : "_eLY0ole--A", 
    "name" : "Brunei", 
    "type" : "country", 
    "code" : "BRN" 
  }, 
  { 
    "_key" : "country-bulgaria", 
    "_id" : "worldVertices/country-bulgaria", 
    "_rev" : "_eLY0ole--B", 
    "name" : "Bulgaria", 
    "type" : "country", 
    "code" : "BGR" 
  }, 
  { 
    "_key" : "country-burkina-faso", 
    "_id" : "worldVertices/country-burkina-faso", 
    "_rev" : "_eLY0ole--C", 
    "name" : "Burkina Faso", 
    "type" : "country", 
    "code" : "BFA" 
  }, 
  { 
    "_key" : "country-burundi", 
    "_id" : "worldVertices/country-burundi", 
    "_rev" : "_eLY0ole--D", 
    "name" : "Burundi", 
    "type" : "country", 
    "code" : "BDI" 
  }, 
  { 
    "_key" : "country-cambodia", 
    "_id" : "worldVertices/country-cambodia", 
    "_rev" : "_eLY0ole--E", 
    "name" : "Cambodia", 
    "type" : "country", 
    "code" : "KHM" 
  }, 
  { 
    "_key" : "country-cameroon", 
    "_id" : "worldVertices/country-cameroon", 
    "_rev" : "_eLY0ole--F", 
    "name" : "Cameroon", 
    "type" : "country", 
    "code" : "CMR" 
  }, 
  { 
    "_key" : "country-canada", 
    "_id" : "worldVertices/country-canada", 
    "_rev" : "_eLY0ole--G", 
    "name" : "Canada", 
    "type" : "country", 
    "code" : "CAN" 
  }, 
  { 
    "_key" : "country-chad", 
    "_id" : "worldVertices/country-chad", 
    "_rev" : "_eLY0ole--H", 
    "name" : "Chad", 
    "type" : "country", 
    "code" : "TCD" 
  }, 
  { 
    "_key" : "country-chile", 
    "_id" : "worldVertices/country-chile", 
    "_rev" : "_eLY0ole--I", 
    "name" : "Chile", 
    "type" : "country", 
    "code" : "CHL" 
  }, 
  { 
    "_key" : "country-colombia", 
    "_id" : "worldVertices/country-colombia", 
    "_rev" : "_eLY0ole--J", 
    "name" : "Colombia", 
    "type" : "country", 
    "code" : "COL" 
  }, 
  { 
    "_key" : "country-cote-d-ivoire", 
    "_id" : "worldVertices/country-cote-d-ivoire", 
    "_rev" : "_eLY0oli---", 
    "name" : "Cote d'Ivoire", 
    "type" : "country", 
    "code" : "CIV" 
  }, 
  { 
    "_key" : "country-croatia", 
    "_id" : "worldVertices/country-croatia", 
    "_rev" : "_eLY0oli--_", 
    "name" : "Croatia", 
    "type" : "country", 
    "code" : "HRV" 
  }, 
  { 
    "_key" : "country-czech-republic", 
    "_id" : "worldVertices/country-czech-republic", 
    "_rev" : "_eLY0oli--A", 
    "name" : "Czech Republic", 
    "type" : "country", 
    "code" : "CZE" 
  }, 
  { 
    "_key" : "country-denmark", 
    "_id" : "worldVertices/country-denmark", 
    "_rev" : "_eLY0oli--B", 
    "name" : "Denmark", 
    "type" : "country", 
    "code" : "DNK" 
  }, 
  { 
    "_key" : "country-ecuador", 
    "_id" : "worldVertices/country-ecuador", 
    "_rev" : "_eLY0oli--C", 
    "name" : "Ecuador", 
    "type" : "country", 
    "code" : "ECU" 
  }, 
  { 
    "_key" : "country-egypt", 
    "_id" : "worldVertices/country-egypt", 
    "_rev" : "_eLY0oli--D", 
    "name" : "Egypt", 
    "type" : "country", 
    "code" : "EGY" 
  }, 
  { 
    "_key" : "country-eritrea", 
    "_id" : "worldVertices/country-eritrea", 
    "_rev" : "_eLY0oli--E", 
    "name" : "Eritrea", 
    "type" : "country", 
    "code" : "ERI" 
  }, 
  { 
    "_key" : "country-finland", 
    "_id" : "worldVertices/country-finland", 
    "_rev" : "_eLY0oli--F", 
    "name" : "Finland", 
    "type" : "country", 
    "code" : "FIN" 
  }, 
  { 
    "_key" : "country-france", 
    "_id" : "worldVertices/country-france", 
    "_rev" : "_eLY0oli--G", 
    "name" : "France", 
    "type" : "country", 
    "code" : "FRA" 
  }, 
  { 
    "_key" : "country-germany", 
    "_id" : "worldVertices/country-germany", 
    "_rev" : "_eLY0oli--H", 
    "name" : "Germany", 
    "type" : "country", 
    "code" : "DEU" 
  }, 
  { 
    "_key" : "country-people-s-republic-of-china", 
    "_id" : "worldVertices/country-people-s-republic-of-china", 
    "_rev" : "_eLY0oli--I", 
    "name" : "People's Republic of China", 
    "type" : "country", 
    "code" : "CHN" 
  }, 
  { 
    "_key" : "capital-algiers", 
    "_id" : "worldVertices/capital-algiers", 
    "_rev" : "_eLY0oli--J", 
    "name" : "Algiers", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-andorra-la-vella", 
    "_id" : "worldVertices/capital-andorra-la-vella", 
    "_rev" : "_eLY0olm---", 
    "name" : "Andorra la Vella", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-asmara", 
    "_id" : "worldVertices/capital-asmara", 
    "_rev" : "_eLY0olm--_", 
    "name" : "Asmara", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-bandar-seri-begawan", 
    "_id" : "worldVertices/capital-bandar-seri-begawan", 
    "_rev" : "_eLY0olm--A", 
    "name" : "Bandar Seri Begawan", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-beijing", 
    "_id" : "worldVertices/capital-beijing", 
    "_rev" : "_eLY0olm--B", 
    "name" : "Beijing", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-berlin", 
    "_id" : "worldVertices/capital-berlin", 
    "_rev" : "_eLY0olm--C", 
    "name" : "Berlin", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-bogota", 
    "_id" : "worldVertices/capital-bogota", 
    "_rev" : "_eLY0olm--D", 
    "name" : "Bogota", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-brasilia", 
    "_id" : "worldVertices/capital-brasilia", 
    "_rev" : "_eLY0olm--E", 
    "name" : "Brasilia", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-bridgetown", 
    "_id" : "worldVertices/capital-bridgetown", 
    "_rev" : "_eLY0olm--F", 
    "name" : "Bridgetown", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-brussels", 
    "_id" : "worldVertices/capital-brussels", 
    "_rev" : "_eLY0olm--G", 
    "name" : "Brussels", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-buenos-aires", 
    "_id" : "worldVertices/capital-buenos-aires", 
    "_rev" : "_eLY0olm--H", 
    "name" : "Buenos Aires", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-bujumbura", 
    "_id" : "worldVertices/capital-bujumbura", 
    "_rev" : "_eLY0olm--I", 
    "name" : "Bujumbura", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-cairo", 
    "_id" : "worldVertices/capital-cairo", 
    "_rev" : "_eLY0olm--J", 
    "name" : "Cairo", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-canberra", 
    "_id" : "worldVertices/capital-canberra", 
    "_rev" : "_eLY0olq---", 
    "name" : "Canberra", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-copenhagen", 
    "_id" : "worldVertices/capital-copenhagen", 
    "_rev" : "_eLY0olq--_", 
    "name" : "Copenhagen", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-dhaka", 
    "_id" : "worldVertices/capital-dhaka", 
    "_rev" : "_eLY0olq--A", 
    "name" : "Dhaka", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-gaborone", 
    "_id" : "worldVertices/capital-gaborone", 
    "_rev" : "_eLY0olq--B", 
    "name" : "Gaborone", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-helsinki", 
    "_id" : "worldVertices/capital-helsinki", 
    "_rev" : "_eLY0olq--C", 
    "name" : "Helsinki", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-kabul", 
    "_id" : "worldVertices/capital-kabul", 
    "_rev" : "_eLY0olq--D", 
    "name" : "Kabul", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-la-paz", 
    "_id" : "worldVertices/capital-la-paz", 
    "_rev" : "_eLY0olq--E", 
    "name" : "La Paz", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-luanda", 
    "_id" : "worldVertices/capital-luanda", 
    "_rev" : "_eLY0olq--F", 
    "name" : "Luanda", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-manama", 
    "_id" : "worldVertices/capital-manama", 
    "_rev" : "_eLY0olq--G", 
    "name" : "Manama", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-nassau", 
    "_id" : "worldVertices/capital-nassau", 
    "_rev" : "_eLY0olq--H", 
    "name" : "Nassau", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-n-djamena", 
    "_id" : "worldVertices/capital-n-djamena", 
    "_rev" : "_eLY0olq--I", 
    "name" : "N'Djamena", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-ottawa", 
    "_id" : "worldVertices/capital-ottawa", 
    "_rev" : "_eLY0olq--J", 
    "name" : "Ottawa", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-ouagadougou", 
    "_id" : "worldVertices/capital-ouagadougou", 
    "_rev" : "_eLY0olq--K", 
    "name" : "Ouagadougou", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-paris", 
    "_id" : "worldVertices/capital-paris", 
    "_rev" : "_eLY0olu---", 
    "name" : "Paris", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-phnom-penh", 
    "_id" : "worldVertices/capital-phnom-penh", 
    "_rev" : "_eLY0olu--_", 
    "name" : "Phnom Penh", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-prague", 
    "_id" : "worldVertices/capital-prague", 
    "_rev" : "_eLY0olu--A", 
    "name" : "Prague", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-quito", 
    "_id" : "worldVertices/capital-quito", 
    "_rev" : "_eLY0olu--B", 
    "name" : "Quito", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-saint-john-s", 
    "_id" : "worldVertices/capital-saint-john-s", 
    "_rev" : "_eLY0olu--C", 
    "name" : "Saint John's", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-santiago", 
    "_id" : "worldVertices/capital-santiago", 
    "_rev" : "_eLY0olu--D", 
    "name" : "Santiago", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-sarajevo", 
    "_id" : "worldVertices/capital-sarajevo", 
    "_rev" : "_eLY0olu--E", 
    "name" : "Sarajevo", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-sofia", 
    "_id" : "worldVertices/capital-sofia", 
    "_rev" : "_eLY0olu--F", 
    "name" : "Sofia", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-thimphu", 
    "_id" : "worldVertices/capital-thimphu", 
    "_rev" : "_eLY0olu--G", 
    "name" : "Thimphu", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-tirana", 
    "_id" : "worldVertices/capital-tirana", 
    "_rev" : "_eLY0olu--H", 
    "name" : "Tirana", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-vienna", 
    "_id" : "worldVertices/capital-vienna", 
    "_rev" : "_eLY0olu--I", 
    "name" : "Vienna", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-yamoussoukro", 
    "_id" : "worldVertices/capital-yamoussoukro", 
    "_rev" : "_eLY0olu--J", 
    "name" : "Yamoussoukro", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-yaounde", 
    "_id" : "worldVertices/capital-yaounde", 
    "_rev" : "_eLY0oly---", 
    "name" : "Yaounde", 
    "type" : "capital" 
  }, 
  { 
    "_key" : "capital-zagreb", 
    "_id" : "worldVertices/capital-zagreb", 
    "_rev" : "_eLY0oly--_", 
    "name" : "Zagreb", 
    "type" : "capital" 
  } 
]
[ 
  { 
    "_key" : "81777", 
    "_id" : "worldEdges/81777", 
    "_from" : "worldVertices/continent-africa", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81779", 
    "_id" : "worldEdges/81779", 
    "_from" : "worldVertices/continent-asia", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81781", 
    "_id" : "worldEdges/81781", 
    "_from" : "worldVertices/continent-australia", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81783", 
    "_id" : "worldEdges/81783", 
    "_from" : "worldVertices/continent-europe", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81785", 
    "_id" : "worldEdges/81785", 
    "_from" : "worldVertices/continent-north-america", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81787", 
    "_id" : "worldEdges/81787", 
    "_from" : "worldVertices/continent-south-america", 
    "_to" : "worldVertices/world", 
    "_rev" : "_eLY0oly--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81789", 
    "_id" : "worldEdges/81789", 
    "_from" : "worldVertices/country-afghanistan", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0oly--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81791", 
    "_id" : "worldEdges/81791", 
    "_from" : "worldVertices/country-albania", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0oly--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81793", 
    "_id" : "worldEdges/81793", 
    "_from" : "worldVertices/country-algeria", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0oly--I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81795", 
    "_id" : "worldEdges/81795", 
    "_from" : "worldVertices/country-andorra", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0oly--J", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81797", 
    "_id" : "worldEdges/81797", 
    "_from" : "worldVertices/country-angola", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0ol2---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81799", 
    "_id" : "worldEdges/81799", 
    "_from" : "worldVertices/country-antigua-and-barbuda", 
    "_to" : "worldVertices/continent-north-america", 
    "_rev" : "_eLY0ol2--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81801", 
    "_id" : "worldEdges/81801", 
    "_from" : "worldVertices/country-argentina", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0ol2--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81803", 
    "_id" : "worldEdges/81803", 
    "_from" : "worldVertices/country-australia", 
    "_to" : "worldVertices/continent-australia", 
    "_rev" : "_eLY0ol2--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81805", 
    "_id" : "worldEdges/81805", 
    "_from" : "worldVertices/country-austria", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0ol2--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81807", 
    "_id" : "worldEdges/81807", 
    "_from" : "worldVertices/country-bahamas", 
    "_to" : "worldVertices/continent-north-america", 
    "_rev" : "_eLY0ol2--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81809", 
    "_id" : "worldEdges/81809", 
    "_from" : "worldVertices/country-bahrain", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0ol2--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81811", 
    "_id" : "worldEdges/81811", 
    "_from" : "worldVertices/country-bangladesh", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0ol2--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81813", 
    "_id" : "worldEdges/81813", 
    "_from" : "worldVertices/country-barbados", 
    "_to" : "worldVertices/continent-north-america", 
    "_rev" : "_eLY0ol2--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81815", 
    "_id" : "worldEdges/81815", 
    "_from" : "worldVertices/country-belgium", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0ol2--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81817", 
    "_id" : "worldEdges/81817", 
    "_from" : "worldVertices/country-bhutan", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0ol2--I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81819", 
    "_id" : "worldEdges/81819", 
    "_from" : "worldVertices/country-bolivia", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0ol6---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81821", 
    "_id" : "worldEdges/81821", 
    "_from" : "worldVertices/country-bosnia-and-herzegovina", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0ol6--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81823", 
    "_id" : "worldEdges/81823", 
    "_from" : "worldVertices/country-botswana", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0ol6--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81825", 
    "_id" : "worldEdges/81825", 
    "_from" : "worldVertices/country-brazil", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0ol6--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81827", 
    "_id" : "worldEdges/81827", 
    "_from" : "worldVertices/country-brunei", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0ol6--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81829", 
    "_id" : "worldEdges/81829", 
    "_from" : "worldVertices/country-bulgaria", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0ol6--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81831", 
    "_id" : "worldEdges/81831", 
    "_from" : "worldVertices/country-burkina-faso", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0ol6--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81833", 
    "_id" : "worldEdges/81833", 
    "_from" : "worldVertices/country-burundi", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0ol6--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81835", 
    "_id" : "worldEdges/81835", 
    "_from" : "worldVertices/country-cambodia", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0ol6--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81837", 
    "_id" : "worldEdges/81837", 
    "_from" : "worldVertices/country-cameroon", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0ol6--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81839", 
    "_id" : "worldEdges/81839", 
    "_from" : "worldVertices/country-canada", 
    "_to" : "worldVertices/continent-north-america", 
    "_rev" : "_eLY0ol6--I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81841", 
    "_id" : "worldEdges/81841", 
    "_from" : "worldVertices/country-chad", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0om----", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81843", 
    "_id" : "worldEdges/81843", 
    "_from" : "worldVertices/country-chile", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0om---_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81845", 
    "_id" : "worldEdges/81845", 
    "_from" : "worldVertices/country-colombia", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0om---A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81847", 
    "_id" : "worldEdges/81847", 
    "_from" : "worldVertices/country-cote-d-ivoire", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0om---B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81849", 
    "_id" : "worldEdges/81849", 
    "_from" : "worldVertices/country-croatia", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0om---C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81851", 
    "_id" : "worldEdges/81851", 
    "_from" : "worldVertices/country-czech-republic", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0om---D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81853", 
    "_id" : "worldEdges/81853", 
    "_from" : "worldVertices/country-denmark", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0om---E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81855", 
    "_id" : "worldEdges/81855", 
    "_from" : "worldVertices/country-ecuador", 
    "_to" : "worldVertices/continent-south-america", 
    "_rev" : "_eLY0om---F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81857", 
    "_id" : "worldEdges/81857", 
    "_from" : "worldVertices/country-egypt", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0om---G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81859", 
    "_id" : "worldEdges/81859", 
    "_from" : "worldVertices/country-eritrea", 
    "_to" : "worldVertices/continent-africa", 
    "_rev" : "_eLY0om---H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81861", 
    "_id" : "worldEdges/81861", 
    "_from" : "worldVertices/country-finland", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0om---I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81863", 
    "_id" : "worldEdges/81863", 
    "_from" : "worldVertices/country-france", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0omC---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81865", 
    "_id" : "worldEdges/81865", 
    "_from" : "worldVertices/country-germany", 
    "_to" : "worldVertices/continent-europe", 
    "_rev" : "_eLY0omC--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81867", 
    "_id" : "worldEdges/81867", 
    "_from" : "worldVertices/country-people-s-republic-of-china", 
    "_to" : "worldVertices/continent-asia", 
    "_rev" : "_eLY0omC--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81869", 
    "_id" : "worldEdges/81869", 
    "_from" : "worldVertices/capital-algiers", 
    "_to" : "worldVertices/country-algeria", 
    "_rev" : "_eLY0omC--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81871", 
    "_id" : "worldEdges/81871", 
    "_from" : "worldVertices/capital-andorra-la-vella", 
    "_to" : "worldVertices/country-andorra", 
    "_rev" : "_eLY0omC--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81873", 
    "_id" : "worldEdges/81873", 
    "_from" : "worldVertices/capital-asmara", 
    "_to" : "worldVertices/country-eritrea", 
    "_rev" : "_eLY0omC--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81875", 
    "_id" : "worldEdges/81875", 
    "_from" : "worldVertices/capital-bandar-seri-begawan", 
    "_to" : "worldVertices/country-brunei", 
    "_rev" : "_eLY0omC--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81877", 
    "_id" : "worldEdges/81877", 
    "_from" : "worldVertices/capital-beijing", 
    "_to" : "worldVertices/country-people-s-republic-of-china", 
    "_rev" : "_eLY0omC--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81879", 
    "_id" : "worldEdges/81879", 
    "_from" : "worldVertices/capital-berlin", 
    "_to" : "worldVertices/country-germany", 
    "_rev" : "_eLY0omC--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81881", 
    "_id" : "worldEdges/81881", 
    "_from" : "worldVertices/capital-bogota", 
    "_to" : "worldVertices/country-colombia", 
    "_rev" : "_eLY0omC--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81883", 
    "_id" : "worldEdges/81883", 
    "_from" : "worldVertices/capital-brasilia", 
    "_to" : "worldVertices/country-brazil", 
    "_rev" : "_eLY0omC--I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81885", 
    "_id" : "worldEdges/81885", 
    "_from" : "worldVertices/capital-bridgetown", 
    "_to" : "worldVertices/country-barbados", 
    "_rev" : "_eLY0omG---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81887", 
    "_id" : "worldEdges/81887", 
    "_from" : "worldVertices/capital-brussels", 
    "_to" : "worldVertices/country-belgium", 
    "_rev" : "_eLY0omG--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81889", 
    "_id" : "worldEdges/81889", 
    "_from" : "worldVertices/capital-buenos-aires", 
    "_to" : "worldVertices/country-argentina", 
    "_rev" : "_eLY0omG--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81891", 
    "_id" : "worldEdges/81891", 
    "_from" : "worldVertices/capital-bujumbura", 
    "_to" : "worldVertices/country-burundi", 
    "_rev" : "_eLY0omG--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81893", 
    "_id" : "worldEdges/81893", 
    "_from" : "worldVertices/capital-cairo", 
    "_to" : "worldVertices/country-egypt", 
    "_rev" : "_eLY0omG--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81895", 
    "_id" : "worldEdges/81895", 
    "_from" : "worldVertices/capital-canberra", 
    "_to" : "worldVertices/country-australia", 
    "_rev" : "_eLY0omG--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81897", 
    "_id" : "worldEdges/81897", 
    "_from" : "worldVertices/capital-copenhagen", 
    "_to" : "worldVertices/country-denmark", 
    "_rev" : "_eLY0omG--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81899", 
    "_id" : "worldEdges/81899", 
    "_from" : "worldVertices/capital-dhaka", 
    "_to" : "worldVertices/country-bangladesh", 
    "_rev" : "_eLY0omG--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81901", 
    "_id" : "worldEdges/81901", 
    "_from" : "worldVertices/capital-gaborone", 
    "_to" : "worldVertices/country-botswana", 
    "_rev" : "_eLY0omG--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81903", 
    "_id" : "worldEdges/81903", 
    "_from" : "worldVertices/capital-helsinki", 
    "_to" : "worldVertices/country-finland", 
    "_rev" : "_eLY0omG--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81905", 
    "_id" : "worldEdges/81905", 
    "_from" : "worldVertices/capital-kabul", 
    "_to" : "worldVertices/country-afghanistan", 
    "_rev" : "_eLY0omG--I", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81907", 
    "_id" : "worldEdges/81907", 
    "_from" : "worldVertices/capital-la-paz", 
    "_to" : "worldVertices/country-bolivia", 
    "_rev" : "_eLY0omG--J", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81909", 
    "_id" : "worldEdges/81909", 
    "_from" : "worldVertices/capital-luanda", 
    "_to" : "worldVertices/country-angola", 
    "_rev" : "_eLY0omK---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81911", 
    "_id" : "worldEdges/81911", 
    "_from" : "worldVertices/capital-manama", 
    "_to" : "worldVertices/country-bahrain", 
    "_rev" : "_eLY0omK--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81913", 
    "_id" : "worldEdges/81913", 
    "_from" : "worldVertices/capital-nassau", 
    "_to" : "worldVertices/country-bahamas", 
    "_rev" : "_eLY0omK--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81915", 
    "_id" : "worldEdges/81915", 
    "_from" : "worldVertices/capital-n-djamena", 
    "_to" : "worldVertices/country-chad", 
    "_rev" : "_eLY0omK--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81917", 
    "_id" : "worldEdges/81917", 
    "_from" : "worldVertices/capital-ottawa", 
    "_to" : "worldVertices/country-canada", 
    "_rev" : "_eLY0omK--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81919", 
    "_id" : "worldEdges/81919", 
    "_from" : "worldVertices/capital-ouagadougou", 
    "_to" : "worldVertices/country-burkina-faso", 
    "_rev" : "_eLY0omK--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81921", 
    "_id" : "worldEdges/81921", 
    "_from" : "worldVertices/capital-paris", 
    "_to" : "worldVertices/country-france", 
    "_rev" : "_eLY0omK--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81923", 
    "_id" : "worldEdges/81923", 
    "_from" : "worldVertices/capital-phnom-penh", 
    "_to" : "worldVertices/country-cambodia", 
    "_rev" : "_eLY0omK--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81925", 
    "_id" : "worldEdges/81925", 
    "_from" : "worldVertices/capital-prague", 
    "_to" : "worldVertices/country-czech-republic", 
    "_rev" : "_eLY0omK--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81927", 
    "_id" : "worldEdges/81927", 
    "_from" : "worldVertices/capital-quito", 
    "_to" : "worldVertices/country-ecuador", 
    "_rev" : "_eLY0omK--H", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81929", 
    "_id" : "worldEdges/81929", 
    "_from" : "worldVertices/capital-saint-john-s", 
    "_to" : "worldVertices/country-antigua-and-barbuda", 
    "_rev" : "_eLY0omO---", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81931", 
    "_id" : "worldEdges/81931", 
    "_from" : "worldVertices/capital-santiago", 
    "_to" : "worldVertices/country-chile", 
    "_rev" : "_eLY0omO--_", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81933", 
    "_id" : "worldEdges/81933", 
    "_from" : "worldVertices/capital-sarajevo", 
    "_to" : "worldVertices/country-bosnia-and-herzegovina", 
    "_rev" : "_eLY0omO--A", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81935", 
    "_id" : "worldEdges/81935", 
    "_from" : "worldVertices/capital-sofia", 
    "_to" : "worldVertices/country-bulgaria", 
    "_rev" : "_eLY0omO--B", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81937", 
    "_id" : "worldEdges/81937", 
    "_from" : "worldVertices/capital-thimphu", 
    "_to" : "worldVertices/country-bhutan", 
    "_rev" : "_eLY0omO--C", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81939", 
    "_id" : "worldEdges/81939", 
    "_from" : "worldVertices/capital-tirana", 
    "_to" : "worldVertices/country-albania", 
    "_rev" : "_eLY0omO--D", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81941", 
    "_id" : "worldEdges/81941", 
    "_from" : "worldVertices/capital-vienna", 
    "_to" : "worldVertices/country-austria", 
    "_rev" : "_eLY0omO--E", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81943", 
    "_id" : "worldEdges/81943", 
    "_from" : "worldVertices/capital-yamoussoukro", 
    "_to" : "worldVertices/country-cote-d-ivoire", 
    "_rev" : "_eLY0omO--F", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81945", 
    "_id" : "worldEdges/81945", 
    "_from" : "worldVertices/capital-yaounde", 
    "_to" : "worldVertices/country-cameroon", 
    "_rev" : "_eLY0omO--G", 
    "type" : "is-in" 
  }, 
  { 
    "_key" : "81947", 
    "_id" : "worldEdges/81947", 
    "_from" : "worldVertices/capital-zagreb", 
    "_to" : "worldVertices/country-croatia", 
    "_rev" : "_eLY0omO--H", 
    "type" : "is-in" 
  } 
]

The Mps Graph

This graph was created to demonstrate a use case of the shortest path algorithm. Even though the algorithm can only determine one shortest path, it is possible to return multiple shortest paths with two separate queries. Therefore the graph is named after the multiple path search use case.

Mps Graph

The example graph consists of vertices in the mps_verts collection and edges in the mps_edges collection. It is a simple traversal graph with start node A and end node C.

This is how we create it, inspect its vertices and edges, and drop it again:

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("mps_graph");
arangosh> db.mps_verts.toArray();
arangosh> db.mps_edges.toArray();
arangosh> examples.dropGraph("mps_graph");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "A", 
    "_id" : "mps_verts/A", 
    "_rev" : "_eLY0okC---" 
  }, 
  { 
    "_key" : "B", 
    "_id" : "mps_verts/B", 
    "_rev" : "_eLY0okC--_" 
  }, 
  { 
    "_key" : "C", 
    "_id" : "mps_verts/C", 
    "_rev" : "_eLY0okC--A" 
  }, 
  { 
    "_key" : "D", 
    "_id" : "mps_verts/D", 
    "_rev" : "_eLY0okC--B" 
  }, 
  { 
    "_key" : "E", 
    "_id" : "mps_verts/E", 
    "_rev" : "_eLY0okC--C" 
  }, 
  { 
    "_key" : "F", 
    "_id" : "mps_verts/F", 
    "_rev" : "_eLY0okC--D" 
  } 
]
[ 
  { 
    "_key" : "81495", 
    "_id" : "mps_edges/81495", 
    "_from" : "mps_verts/A", 
    "_to" : "mps_verts/B", 
    "_rev" : "_eLY0okC--E", 
    "vertex" : "A" 
  }, 
  { 
    "_key" : "81497", 
    "_id" : "mps_edges/81497", 
    "_from" : "mps_verts/A", 
    "_to" : "mps_verts/E", 
    "_rev" : "_eLY0okC--F", 
    "vertex" : "A" 
  }, 
  { 
    "_key" : "81499", 
    "_id" : "mps_edges/81499", 
    "_from" : "mps_verts/A", 
    "_to" : "mps_verts/D", 
    "_rev" : "_eLY0okC--G", 
    "vertex" : "A" 
  }, 
  { 
    "_key" : "81501", 
    "_id" : "mps_edges/81501", 
    "_from" : "mps_verts/B", 
    "_to" : "mps_verts/C", 
    "_rev" : "_eLY0okC--H", 
    "vertex" : "B" 
  }, 
  { 
    "_key" : "81503", 
    "_id" : "mps_edges/81503", 
    "_from" : "mps_verts/D", 
    "_to" : "mps_verts/C", 
    "_rev" : "_eLY0okC--I", 
    "vertex" : "D" 
  }, 
  { 
    "_key" : "81505", 
    "_id" : "mps_edges/81505", 
    "_from" : "mps_verts/E", 
    "_to" : "mps_verts/F", 
    "_rev" : "_eLY0okG---", 
    "vertex" : "E" 
  }, 
  { 
    "_key" : "81507", 
    "_id" : "mps_edges/81507", 
    "_from" : "mps_verts/F", 
    "_to" : "mps_verts/C", 
    "_rev" : "_eLY0okG--_", 
    "vertex" : "F" 
  } 
]

The Connected Components Graph

A small example graph comprised of components (vertices) and connections (edges). Good for trying out Pregel algorithms such as Weakly Connected Components (WCC).

Also see:

Three disjoint subgraphs with 36 nodes and edges in total

arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
arangosh> var g = examples.loadGraph("connectedComponentsGraph");
arangosh> db.components.toArray();
arangosh> db.connections.toArray();
arangosh> examples.dropGraph("connectedComponentsGraph");
Show execution results
Hide execution results
[ 
  { 
    "_key" : "A1", 
    "_id" : "components/A1", 
    "_rev" : "_eLY0ohy---" 
  }, 
  { 
    "_key" : "A2", 
    "_id" : "components/A2", 
    "_rev" : "_eLY0ohy--_" 
  }, 
  { 
    "_key" : "A3", 
    "_id" : "components/A3", 
    "_rev" : "_eLY0ohy--A" 
  }, 
  { 
    "_key" : "A4", 
    "_id" : "components/A4", 
    "_rev" : "_eLY0ohy--B" 
  }, 
  { 
    "_key" : "B1", 
    "_id" : "components/B1", 
    "_rev" : "_eLY0ohy--C" 
  }, 
  { 
    "_key" : "B3", 
    "_id" : "components/B3", 
    "_rev" : "_eLY0ohy--D" 
  }, 
  { 
    "_key" : "B2", 
    "_id" : "components/B2", 
    "_rev" : "_eLY0ohy--E" 
  }, 
  { 
    "_key" : "B4", 
    "_id" : "components/B4", 
    "_rev" : "_eLY0ohy--F" 
  }, 
  { 
    "_key" : "B6", 
    "_id" : "components/B6", 
    "_rev" : "_eLY0oh2---" 
  }, 
  { 
    "_key" : "B5", 
    "_id" : "components/B5", 
    "_rev" : "_eLY0oh2--_" 
  }, 
  { 
    "_key" : "B7", 
    "_id" : "components/B7", 
    "_rev" : "_eLY0oh2--A" 
  }, 
  { 
    "_key" : "B8", 
    "_id" : "components/B8", 
    "_rev" : "_eLY0oh2--B" 
  }, 
  { 
    "_key" : "B9", 
    "_id" : "components/B9", 
    "_rev" : "_eLY0oh2--C" 
  }, 
  { 
    "_key" : "B10", 
    "_id" : "components/B10", 
    "_rev" : "_eLY0oh2--D" 
  }, 
  { 
    "_key" : "B19", 
    "_id" : "components/B19", 
    "_rev" : "_eLY0oh2--E" 
  }, 
  { 
    "_key" : "B11", 
    "_id" : "components/B11", 
    "_rev" : "_eLY0oh2--F" 
  }, 
  { 
    "_key" : "B12", 
    "_id" : "components/B12", 
    "_rev" : "_eLY0oh2--G" 
  }, 
  { 
    "_key" : "B13", 
    "_id" : "components/B13", 
    "_rev" : "_eLY0oh2--H" 
  }, 
  { 
    "_key" : "B20", 
    "_id" : "components/B20", 
    "_rev" : "_eLY0oh2--I" 
  }, 
  { 
    "_key" : "B14", 
    "_id" : "components/B14", 
    "_rev" : "_eLY0oh2--J" 
  }, 
  { 
    "_key" : "B15", 
    "_id" : "components/B15", 
    "_rev" : "_eLY0oh6---" 
  }, 
  { 
    "_key" : "B16", 
    "_id" : "components/B16", 
    "_rev" : "_eLY0oh6--_" 
  }, 
  { 
    "_key" : "B17", 
    "_id" : "components/B17", 
    "_rev" : "_eLY0oh6--A" 
  }, 
  { 
    "_key" : "B18", 
    "_id" : "components/B18", 
    "_rev" : "_eLY0oh6--B" 
  }, 
  { 
    "_key" : "B21", 
    "_id" : "components/B21", 
    "_rev" : "_eLY0oh6--C" 
  }, 
  { 
    "_key" : "B22", 
    "_id" : "components/B22", 
    "_rev" : "_eLY0oh6--D" 
  }, 
  { 
    "_key" : "C1", 
    "_id" : "components/C1", 
    "_rev" : "_eLY0oh6--E" 
  }, 
  { 
    "_key" : "C2", 
    "_id" : "components/C2", 
    "_rev" : "_eLY0oh6--F" 
  }, 
  { 
    "_key" : "C3", 
    "_id" : "components/C3", 
    "_rev" : "_eLY0oh6--G" 
  }, 
  { 
    "_key" : "C4", 
    "_id" : "components/C4", 
    "_rev" : "_eLY0oh6--H" 
  }, 
  { 
    "_key" : "C5", 
    "_id" : "components/C5", 
    "_rev" : "_eLY0oh6--I" 
  }, 
  { 
    "_key" : "C7", 
    "_id" : "components/C7", 
    "_rev" : "_eLY0oh6--J" 
  }, 
  { 
    "_key" : "C6", 
    "_id" : "components/C6", 
    "_rev" : "_eLY0oh6--K" 
  }, 
  { 
    "_key" : "C8", 
    "_id" : "components/C8", 
    "_rev" : "_eLY0oi----" 
  }, 
  { 
    "_key" : "C9", 
    "_id" : "components/C9", 
    "_rev" : "_eLY0oi---_" 
  }, 
  { 
    "_key" : "C10", 
    "_id" : "components/C10", 
    "_rev" : "_eLY0oi---A" 
  } 
]
[ 
  { 
    "_key" : "81189", 
    "_id" : "connections/81189", 
    "_from" : "components/A1", 
    "_to" : "components/A2", 
    "_rev" : "_eLY0oi---B" 
  }, 
  { 
    "_key" : "81191", 
    "_id" : "connections/81191", 
    "_from" : "components/A2", 
    "_to" : "components/A3", 
    "_rev" : "_eLY0oi---C" 
  }, 
  { 
    "_key" : "81193", 
    "_id" : "connections/81193", 
    "_from" : "components/A3", 
    "_to" : "components/A4", 
    "_rev" : "_eLY0oi---D" 
  }, 
  { 
    "_key" : "81195", 
    "_id" : "connections/81195", 
    "_from" : "components/A4", 
    "_to" : "components/A1", 
    "_rev" : "_eLY0oi---E" 
  }, 
  { 
    "_key" : "81197", 
    "_id" : "connections/81197", 
    "_from" : "components/B1", 
    "_to" : "components/B3", 
    "_rev" : "_eLY0oi---F" 
  }, 
  { 
    "_key" : "81199", 
    "_id" : "connections/81199", 
    "_from" : "components/B2", 
    "_to" : "components/B4", 
    "_rev" : "_eLY0oi---G" 
  }, 
  { 
    "_key" : "81201", 
    "_id" : "connections/81201", 
    "_from" : "components/B3", 
    "_to" : "components/B6", 
    "_rev" : "_eLY0oi---H" 
  }, 
  { 
    "_key" : "81203", 
    "_id" : "connections/81203", 
    "_from" : "components/B4", 
    "_to" : "components/B3", 
    "_rev" : "_eLY0oi---I" 
  }, 
  { 
    "_key" : "81205", 
    "_id" : "connections/81205", 
    "_from" : "components/B4", 
    "_to" : "components/B5", 
    "_rev" : "_eLY0oiC---" 
  }, 
  { 
    "_key" : "81207", 
    "_id" : "connections/81207", 
    "_from" : "components/B6", 
    "_to" : "components/B7", 
    "_rev" : "_eLY0oiC--_" 
  }, 
  { 
    "_key" : "81209", 
    "_id" : "connections/81209", 
    "_from" : "components/B7", 
    "_to" : "components/B8", 
    "_rev" : "_eLY0oiC--A" 
  }, 
  { 
    "_key" : "81211", 
    "_id" : "connections/81211", 
    "_from" : "components/B7", 
    "_to" : "components/B9", 
    "_rev" : "_eLY0oiC--B" 
  }, 
  { 
    "_key" : "81213", 
    "_id" : "connections/81213", 
    "_from" : "components/B7", 
    "_to" : "components/B10", 
    "_rev" : "_eLY0oiC--C" 
  }, 
  { 
    "_key" : "81215", 
    "_id" : "connections/81215", 
    "_from" : "components/B7", 
    "_to" : "components/B19", 
    "_rev" : "_eLY0oiC--D" 
  }, 
  { 
    "_key" : "81217", 
    "_id" : "connections/81217", 
    "_from" : "components/B11", 
    "_to" : "components/B10", 
    "_rev" : "_eLY0oiC--E" 
  }, 
  { 
    "_key" : "81219", 
    "_id" : "connections/81219", 
    "_from" : "components/B12", 
    "_to" : "components/B11", 
    "_rev" : "_eLY0oiC--F" 
  }, 
  { 
    "_key" : "81221", 
    "_id" : "connections/81221", 
    "_from" : "components/B13", 
    "_to" : "components/B12", 
    "_rev" : "_eLY0oiC--G" 
  }, 
  { 
    "_key" : "81223", 
    "_id" : "connections/81223", 
    "_from" : "components/B13", 
    "_to" : "components/B20", 
    "_rev" : "_eLY0oiC--H" 
  }, 
  { 
    "_key" : "81225", 
    "_id" : "connections/81225", 
    "_from" : "components/B14", 
    "_to" : "components/B13", 
    "_rev" : "_eLY0oiG---" 
  }, 
  { 
    "_key" : "81227", 
    "_id" : "connections/81227", 
    "_from" : "components/B15", 
    "_to" : "components/B14", 
    "_rev" : "_eLY0oiG--_" 
  }, 
  { 
    "_key" : "81229", 
    "_id" : "connections/81229", 
    "_from" : "components/B15", 
    "_to" : "components/B16", 
    "_rev" : "_eLY0oiG--A" 
  }, 
  { 
    "_key" : "81231", 
    "_id" : "connections/81231", 
    "_from" : "components/B17", 
    "_to" : "components/B15", 
    "_rev" : "_eLY0oiG--B" 
  }, 
  { 
    "_key" : "81233", 
    "_id" : "connections/81233", 
    "_from" : "components/B17", 
    "_to" : "components/B18", 
    "_rev" : "_eLY0oiG--C" 
  }, 
  { 
    "_key" : "81235", 
    "_id" : "connections/81235", 
    "_from" : "components/B19", 
    "_to" : "components/B17", 
    "_rev" : "_eLY0oiG--D" 
  }, 
  { 
    "_key" : "81237", 
    "_id" : "connections/81237", 
    "_from" : "components/B20", 
    "_to" : "components/B21", 
    "_rev" : "_eLY0oiG--E" 
  }, 
  { 
    "_key" : "81239", 
    "_id" : "connections/81239", 
    "_from" : "components/B20", 
    "_to" : "components/B22", 
    "_rev" : "_eLY0oiG--F" 
  }, 
  { 
    "_key" : "81241", 
    "_id" : "connections/81241", 
    "_from" : "components/C1", 
    "_to" : "components/C2", 
    "_rev" : "_eLY0oiG--G" 
  }, 
  { 
    "_key" : "81243", 
    "_id" : "connections/81243", 
    "_from" : "components/C2", 
    "_to" : "components/C3", 
    "_rev" : "_eLY0oiG--H" 
  }, 
  { 
    "_key" : "81245", 
    "_id" : "connections/81245", 
    "_from" : "components/C3", 
    "_to" : "components/C4", 
    "_rev" : "_eLY0oiG--I" 
  }, 
  { 
    "_key" : "81247", 
    "_id" : "connections/81247", 
    "_from" : "components/C4", 
    "_to" : "components/C5", 
    "_rev" : "_eLY0oiK---" 
  }, 
  { 
    "_key" : "81249", 
    "_id" : "connections/81249", 
    "_from" : "components/C4", 
    "_to" : "components/C7", 
    "_rev" : "_eLY0oiK--_" 
  }, 
  { 
    "_key" : "81251", 
    "_id" : "connections/81251", 
    "_from" : "components/C5", 
    "_to" : "components/C6", 
    "_rev" : "_eLY0oiK--A" 
  }, 
  { 
    "_key" : "81253", 
    "_id" : "connections/81253", 
    "_from" : "components/C5", 
    "_to" : "components/C7", 
    "_rev" : "_eLY0oiK--B" 
  }, 
  { 
    "_key" : "81255", 
    "_id" : "connections/81255", 
    "_from" : "components/C7", 
    "_to" : "components/C8", 
    "_rev" : "_eLY0oiK--C" 
  }, 
  { 
    "_key" : "81257", 
    "_id" : "connections/81257", 
    "_from" : "components/C8", 
    "_to" : "components/C9", 
    "_rev" : "_eLY0oiK--D" 
  }, 
  { 
    "_key" : "81259", 
    "_id" : "connections/81259", 
    "_from" : "components/C8", 
    "_to" : "components/C10", 
    "_rev" : "_eLY0oiK--E" 
  } 
]

Higher volume graph examples

All of the above examples are rather small so they are easier to comprehend and can demonstrate the way the functionality works. There are however several datasets freely available on the web that are a lot bigger. We collected some of them with import scripts so you may play around with them. Another huge graph is the Pokec social network from Slovakia that we used for performance testing on several databases; You will find importing scripts etc. in this blogpost.

More examples