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 freshersand 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).

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 definitionsYour 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 bean 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 differenttypes 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 oneach traversed edge, which may become CPU-intense. When not finding the edges in the first place because of thecollection containing them is not traversed at all, there will never be a reason to actually check for theirtype 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 limitedto cap the resource requirements. You may also have constraints on other edge attributes, such as a hash indexwith 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, otherwisethe FILTER approach is preferred. You can still use FILTER operations on edges of course. You can get ridof 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 havean edge collection per relation type.

ArangoDB does not require you to store your data in graph structures with edges and vertices, you can also decideto embed attributes such as which groups a user is part of, or ids of documents in another document instead ofconnecting the documents with edges. It can be a meaningful performance optimization for _1:n relationships, ifyour data is not focused on relations and you don’t need graph traversal with varying depth. It usually meansto 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 attributesof the Group, i.e. when it was founded, its subject, an icon URL and so on. Users documents contain the data specific to auser - 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 arbitrarynumber of groups, this is an m:n relation. The edge collection can be called UsersInGroups with i.e. one edgewith _from pointing to Users/John and _to pointing to Groups/BowlingGroupHappyPin. This makes the user Johna 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:

  1. 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 anarbitrary number. Edges can be traversed in both directions, so it’s easy to determine allgroups a user is in, but also to find out which members a certain group has. Users could also beinterconnected 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 veryflexible 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 BobThis is how we create it, inspect its vertices and edges, and drop it again:
  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("knows_graph");
  3. arangosh> db.persons.toArray()
  4. arangosh> db.knows.toArray();
  5. arangosh> examples.dropGraph("knows_graph");

Show execution results

  1. [
  2. {
  3. "_key" : "alice",
  4. "_id" : "persons/alice",
  5. "_rev" : "_ZJNT-Py---",
  6. "name" : "Alice"
  7. },
  8. {
  9. "_key" : "bob",
  10. "_id" : "persons/bob",
  11. "_rev" : "_ZJNT-P2---",
  12. "name" : "Bob"
  13. },
  14. {
  15. "_key" : "charlie",
  16. "_id" : "persons/charlie",
  17. "_rev" : "_ZJNT-P2--A",
  18. "name" : "Charlie"
  19. },
  20. {
  21. "_key" : "dave",
  22. "_id" : "persons/dave",
  23. "_rev" : "_ZJNT-P2--C",
  24. "name" : "Dave"
  25. },
  26. {
  27. "_key" : "eve",
  28. "_id" : "persons/eve",
  29. "_rev" : "_ZJNT-P6---",
  30. "name" : "Eve"
  31. }
  32. ]
  33. [
  34. {
  35. "_key" : "87573",
  36. "_id" : "knows/87573",
  37. "_from" : "persons/alice",
  38. "_to" : "persons/bob",
  39. "_rev" : "_ZJNT-P6--A",
  40. "vertex" : "alice"
  41. },
  42. {
  43. "_key" : "87575",
  44. "_id" : "knows/87575",
  45. "_from" : "persons/bob",
  46. "_to" : "persons/charlie",
  47. "_rev" : "_ZJNT-P6--C",
  48. "vertex" : "bob"
  49. },
  50. {
  51. "_key" : "87577",
  52. "_id" : "knows/87577",
  53. "_from" : "persons/bob",
  54. "_to" : "persons/dave",
  55. "_rev" : "_ZJNT-Q----",
  56. "vertex" : "bob"
  57. },
  58. {
  59. "_key" : "87579",
  60. "_id" : "knows/87579",
  61. "_from" : "persons/eve",
  62. "_to" : "persons/alice",
  63. "_rev" : "_ZJNT-Q---A",
  64. "vertex" : "eve"
  65. },
  66. {
  67. "_key" : "87581",
  68. "_id" : "knows/87581",
  69. "_from" : "persons/eve",
  70. "_to" : "persons/bob",
  71. "_rev" : "_ZJNT-Q---C",
  72. "vertex" : "eve"
  73. }
  74. ]

Hide execution results

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:

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var graph = examples.loadGraph("social");
  3. arangosh> db.female.toArray()
  4. arangosh> db.male.toArray()
  5. arangosh> db.relation.toArray()
  6. arangosh> examples.dropGraph("social");

Show execution results

  1. [
  2. {
  3. "_key" : "alice",
  4. "_id" : "female/alice",
  5. "_rev" : "_ZJNT-Te---",
  6. "name" : "Alice"
  7. },
  8. {
  9. "_key" : "diana",
  10. "_id" : "female/diana",
  11. "_rev" : "_ZJNT-Ti---",
  12. "name" : "Diana"
  13. }
  14. ]
  15. [
  16. {
  17. "_key" : "bob",
  18. "_id" : "male/bob",
  19. "_rev" : "_ZJNT-Te--A",
  20. "name" : "Bob"
  21. },
  22. {
  23. "_key" : "charly",
  24. "_id" : "male/charly",
  25. "_rev" : "_ZJNT-Te--C",
  26. "name" : "Charly"
  27. }
  28. ]
  29. [
  30. {
  31. "_key" : "87783",
  32. "_id" : "relation/87783",
  33. "_from" : "female/alice",
  34. "_to" : "male/bob",
  35. "_rev" : "_ZJNT-Ti--A",
  36. "type" : "married",
  37. "vertex" : "alice"
  38. },
  39. {
  40. "_key" : "87785",
  41. "_id" : "relation/87785",
  42. "_from" : "female/alice",
  43. "_to" : "male/charly",
  44. "_rev" : "_ZJNT-Ti--C",
  45. "type" : "friend",
  46. "vertex" : "alice"
  47. },
  48. {
  49. "_key" : "87787",
  50. "_id" : "relation/87787",
  51. "_from" : "male/charly",
  52. "_to" : "female/diana",
  53. "_rev" : "_ZJNT-Ti--E",
  54. "type" : "married",
  55. "vertex" : "charly"
  56. },
  57. {
  58. "_key" : "87789",
  59. "_id" : "relation/87789",
  60. "_from" : "male/bob",
  61. "_to" : "female/diana",
  62. "_rev" : "_ZJNT-Tm---",
  63. "type" : "friend",
  64. "vertex" : "bob"
  65. }
  66. ]

Hide execution results

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:

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("routeplanner");
  3. arangosh> db.frenchCity.toArray();
  4. arangosh> db.germanCity.toArray();
  5. arangosh> db.germanHighway.toArray();
  6. arangosh> db.frenchHighway.toArray();
  7. arangosh> db.internationalHighway.toArray();
  8. arangosh> examples.dropGraph("routeplanner");

Show execution results

  1. [
  2. {
  3. "_key" : "Lyon",
  4. "_id" : "frenchCity/Lyon",
  5. "_rev" : "_ZJNT-Om--A",
  6. "population" : 80000,
  7. "isCapital" : false,
  8. "geometry" : {
  9. "type" : "Point",
  10. "coordinates" : [
  11. 4.84,
  12. 45.76
  13. ]
  14. }
  15. },
  16. {
  17. "_key" : "Paris",
  18. "_id" : "frenchCity/Paris",
  19. "_rev" : "_ZJNT-Om--C",
  20. "population" : 4000000,
  21. "isCapital" : true,
  22. "geometry" : {
  23. "type" : "Point",
  24. "coordinates" : [
  25. 2.3508,
  26. 48.8567
  27. ]
  28. }
  29. }
  30. ]
  31. [
  32. {
  33. "_key" : "Berlin",
  34. "_id" : "germanCity/Berlin",
  35. "_rev" : "_ZJNT-Oi---",
  36. "population" : 3000000,
  37. "isCapital" : true,
  38. "geometry" : {
  39. "type" : "Point",
  40. "coordinates" : [
  41. 13.3833,
  42. 52.5167
  43. ]
  44. }
  45. },
  46. {
  47. "_key" : "Cologne",
  48. "_id" : "germanCity/Cologne",
  49. "_rev" : "_ZJNT-Oi--A",
  50. "population" : 1000000,
  51. "isCapital" : false,
  52. "geometry" : {
  53. "type" : "Point",
  54. "coordinates" : [
  55. 6.9528,
  56. 50.9364
  57. ]
  58. }
  59. },
  60. {
  61. "_key" : "Hamburg",
  62. "_id" : "germanCity/Hamburg",
  63. "_rev" : "_ZJNT-Om---",
  64. "population" : 1000000,
  65. "isCapital" : false,
  66. "geometry" : {
  67. "type" : "Point",
  68. "coordinates" : [
  69. 10.0014,
  70. 53.5653
  71. ]
  72. }
  73. }
  74. ]
  75. [
  76. {
  77. "_key" : "87510",
  78. "_id" : "germanHighway/87510",
  79. "_from" : "germanCity/Berlin",
  80. "_to" : "germanCity/Cologne",
  81. "_rev" : "_ZJNT-Oq--_",
  82. "distance" : 850
  83. },
  84. {
  85. "_key" : "87512",
  86. "_id" : "germanHighway/87512",
  87. "_from" : "germanCity/Berlin",
  88. "_to" : "germanCity/Hamburg",
  89. "_rev" : "_ZJNT-Ou---",
  90. "distance" : 400
  91. },
  92. {
  93. "_key" : "87514",
  94. "_id" : "germanHighway/87514",
  95. "_from" : "germanCity/Hamburg",
  96. "_to" : "germanCity/Cologne",
  97. "_rev" : "_ZJNT-Ou--A",
  98. "distance" : 500
  99. }
  100. ]
  101. [
  102. {
  103. "_key" : "87516",
  104. "_id" : "frenchHighway/87516",
  105. "_from" : "frenchCity/Paris",
  106. "_to" : "frenchCity/Lyon",
  107. "_rev" : "_ZJNT-Ou--C",
  108. "distance" : 550
  109. }
  110. ]
  111. [
  112. {
  113. "_key" : "87518",
  114. "_id" : "internationalHighway/87518",
  115. "_from" : "germanCity/Berlin",
  116. "_to" : "frenchCity/Lyon",
  117. "_rev" : "_ZJNT-Oy---",
  118. "distance" : 1100
  119. },
  120. {
  121. "_key" : "87520",
  122. "_id" : "internationalHighway/87520",
  123. "_from" : "germanCity/Berlin",
  124. "_to" : "frenchCity/Paris",
  125. "_rev" : "_ZJNT-Oy--A",
  126. "distance" : 1200
  127. },
  128. {
  129. "_key" : "87522",
  130. "_id" : "internationalHighway/87522",
  131. "_from" : "germanCity/Hamburg",
  132. "_to" : "frenchCity/Paris",
  133. "_rev" : "_ZJNT-Oy--C",
  134. "distance" : 900
  135. },
  136. {
  137. "_key" : "87524",
  138. "_id" : "internationalHighway/87524",
  139. "_from" : "germanCity/Hamburg",
  140. "_to" : "frenchCity/Lyon",
  141. "_rev" : "_ZJNT-Oy--E",
  142. "distance" : 1300
  143. },
  144. {
  145. "_key" : "87526",
  146. "_id" : "internationalHighway/87526",
  147. "_from" : "germanCity/Cologne",
  148. "_to" : "frenchCity/Lyon",
  149. "_rev" : "_ZJNT-O2---",
  150. "distance" : 700
  151. },
  152. {
  153. "_key" : "87528",
  154. "_id" : "internationalHighway/87528",
  155. "_from" : "germanCity/Cologne",
  156. "_to" : "frenchCity/Paris",
  157. "_rev" : "_ZJNT-O2--A",
  158. "distance" : 550
  159. }
  160. ]

Hide execution results

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.

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("traversalGraph");
  3. arangosh> db.circles.toArray();
  4. arangosh> db.edges.toArray();
  5. arangosh> examples.dropGraph("traversalGraph");

Show execution results

  1. [
  2. {
  3. "_key" : "A",
  4. "_id" : "circles/A",
  5. "_rev" : "_ZJNT-UO---",
  6. "label" : "1"
  7. },
  8. {
  9. "_key" : "B",
  10. "_id" : "circles/B",
  11. "_rev" : "_ZJNT-UO--A",
  12. "label" : "2"
  13. },
  14. {
  15. "_key" : "C",
  16. "_id" : "circles/C",
  17. "_rev" : "_ZJNT-US---",
  18. "label" : "3"
  19. },
  20. {
  21. "_key" : "D",
  22. "_id" : "circles/D",
  23. "_rev" : "_ZJNT-US--A",
  24. "label" : "4"
  25. },
  26. {
  27. "_key" : "E",
  28. "_id" : "circles/E",
  29. "_rev" : "_ZJNT-US--C",
  30. "label" : "5"
  31. },
  32. {
  33. "_key" : "F",
  34. "_id" : "circles/F",
  35. "_rev" : "_ZJNT-US--E",
  36. "label" : "6"
  37. },
  38. {
  39. "_key" : "G",
  40. "_id" : "circles/G",
  41. "_rev" : "_ZJNT-UW---",
  42. "label" : "7"
  43. },
  44. {
  45. "_key" : "H",
  46. "_id" : "circles/H",
  47. "_rev" : "_ZJNT-UW--A",
  48. "label" : "8"
  49. },
  50. {
  51. "_key" : "I",
  52. "_id" : "circles/I",
  53. "_rev" : "_ZJNT-UW--C",
  54. "label" : "9"
  55. },
  56. {
  57. "_key" : "J",
  58. "_id" : "circles/J",
  59. "_rev" : "_ZJNT-UW--E",
  60. "label" : "10"
  61. },
  62. {
  63. "_key" : "K",
  64. "_id" : "circles/K",
  65. "_rev" : "_ZJNT-Ua---",
  66. "label" : "11"
  67. }
  68. ]
  69. [
  70. {
  71. "_key" : "87832",
  72. "_id" : "edges/87832",
  73. "_from" : "circles/A",
  74. "_to" : "circles/B",
  75. "_rev" : "_ZJNT-Ua--A",
  76. "theFalse" : false,
  77. "theTruth" : true,
  78. "label" : "left_bar"
  79. },
  80. {
  81. "_key" : "87834",
  82. "_id" : "edges/87834",
  83. "_from" : "circles/B",
  84. "_to" : "circles/C",
  85. "_rev" : "_ZJNT-Ua--C",
  86. "theFalse" : false,
  87. "theTruth" : true,
  88. "label" : "left_blarg"
  89. },
  90. {
  91. "_key" : "87836",
  92. "_id" : "edges/87836",
  93. "_from" : "circles/C",
  94. "_to" : "circles/D",
  95. "_rev" : "_ZJNT-Ua--E",
  96. "theFalse" : false,
  97. "theTruth" : true,
  98. "label" : "left_blorg"
  99. },
  100. {
  101. "_key" : "87838",
  102. "_id" : "edges/87838",
  103. "_from" : "circles/B",
  104. "_to" : "circles/E",
  105. "_rev" : "_ZJNT-Ue---",
  106. "theFalse" : false,
  107. "theTruth" : true,
  108. "label" : "left_blub"
  109. },
  110. {
  111. "_key" : "87840",
  112. "_id" : "edges/87840",
  113. "_from" : "circles/E",
  114. "_to" : "circles/F",
  115. "_rev" : "_ZJNT-Ue--A",
  116. "theFalse" : false,
  117. "theTruth" : true,
  118. "label" : "left_schubi"
  119. },
  120. {
  121. "_key" : "87842",
  122. "_id" : "edges/87842",
  123. "_from" : "circles/A",
  124. "_to" : "circles/G",
  125. "_rev" : "_ZJNT-Ue--C",
  126. "theFalse" : false,
  127. "theTruth" : true,
  128. "label" : "right_foo"
  129. },
  130. {
  131. "_key" : "87844",
  132. "_id" : "edges/87844",
  133. "_from" : "circles/G",
  134. "_to" : "circles/H",
  135. "_rev" : "_ZJNT-Ue--E",
  136. "theFalse" : false,
  137. "theTruth" : true,
  138. "label" : "right_blob"
  139. },
  140. {
  141. "_key" : "87846",
  142. "_id" : "edges/87846",
  143. "_from" : "circles/H",
  144. "_to" : "circles/I",
  145. "_rev" : "_ZJNT-Ui---",
  146. "theFalse" : false,
  147. "theTruth" : true,
  148. "label" : "right_blub"
  149. },
  150. {
  151. "_key" : "87848",
  152. "_id" : "edges/87848",
  153. "_from" : "circles/G",
  154. "_to" : "circles/J",
  155. "_rev" : "_ZJNT-Ui--A",
  156. "theFalse" : false,
  157. "theTruth" : true,
  158. "label" : "right_zip"
  159. },
  160. {
  161. "_key" : "87850",
  162. "_id" : "edges/87850",
  163. "_from" : "circles/J",
  164. "_to" : "circles/K",
  165. "_rev" : "_ZJNT-Ui--C",
  166. "theFalse" : false,
  167. "theTruth" : true,
  168. "label" : "right_zup"
  169. }
  170. ]

Hide execution results

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 andNorth 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.

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("kShortestPathsGraph");
  3. arangosh> db.places.toArray();
  4. arangosh> db.connections.toArray();
  5. arangosh> examples.dropGraph("kShortestPathsGraph");

Show execution results

  1. [
  2. {
  3. "_key" : "Inverness",
  4. "_id" : "places/Inverness",
  5. "_rev" : "_ZJNT-Qi---",
  6. "label" : "Inverness"
  7. },
  8. {
  9. "_key" : "Aberdeen",
  10. "_id" : "places/Aberdeen",
  11. "_rev" : "_ZJNT-Qi--A",
  12. "label" : "Aberdeen"
  13. },
  14. {
  15. "_key" : "Leuchars",
  16. "_id" : "places/Leuchars",
  17. "_rev" : "_ZJNT-Qm---",
  18. "label" : "Leuchars"
  19. },
  20. {
  21. "_key" : "StAndrews",
  22. "_id" : "places/StAndrews",
  23. "_rev" : "_ZJNT-Qm--A",
  24. "label" : "StAndrews"
  25. },
  26. {
  27. "_key" : "Edinburgh",
  28. "_id" : "places/Edinburgh",
  29. "_rev" : "_ZJNT-Qm--C",
  30. "label" : "Edinburgh"
  31. },
  32. {
  33. "_key" : "Glasgow",
  34. "_id" : "places/Glasgow",
  35. "_rev" : "_ZJNT-Qm--E",
  36. "label" : "Glasgow"
  37. },
  38. {
  39. "_key" : "York",
  40. "_id" : "places/York",
  41. "_rev" : "_ZJNT-Qm--G",
  42. "label" : "York"
  43. },
  44. {
  45. "_key" : "Carlisle",
  46. "_id" : "places/Carlisle",
  47. "_rev" : "_ZJNT-Qq---",
  48. "label" : "Carlisle"
  49. },
  50. {
  51. "_key" : "Birmingham",
  52. "_id" : "places/Birmingham",
  53. "_rev" : "_ZJNT-Qq--A",
  54. "label" : "Birmingham"
  55. },
  56. {
  57. "_key" : "London",
  58. "_id" : "places/London",
  59. "_rev" : "_ZJNT-Qq--C",
  60. "label" : "London"
  61. },
  62. {
  63. "_key" : "Brussels",
  64. "_id" : "places/Brussels",
  65. "_rev" : "_ZJNT-Qq--E",
  66. "label" : "Brussels"
  67. },
  68. {
  69. "_key" : "Cologne",
  70. "_id" : "places/Cologne",
  71. "_rev" : "_ZJNT-Qu---",
  72. "label" : "Cologne"
  73. },
  74. {
  75. "_key" : "Toronto",
  76. "_id" : "places/Toronto",
  77. "_rev" : "_ZJNT-Qu--A",
  78. "label" : "Toronto"
  79. },
  80. {
  81. "_key" : "Winnipeg",
  82. "_id" : "places/Winnipeg",
  83. "_rev" : "_ZJNT-Qu--C",
  84. "label" : "Winnipeg"
  85. },
  86. {
  87. "_key" : "Saskatoon",
  88. "_id" : "places/Saskatoon",
  89. "_rev" : "_ZJNT-Qu--E",
  90. "label" : "Saskatoon"
  91. },
  92. {
  93. "_key" : "Edmonton",
  94. "_id" : "places/Edmonton",
  95. "_rev" : "_ZJNT-Qy---",
  96. "label" : "Edmonton"
  97. },
  98. {
  99. "_key" : "Jasper",
  100. "_id" : "places/Jasper",
  101. "_rev" : "_ZJNT-Qy--A",
  102. "label" : "Jasper"
  103. },
  104. {
  105. "_key" : "Vancouver",
  106. "_id" : "places/Vancouver",
  107. "_rev" : "_ZJNT-Qy--C",
  108. "label" : "Vancouver"
  109. }
  110. ]
  111. [
  112. {
  113. "_key" : "87627",
  114. "_id" : "connections/87627",
  115. "_from" : "places/Inverness",
  116. "_to" : "places/Aberdeen",
  117. "_rev" : "_ZJNT-Qy--E",
  118. "travelTime" : 3
  119. },
  120. {
  121. "_key" : "87629",
  122. "_id" : "connections/87629",
  123. "_from" : "places/Aberdeen",
  124. "_to" : "places/Inverness",
  125. "_rev" : "_ZJNT-Q2---",
  126. "travelTime" : 2.5
  127. },
  128. {
  129. "_key" : "87631",
  130. "_id" : "connections/87631",
  131. "_from" : "places/Aberdeen",
  132. "_to" : "places/Leuchars",
  133. "_rev" : "_ZJNT-Q2--A",
  134. "travelTime" : 1.5
  135. },
  136. {
  137. "_key" : "87633",
  138. "_id" : "connections/87633",
  139. "_from" : "places/Leuchars",
  140. "_to" : "places/Aberdeen",
  141. "_rev" : "_ZJNT-Q2--C",
  142. "travelTime" : 1
  143. },
  144. {
  145. "_key" : "87635",
  146. "_id" : "connections/87635",
  147. "_from" : "places/Leuchars",
  148. "_to" : "places/Edinburgh",
  149. "_rev" : "_ZJNT-Q2--E",
  150. "travelTime" : 1.5
  151. },
  152. {
  153. "_key" : "87637",
  154. "_id" : "connections/87637",
  155. "_from" : "places/Edinburgh",
  156. "_to" : "places/Leuchars",
  157. "_rev" : "_ZJNT-Q6---",
  158. "travelTime" : 3
  159. },
  160. {
  161. "_key" : "87639",
  162. "_id" : "connections/87639",
  163. "_from" : "places/Edinburgh",
  164. "_to" : "places/Glasgow",
  165. "_rev" : "_ZJNT-Q6--A",
  166. "travelTime" : 1
  167. },
  168. {
  169. "_key" : "87641",
  170. "_id" : "connections/87641",
  171. "_from" : "places/Glasgow",
  172. "_to" : "places/Edinburgh",
  173. "_rev" : "_ZJNT-Q6--C",
  174. "travelTime" : 1
  175. },
  176. {
  177. "_key" : "87643",
  178. "_id" : "connections/87643",
  179. "_from" : "places/Edinburgh",
  180. "_to" : "places/York",
  181. "_rev" : "_ZJNT-Q6--E",
  182. "travelTime" : 3.5
  183. },
  184. {
  185. "_key" : "87645",
  186. "_id" : "connections/87645",
  187. "_from" : "places/York",
  188. "_to" : "places/Edinburgh",
  189. "_rev" : "_ZJNT-R----",
  190. "travelTime" : 4
  191. },
  192. {
  193. "_key" : "87647",
  194. "_id" : "connections/87647",
  195. "_from" : "places/Glasgow",
  196. "_to" : "places/Carlisle",
  197. "_rev" : "_ZJNT-R---A",
  198. "travelTime" : 1
  199. },
  200. {
  201. "_key" : "87649",
  202. "_id" : "connections/87649",
  203. "_from" : "places/Carlisle",
  204. "_to" : "places/Glasgow",
  205. "_rev" : "_ZJNT-R---C",
  206. "travelTime" : 1
  207. },
  208. {
  209. "_key" : "87651",
  210. "_id" : "connections/87651",
  211. "_from" : "places/Carlisle",
  212. "_to" : "places/York",
  213. "_rev" : "_ZJNT-R---E",
  214. "travelTime" : 2.5
  215. },
  216. {
  217. "_key" : "87653",
  218. "_id" : "connections/87653",
  219. "_from" : "places/York",
  220. "_to" : "places/Carlisle",
  221. "_rev" : "_ZJNT-RC---",
  222. "travelTime" : 3.5
  223. },
  224. {
  225. "_key" : "87655",
  226. "_id" : "connections/87655",
  227. "_from" : "places/Carlisle",
  228. "_to" : "places/Birmingham",
  229. "_rev" : "_ZJNT-RC--A",
  230. "travelTime" : 2
  231. },
  232. {
  233. "_key" : "87657",
  234. "_id" : "connections/87657",
  235. "_from" : "places/Birmingham",
  236. "_to" : "places/Carlisle",
  237. "_rev" : "_ZJNT-RC--C",
  238. "travelTime" : 1
  239. },
  240. {
  241. "_key" : "87659",
  242. "_id" : "connections/87659",
  243. "_from" : "places/Birmingham",
  244. "_to" : "places/London",
  245. "_rev" : "_ZJNT-RC--E",
  246. "travelTime" : 1.5
  247. },
  248. {
  249. "_key" : "87661",
  250. "_id" : "connections/87661",
  251. "_from" : "places/London",
  252. "_to" : "places/Birmingham",
  253. "_rev" : "_ZJNT-RG---",
  254. "travelTime" : 2.5
  255. },
  256. {
  257. "_key" : "87663",
  258. "_id" : "connections/87663",
  259. "_from" : "places/Leuchars",
  260. "_to" : "places/StAndrews",
  261. "_rev" : "_ZJNT-RG--A",
  262. "travelTime" : 0.2
  263. },
  264. {
  265. "_key" : "87665",
  266. "_id" : "connections/87665",
  267. "_from" : "places/StAndrews",
  268. "_to" : "places/Leuchars",
  269. "_rev" : "_ZJNT-RG--C",
  270. "travelTime" : 0.2
  271. },
  272. {
  273. "_key" : "87667",
  274. "_id" : "connections/87667",
  275. "_from" : "places/York",
  276. "_to" : "places/London",
  277. "_rev" : "_ZJNT-RG--E",
  278. "travelTime" : 1.8
  279. },
  280. {
  281. "_key" : "87669",
  282. "_id" : "connections/87669",
  283. "_from" : "places/London",
  284. "_to" : "places/York",
  285. "_rev" : "_ZJNT-RK---",
  286. "travelTime" : 2
  287. },
  288. {
  289. "_key" : "87671",
  290. "_id" : "connections/87671",
  291. "_from" : "places/London",
  292. "_to" : "places/Brussels",
  293. "_rev" : "_ZJNT-RK--A",
  294. "travelTime" : 2.5
  295. },
  296. {
  297. "_key" : "87673",
  298. "_id" : "connections/87673",
  299. "_from" : "places/Brussels",
  300. "_to" : "places/London",
  301. "_rev" : "_ZJNT-RK--C",
  302. "travelTime" : 3.5
  303. },
  304. {
  305. "_key" : "87675",
  306. "_id" : "connections/87675",
  307. "_from" : "places/Brussels",
  308. "_to" : "places/Cologne",
  309. "_rev" : "_ZJNT-RK--E",
  310. "travelTime" : 2
  311. },
  312. {
  313. "_key" : "87677",
  314. "_id" : "connections/87677",
  315. "_from" : "places/Cologne",
  316. "_to" : "places/Brussels",
  317. "_rev" : "_ZJNT-RO---",
  318. "travelTime" : 1.5
  319. },
  320. {
  321. "_key" : "87679",
  322. "_id" : "connections/87679",
  323. "_from" : "places/Toronto",
  324. "_to" : "places/Winnipeg",
  325. "_rev" : "_ZJNT-RO--A",
  326. "travelTime" : 36
  327. },
  328. {
  329. "_key" : "87681",
  330. "_id" : "connections/87681",
  331. "_from" : "places/Winnipeg",
  332. "_to" : "places/Toronto",
  333. "_rev" : "_ZJNT-RO--C",
  334. "travelTime" : 35
  335. },
  336. {
  337. "_key" : "87683",
  338. "_id" : "connections/87683",
  339. "_from" : "places/Winnipeg",
  340. "_to" : "places/Saskatoon",
  341. "_rev" : "_ZJNT-RO--E",
  342. "travelTime" : 12
  343. },
  344. {
  345. "_key" : "87685",
  346. "_id" : "connections/87685",
  347. "_from" : "places/Saskatoon",
  348. "_to" : "places/Winnipeg",
  349. "_rev" : "_ZJNT-RS---",
  350. "travelTime" : 5
  351. },
  352. {
  353. "_key" : "87687",
  354. "_id" : "connections/87687",
  355. "_from" : "places/Saskatoon",
  356. "_to" : "places/Edmonton",
  357. "_rev" : "_ZJNT-RS--A",
  358. "travelTime" : 12
  359. },
  360. {
  361. "_key" : "87689",
  362. "_id" : "connections/87689",
  363. "_from" : "places/Edmonton",
  364. "_to" : "places/Saskatoon",
  365. "_rev" : "_ZJNT-RS--C",
  366. "travelTime" : 17
  367. },
  368. {
  369. "_key" : "87691",
  370. "_id" : "connections/87691",
  371. "_from" : "places/Edmonton",
  372. "_to" : "places/Jasper",
  373. "_rev" : "_ZJNT-RW---",
  374. "travelTime" : 6
  375. },
  376. {
  377. "_key" : "87693",
  378. "_id" : "connections/87693",
  379. "_from" : "places/Jasper",
  380. "_to" : "places/Edmonton",
  381. "_rev" : "_ZJNT-RW--A",
  382. "travelTime" : 5
  383. },
  384. {
  385. "_key" : "87695",
  386. "_id" : "connections/87695",
  387. "_from" : "places/Jasper",
  388. "_to" : "places/Vancouver",
  389. "_rev" : "_ZJNT-RW--C",
  390. "travelTime" : 12
  391. },
  392. {
  393. "_key" : "87697",
  394. "_id" : "connections/87697",
  395. "_from" : "places/Vancouver",
  396. "_to" : "places/Jasper",
  397. "_rev" : "_ZJNT-RW--E",
  398. "travelTime" : 13
  399. }
  400. ]

Hide execution results

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.

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("worldCountry");
  3. arangosh> db.worldVertices.toArray();
  4. arangosh> db.worldEdges.toArray();
  5. arangosh> examples.dropGraph("worldCountry");
  6. arangosh> var g = examples.loadGraph("worldCountryUnManaged");
  7. arangosh> examples.dropGraph("worldCountryUnManaged");

Show execution results

  1. [
  2. {
  3. "_key" : "world",
  4. "_id" : "worldVertices/world",
  5. "_rev" : "_ZJNT-Va---",
  6. "name" : "World",
  7. "type" : "root"
  8. },
  9. {
  10. "_key" : "continent-africa",
  11. "_id" : "worldVertices/continent-africa",
  12. "_rev" : "_ZJNT-Va--A",
  13. "name" : "Africa",
  14. "type" : "continent"
  15. },
  16. {
  17. "_key" : "continent-asia",
  18. "_id" : "worldVertices/continent-asia",
  19. "_rev" : "_ZJNT-Va--C",
  20. "name" : "Asia",
  21. "type" : "continent"
  22. },
  23. {
  24. "_key" : "continent-australia",
  25. "_id" : "worldVertices/continent-australia",
  26. "_rev" : "_ZJNT-Ve---",
  27. "name" : "Australia",
  28. "type" : "continent"
  29. },
  30. {
  31. "_key" : "continent-europe",
  32. "_id" : "worldVertices/continent-europe",
  33. "_rev" : "_ZJNT-Ve--A",
  34. "name" : "Europe",
  35. "type" : "continent"
  36. },
  37. {
  38. "_key" : "continent-north-america",
  39. "_id" : "worldVertices/continent-north-america",
  40. "_rev" : "_ZJNT-Ve--C",
  41. "name" : "North America",
  42. "type" : "continent"
  43. },
  44. {
  45. "_key" : "continent-south-america",
  46. "_id" : "worldVertices/continent-south-america",
  47. "_rev" : "_ZJNT-Ve--E",
  48. "name" : "South America",
  49. "type" : "continent"
  50. },
  51. {
  52. "_key" : "country-afghanistan",
  53. "_id" : "worldVertices/country-afghanistan",
  54. "_rev" : "_ZJNT-Vi---",
  55. "name" : "Afghanistan",
  56. "type" : "country",
  57. "code" : "AFG"
  58. },
  59. {
  60. "_key" : "country-albania",
  61. "_id" : "worldVertices/country-albania",
  62. "_rev" : "_ZJNT-Vi--A",
  63. "name" : "Albania",
  64. "type" : "country",
  65. "code" : "ALB"
  66. },
  67. {
  68. "_key" : "country-algeria",
  69. "_id" : "worldVertices/country-algeria",
  70. "_rev" : "_ZJNT-Vi--C",
  71. "name" : "Algeria",
  72. "type" : "country",
  73. "code" : "DZA"
  74. },
  75. {
  76. "_key" : "country-andorra",
  77. "_id" : "worldVertices/country-andorra",
  78. "_rev" : "_ZJNT-Vi--E",
  79. "name" : "Andorra",
  80. "type" : "country",
  81. "code" : "AND"
  82. },
  83. {
  84. "_key" : "country-angola",
  85. "_id" : "worldVertices/country-angola",
  86. "_rev" : "_ZJNT-Vm---",
  87. "name" : "Angola",
  88. "type" : "country",
  89. "code" : "AGO"
  90. },
  91. {
  92. "_key" : "country-antigua-and-barbuda",
  93. "_id" : "worldVertices/country-antigua-and-barbuda",
  94. "_rev" : "_ZJNT-Vm--A",
  95. "name" : "Antigua and Barbuda",
  96. "type" : "country",
  97. "code" : "ATG"
  98. },
  99. {
  100. "_key" : "country-argentina",
  101. "_id" : "worldVertices/country-argentina",
  102. "_rev" : "_ZJNT-Vm--C",
  103. "name" : "Argentina",
  104. "type" : "country",
  105. "code" : "ARG"
  106. },
  107. {
  108. "_key" : "country-australia",
  109. "_id" : "worldVertices/country-australia",
  110. "_rev" : "_ZJNT-Vm--E",
  111. "name" : "Australia",
  112. "type" : "country",
  113. "code" : "AUS"
  114. },
  115. {
  116. "_key" : "country-austria",
  117. "_id" : "worldVertices/country-austria",
  118. "_rev" : "_ZJNT-Vm--G",
  119. "name" : "Austria",
  120. "type" : "country",
  121. "code" : "AUT"
  122. },
  123. {
  124. "_key" : "country-bahamas",
  125. "_id" : "worldVertices/country-bahamas",
  126. "_rev" : "_ZJNT-Vq--_",
  127. "name" : "Bahamas",
  128. "type" : "country",
  129. "code" : "BHS"
  130. },
  131. {
  132. "_key" : "country-bahrain",
  133. "_id" : "worldVertices/country-bahrain",
  134. "_rev" : "_ZJNT-Vq--B",
  135. "name" : "Bahrain",
  136. "type" : "country",
  137. "code" : "BHR"
  138. },
  139. {
  140. "_key" : "country-bangladesh",
  141. "_id" : "worldVertices/country-bangladesh",
  142. "_rev" : "_ZJNT-Vq--D",
  143. "name" : "Bangladesh",
  144. "type" : "country",
  145. "code" : "BGD"
  146. },
  147. {
  148. "_key" : "country-barbados",
  149. "_id" : "worldVertices/country-barbados",
  150. "_rev" : "_ZJNT-Vq--F",
  151. "name" : "Barbados",
  152. "type" : "country",
  153. "code" : "BRB"
  154. },
  155. {
  156. "_key" : "country-belgium",
  157. "_id" : "worldVertices/country-belgium",
  158. "_rev" : "_ZJNT-Vu---",
  159. "name" : "Belgium",
  160. "type" : "country",
  161. "code" : "BEL"
  162. },
  163. {
  164. "_key" : "country-bhutan",
  165. "_id" : "worldVertices/country-bhutan",
  166. "_rev" : "_ZJNT-Vu--A",
  167. "name" : "Bhutan",
  168. "type" : "country",
  169. "code" : "BTN"
  170. },
  171. {
  172. "_key" : "country-bolivia",
  173. "_id" : "worldVertices/country-bolivia",
  174. "_rev" : "_ZJNT-Vu--C",
  175. "name" : "Bolivia",
  176. "type" : "country",
  177. "code" : "BOL"
  178. },
  179. {
  180. "_key" : "country-bosnia-and-herzegovina",
  181. "_id" : "worldVertices/country-bosnia-and-herzegovina",
  182. "_rev" : "_ZJNT-Vu--E",
  183. "name" : "Bosnia and Herzegovina",
  184. "type" : "country",
  185. "code" : "BIH"
  186. },
  187. {
  188. "_key" : "country-botswana",
  189. "_id" : "worldVertices/country-botswana",
  190. "_rev" : "_ZJNT-Vy---",
  191. "name" : "Botswana",
  192. "type" : "country",
  193. "code" : "BWA"
  194. },
  195. {
  196. "_key" : "country-brazil",
  197. "_id" : "worldVertices/country-brazil",
  198. "_rev" : "_ZJNT-Vy--A",
  199. "name" : "Brazil",
  200. "type" : "country",
  201. "code" : "BRA"
  202. },
  203. {
  204. "_key" : "country-brunei",
  205. "_id" : "worldVertices/country-brunei",
  206. "_rev" : "_ZJNT-Vy--C",
  207. "name" : "Brunei",
  208. "type" : "country",
  209. "code" : "BRN"
  210. },
  211. {
  212. "_key" : "country-bulgaria",
  213. "_id" : "worldVertices/country-bulgaria",
  214. "_rev" : "_ZJNT-Vy--E",
  215. "name" : "Bulgaria",
  216. "type" : "country",
  217. "code" : "BGR"
  218. },
  219. {
  220. "_key" : "country-burkina-faso",
  221. "_id" : "worldVertices/country-burkina-faso",
  222. "_rev" : "_ZJNT-Vy--G",
  223. "name" : "Burkina Faso",
  224. "type" : "country",
  225. "code" : "BFA"
  226. },
  227. {
  228. "_key" : "country-burundi",
  229. "_id" : "worldVertices/country-burundi",
  230. "_rev" : "_ZJNT-V2---",
  231. "name" : "Burundi",
  232. "type" : "country",
  233. "code" : "BDI"
  234. },
  235. {
  236. "_key" : "country-cambodia",
  237. "_id" : "worldVertices/country-cambodia",
  238. "_rev" : "_ZJNT-V2--A",
  239. "name" : "Cambodia",
  240. "type" : "country",
  241. "code" : "KHM"
  242. },
  243. {
  244. "_key" : "country-cameroon",
  245. "_id" : "worldVertices/country-cameroon",
  246. "_rev" : "_ZJNT-V2--C",
  247. "name" : "Cameroon",
  248. "type" : "country",
  249. "code" : "CMR"
  250. },
  251. {
  252. "_key" : "country-canada",
  253. "_id" : "worldVertices/country-canada",
  254. "_rev" : "_ZJNT-V2--E",
  255. "name" : "Canada",
  256. "type" : "country",
  257. "code" : "CAN"
  258. },
  259. {
  260. "_key" : "country-chad",
  261. "_id" : "worldVertices/country-chad",
  262. "_rev" : "_ZJNT-V6---",
  263. "name" : "Chad",
  264. "type" : "country",
  265. "code" : "TCD"
  266. },
  267. {
  268. "_key" : "country-chile",
  269. "_id" : "worldVertices/country-chile",
  270. "_rev" : "_ZJNT-V6--A",
  271. "name" : "Chile",
  272. "type" : "country",
  273. "code" : "CHL"
  274. },
  275. {
  276. "_key" : "country-colombia",
  277. "_id" : "worldVertices/country-colombia",
  278. "_rev" : "_ZJNT-V6--C",
  279. "name" : "Colombia",
  280. "type" : "country",
  281. "code" : "COL"
  282. },
  283. {
  284. "_key" : "country-cote-d-ivoire",
  285. "_id" : "worldVertices/country-cote-d-ivoire",
  286. "_rev" : "_ZJNT-V6--E",
  287. "name" : "Cote d'Ivoire",
  288. "type" : "country",
  289. "code" : "CIV"
  290. },
  291. {
  292. "_key" : "country-croatia",
  293. "_id" : "worldVertices/country-croatia",
  294. "_rev" : "_ZJNT-W----",
  295. "name" : "Croatia",
  296. "type" : "country",
  297. "code" : "HRV"
  298. },
  299. {
  300. "_key" : "country-czech-republic",
  301. "_id" : "worldVertices/country-czech-republic",
  302. "_rev" : "_ZJNT-W---A",
  303. "name" : "Czech Republic",
  304. "type" : "country",
  305. "code" : "CZE"
  306. },
  307. {
  308. "_key" : "country-denmark",
  309. "_id" : "worldVertices/country-denmark",
  310. "_rev" : "_ZJNT-W---C",
  311. "name" : "Denmark",
  312. "type" : "country",
  313. "code" : "DNK"
  314. },
  315. {
  316. "_key" : "country-ecuador",
  317. "_id" : "worldVertices/country-ecuador",
  318. "_rev" : "_ZJNT-W---E",
  319. "name" : "Ecuador",
  320. "type" : "country",
  321. "code" : "ECU"
  322. },
  323. {
  324. "_key" : "country-egypt",
  325. "_id" : "worldVertices/country-egypt",
  326. "_rev" : "_ZJNT-WC---",
  327. "name" : "Egypt",
  328. "type" : "country",
  329. "code" : "EGY"
  330. },
  331. {
  332. "_key" : "country-eritrea",
  333. "_id" : "worldVertices/country-eritrea",
  334. "_rev" : "_ZJNT-WC--A",
  335. "name" : "Eritrea",
  336. "type" : "country",
  337. "code" : "ERI"
  338. },
  339. {
  340. "_key" : "country-finland",
  341. "_id" : "worldVertices/country-finland",
  342. "_rev" : "_ZJNT-WC--C",
  343. "name" : "Finland",
  344. "type" : "country",
  345. "code" : "FIN"
  346. },
  347. {
  348. "_key" : "country-france",
  349. "_id" : "worldVertices/country-france",
  350. "_rev" : "_ZJNT-WC--E",
  351. "name" : "France",
  352. "type" : "country",
  353. "code" : "FRA"
  354. },
  355. {
  356. "_key" : "country-germany",
  357. "_id" : "worldVertices/country-germany",
  358. "_rev" : "_ZJNT-WC--G",
  359. "name" : "Germany",
  360. "type" : "country",
  361. "code" : "DEU"
  362. },
  363. {
  364. "_key" : "country-people-s-republic-of-china",
  365. "_id" : "worldVertices/country-people-s-republic-of-china",
  366. "_rev" : "_ZJNT-WG---",
  367. "name" : "People's Republic of China",
  368. "type" : "country",
  369. "code" : "CHN"
  370. },
  371. {
  372. "_key" : "capital-algiers",
  373. "_id" : "worldVertices/capital-algiers",
  374. "_rev" : "_ZJNT-WG--A",
  375. "name" : "Algiers",
  376. "type" : "capital"
  377. },
  378. {
  379. "_key" : "capital-andorra-la-vella",
  380. "_id" : "worldVertices/capital-andorra-la-vella",
  381. "_rev" : "_ZJNT-WG--C",
  382. "name" : "Andorra la Vella",
  383. "type" : "capital"
  384. },
  385. {
  386. "_key" : "capital-asmara",
  387. "_id" : "worldVertices/capital-asmara",
  388. "_rev" : "_ZJNT-WG--E",
  389. "name" : "Asmara",
  390. "type" : "capital"
  391. },
  392. {
  393. "_key" : "capital-bandar-seri-begawan",
  394. "_id" : "worldVertices/capital-bandar-seri-begawan",
  395. "_rev" : "_ZJNT-WK---",
  396. "name" : "Bandar Seri Begawan",
  397. "type" : "capital"
  398. },
  399. {
  400. "_key" : "capital-beijing",
  401. "_id" : "worldVertices/capital-beijing",
  402. "_rev" : "_ZJNT-WK--A",
  403. "name" : "Beijing",
  404. "type" : "capital"
  405. },
  406. {
  407. "_key" : "capital-berlin",
  408. "_id" : "worldVertices/capital-berlin",
  409. "_rev" : "_ZJNT-WK--C",
  410. "name" : "Berlin",
  411. "type" : "capital"
  412. },
  413. {
  414. "_key" : "capital-bogota",
  415. "_id" : "worldVertices/capital-bogota",
  416. "_rev" : "_ZJNT-WK--E",
  417. "name" : "Bogota",
  418. "type" : "capital"
  419. },
  420. {
  421. "_key" : "capital-brasilia",
  422. "_id" : "worldVertices/capital-brasilia",
  423. "_rev" : "_ZJNT-WO---",
  424. "name" : "Brasilia",
  425. "type" : "capital"
  426. },
  427. {
  428. "_key" : "capital-bridgetown",
  429. "_id" : "worldVertices/capital-bridgetown",
  430. "_rev" : "_ZJNT-WO--A",
  431. "name" : "Bridgetown",
  432. "type" : "capital"
  433. },
  434. {
  435. "_key" : "capital-brussels",
  436. "_id" : "worldVertices/capital-brussels",
  437. "_rev" : "_ZJNT-WO--C",
  438. "name" : "Brussels",
  439. "type" : "capital"
  440. },
  441. {
  442. "_key" : "capital-buenos-aires",
  443. "_id" : "worldVertices/capital-buenos-aires",
  444. "_rev" : "_ZJNT-WO--E",
  445. "name" : "Buenos Aires",
  446. "type" : "capital"
  447. },
  448. {
  449. "_key" : "capital-bujumbura",
  450. "_id" : "worldVertices/capital-bujumbura",
  451. "_rev" : "_ZJNT-WO--G",
  452. "name" : "Bujumbura",
  453. "type" : "capital"
  454. },
  455. {
  456. "_key" : "capital-cairo",
  457. "_id" : "worldVertices/capital-cairo",
  458. "_rev" : "_ZJNT-WS---",
  459. "name" : "Cairo",
  460. "type" : "capital"
  461. },
  462. {
  463. "_key" : "capital-canberra",
  464. "_id" : "worldVertices/capital-canberra",
  465. "_rev" : "_ZJNT-WS--A",
  466. "name" : "Canberra",
  467. "type" : "capital"
  468. },
  469. {
  470. "_key" : "capital-copenhagen",
  471. "_id" : "worldVertices/capital-copenhagen",
  472. "_rev" : "_ZJNT-WS--C",
  473. "name" : "Copenhagen",
  474. "type" : "capital"
  475. },
  476. {
  477. "_key" : "capital-dhaka",
  478. "_id" : "worldVertices/capital-dhaka",
  479. "_rev" : "_ZJNT-WS--E",
  480. "name" : "Dhaka",
  481. "type" : "capital"
  482. },
  483. {
  484. "_key" : "capital-gaborone",
  485. "_id" : "worldVertices/capital-gaborone",
  486. "_rev" : "_ZJNT-WW---",
  487. "name" : "Gaborone",
  488. "type" : "capital"
  489. },
  490. {
  491. "_key" : "capital-helsinki",
  492. "_id" : "worldVertices/capital-helsinki",
  493. "_rev" : "_ZJNT-WW--A",
  494. "name" : "Helsinki",
  495. "type" : "capital"
  496. },
  497. {
  498. "_key" : "capital-kabul",
  499. "_id" : "worldVertices/capital-kabul",
  500. "_rev" : "_ZJNT-WW--C",
  501. "name" : "Kabul",
  502. "type" : "capital"
  503. },
  504. {
  505. "_key" : "capital-la-paz",
  506. "_id" : "worldVertices/capital-la-paz",
  507. "_rev" : "_ZJNT-WW--E",
  508. "name" : "La Paz",
  509. "type" : "capital"
  510. },
  511. {
  512. "_key" : "capital-luanda",
  513. "_id" : "worldVertices/capital-luanda",
  514. "_rev" : "_ZJNT-Wa---",
  515. "name" : "Luanda",
  516. "type" : "capital"
  517. },
  518. {
  519. "_key" : "capital-manama",
  520. "_id" : "worldVertices/capital-manama",
  521. "_rev" : "_ZJNT-Wa--A",
  522. "name" : "Manama",
  523. "type" : "capital"
  524. },
  525. {
  526. "_key" : "capital-nassau",
  527. "_id" : "worldVertices/capital-nassau",
  528. "_rev" : "_ZJNT-Wa--C",
  529. "name" : "Nassau",
  530. "type" : "capital"
  531. },
  532. {
  533. "_key" : "capital-n-djamena",
  534. "_id" : "worldVertices/capital-n-djamena",
  535. "_rev" : "_ZJNT-Wa--E",
  536. "name" : "N'Djamena",
  537. "type" : "capital"
  538. },
  539. {
  540. "_key" : "capital-ottawa",
  541. "_id" : "worldVertices/capital-ottawa",
  542. "_rev" : "_ZJNT-We---",
  543. "name" : "Ottawa",
  544. "type" : "capital"
  545. },
  546. {
  547. "_key" : "capital-ouagadougou",
  548. "_id" : "worldVertices/capital-ouagadougou",
  549. "_rev" : "_ZJNT-We--A",
  550. "name" : "Ouagadougou",
  551. "type" : "capital"
  552. },
  553. {
  554. "_key" : "capital-paris",
  555. "_id" : "worldVertices/capital-paris",
  556. "_rev" : "_ZJNT-We--C",
  557. "name" : "Paris",
  558. "type" : "capital"
  559. },
  560. {
  561. "_key" : "capital-phnom-penh",
  562. "_id" : "worldVertices/capital-phnom-penh",
  563. "_rev" : "_ZJNT-We--E",
  564. "name" : "Phnom Penh",
  565. "type" : "capital"
  566. },
  567. {
  568. "_key" : "capital-prague",
  569. "_id" : "worldVertices/capital-prague",
  570. "_rev" : "_ZJNT-We--G",
  571. "name" : "Prague",
  572. "type" : "capital"
  573. },
  574. {
  575. "_key" : "capital-quito",
  576. "_id" : "worldVertices/capital-quito",
  577. "_rev" : "_ZJNT-Wi---",
  578. "name" : "Quito",
  579. "type" : "capital"
  580. },
  581. {
  582. "_key" : "capital-saint-john-s",
  583. "_id" : "worldVertices/capital-saint-john-s",
  584. "_rev" : "_ZJNT-Wi--A",
  585. "name" : "Saint John's",
  586. "type" : "capital"
  587. },
  588. {
  589. "_key" : "capital-santiago",
  590. "_id" : "worldVertices/capital-santiago",
  591. "_rev" : "_ZJNT-Wi--C",
  592. "name" : "Santiago",
  593. "type" : "capital"
  594. },
  595. {
  596. "_key" : "capital-sarajevo",
  597. "_id" : "worldVertices/capital-sarajevo",
  598. "_rev" : "_ZJNT-Wi--E",
  599. "name" : "Sarajevo",
  600. "type" : "capital"
  601. },
  602. {
  603. "_key" : "capital-sofia",
  604. "_id" : "worldVertices/capital-sofia",
  605. "_rev" : "_ZJNT-Wm---",
  606. "name" : "Sofia",
  607. "type" : "capital"
  608. },
  609. {
  610. "_key" : "capital-thimphu",
  611. "_id" : "worldVertices/capital-thimphu",
  612. "_rev" : "_ZJNT-Wm--A",
  613. "name" : "Thimphu",
  614. "type" : "capital"
  615. },
  616. {
  617. "_key" : "capital-tirana",
  618. "_id" : "worldVertices/capital-tirana",
  619. "_rev" : "_ZJNT-Wm--C",
  620. "name" : "Tirana",
  621. "type" : "capital"
  622. },
  623. {
  624. "_key" : "capital-vienna",
  625. "_id" : "worldVertices/capital-vienna",
  626. "_rev" : "_ZJNT-Wm--E",
  627. "name" : "Vienna",
  628. "type" : "capital"
  629. },
  630. {
  631. "_key" : "capital-yamoussoukro",
  632. "_id" : "worldVertices/capital-yamoussoukro",
  633. "_rev" : "_ZJNT-Wq---",
  634. "name" : "Yamoussoukro",
  635. "type" : "capital"
  636. },
  637. {
  638. "_key" : "capital-yaounde",
  639. "_id" : "worldVertices/capital-yaounde",
  640. "_rev" : "_ZJNT-Wq--A",
  641. "name" : "Yaounde",
  642. "type" : "capital"
  643. },
  644. {
  645. "_key" : "capital-zagreb",
  646. "_id" : "worldVertices/capital-zagreb",
  647. "_rev" : "_ZJNT-Wq--C",
  648. "name" : "Zagreb",
  649. "type" : "capital"
  650. }
  651. ]
  652. [
  653. {
  654. "_key" : "87965",
  655. "_id" : "worldEdges/87965",
  656. "_from" : "worldVertices/continent-africa",
  657. "_to" : "worldVertices/world",
  658. "_rev" : "_ZJNT-Wq--E",
  659. "type" : "is-in"
  660. },
  661. {
  662. "_key" : "87967",
  663. "_id" : "worldEdges/87967",
  664. "_from" : "worldVertices/continent-asia",
  665. "_to" : "worldVertices/world",
  666. "_rev" : "_ZJNT-Wq--G",
  667. "type" : "is-in"
  668. },
  669. {
  670. "_key" : "87969",
  671. "_id" : "worldEdges/87969",
  672. "_from" : "worldVertices/continent-australia",
  673. "_to" : "worldVertices/world",
  674. "_rev" : "_ZJNT-Wu---",
  675. "type" : "is-in"
  676. },
  677. {
  678. "_key" : "87971",
  679. "_id" : "worldEdges/87971",
  680. "_from" : "worldVertices/continent-europe",
  681. "_to" : "worldVertices/world",
  682. "_rev" : "_ZJNT-Wu--A",
  683. "type" : "is-in"
  684. },
  685. {
  686. "_key" : "87973",
  687. "_id" : "worldEdges/87973",
  688. "_from" : "worldVertices/continent-north-america",
  689. "_to" : "worldVertices/world",
  690. "_rev" : "_ZJNT-Wu--C",
  691. "type" : "is-in"
  692. },
  693. {
  694. "_key" : "87975",
  695. "_id" : "worldEdges/87975",
  696. "_from" : "worldVertices/continent-south-america",
  697. "_to" : "worldVertices/world",
  698. "_rev" : "_ZJNT-Wu--E",
  699. "type" : "is-in"
  700. },
  701. {
  702. "_key" : "87977",
  703. "_id" : "worldEdges/87977",
  704. "_from" : "worldVertices/country-afghanistan",
  705. "_to" : "worldVertices/continent-asia",
  706. "_rev" : "_ZJNT-Wy---",
  707. "type" : "is-in"
  708. },
  709. {
  710. "_key" : "87979",
  711. "_id" : "worldEdges/87979",
  712. "_from" : "worldVertices/country-albania",
  713. "_to" : "worldVertices/continent-europe",
  714. "_rev" : "_ZJNT-Wy--A",
  715. "type" : "is-in"
  716. },
  717. {
  718. "_key" : "87981",
  719. "_id" : "worldEdges/87981",
  720. "_from" : "worldVertices/country-algeria",
  721. "_to" : "worldVertices/continent-africa",
  722. "_rev" : "_ZJNT-Wy--C",
  723. "type" : "is-in"
  724. },
  725. {
  726. "_key" : "87983",
  727. "_id" : "worldEdges/87983",
  728. "_from" : "worldVertices/country-andorra",
  729. "_to" : "worldVertices/continent-europe",
  730. "_rev" : "_ZJNT-Wy--E",
  731. "type" : "is-in"
  732. },
  733. {
  734. "_key" : "87985",
  735. "_id" : "worldEdges/87985",
  736. "_from" : "worldVertices/country-angola",
  737. "_to" : "worldVertices/continent-africa",
  738. "_rev" : "_ZJNT-W2---",
  739. "type" : "is-in"
  740. },
  741. {
  742. "_key" : "87987",
  743. "_id" : "worldEdges/87987",
  744. "_from" : "worldVertices/country-antigua-and-barbuda",
  745. "_to" : "worldVertices/continent-north-america",
  746. "_rev" : "_ZJNT-W2--A",
  747. "type" : "is-in"
  748. },
  749. {
  750. "_key" : "87989",
  751. "_id" : "worldEdges/87989",
  752. "_from" : "worldVertices/country-argentina",
  753. "_to" : "worldVertices/continent-south-america",
  754. "_rev" : "_ZJNT-W2--C",
  755. "type" : "is-in"
  756. },
  757. {
  758. "_key" : "87991",
  759. "_id" : "worldEdges/87991",
  760. "_from" : "worldVertices/country-australia",
  761. "_to" : "worldVertices/continent-australia",
  762. "_rev" : "_ZJNT-W2--E",
  763. "type" : "is-in"
  764. },
  765. {
  766. "_key" : "87993",
  767. "_id" : "worldEdges/87993",
  768. "_from" : "worldVertices/country-austria",
  769. "_to" : "worldVertices/continent-europe",
  770. "_rev" : "_ZJNT-W6---",
  771. "type" : "is-in"
  772. },
  773. {
  774. "_key" : "87995",
  775. "_id" : "worldEdges/87995",
  776. "_from" : "worldVertices/country-bahamas",
  777. "_to" : "worldVertices/continent-north-america",
  778. "_rev" : "_ZJNT-W6--A",
  779. "type" : "is-in"
  780. },
  781. {
  782. "_key" : "87997",
  783. "_id" : "worldEdges/87997",
  784. "_from" : "worldVertices/country-bahrain",
  785. "_to" : "worldVertices/continent-asia",
  786. "_rev" : "_ZJNT-W6--C",
  787. "type" : "is-in"
  788. },
  789. {
  790. "_key" : "87999",
  791. "_id" : "worldEdges/87999",
  792. "_from" : "worldVertices/country-bangladesh",
  793. "_to" : "worldVertices/continent-asia",
  794. "_rev" : "_ZJNT-W6--E",
  795. "type" : "is-in"
  796. },
  797. {
  798. "_key" : "88001",
  799. "_id" : "worldEdges/88001",
  800. "_from" : "worldVertices/country-barbados",
  801. "_to" : "worldVertices/continent-north-america",
  802. "_rev" : "_ZJNT-X----",
  803. "type" : "is-in"
  804. },
  805. {
  806. "_key" : "88003",
  807. "_id" : "worldEdges/88003",
  808. "_from" : "worldVertices/country-belgium",
  809. "_to" : "worldVertices/continent-europe",
  810. "_rev" : "_ZJNT-X---A",
  811. "type" : "is-in"
  812. },
  813. {
  814. "_key" : "88005",
  815. "_id" : "worldEdges/88005",
  816. "_from" : "worldVertices/country-bhutan",
  817. "_to" : "worldVertices/continent-asia",
  818. "_rev" : "_ZJNT-X---C",
  819. "type" : "is-in"
  820. },
  821. {
  822. "_key" : "88007",
  823. "_id" : "worldEdges/88007",
  824. "_from" : "worldVertices/country-bolivia",
  825. "_to" : "worldVertices/continent-south-america",
  826. "_rev" : "_ZJNT-X---E",
  827. "type" : "is-in"
  828. },
  829. {
  830. "_key" : "88009",
  831. "_id" : "worldEdges/88009",
  832. "_from" : "worldVertices/country-bosnia-and-herzegovina",
  833. "_to" : "worldVertices/continent-europe",
  834. "_rev" : "_ZJNT-XC---",
  835. "type" : "is-in"
  836. },
  837. {
  838. "_key" : "88011",
  839. "_id" : "worldEdges/88011",
  840. "_from" : "worldVertices/country-botswana",
  841. "_to" : "worldVertices/continent-africa",
  842. "_rev" : "_ZJNT-XC--A",
  843. "type" : "is-in"
  844. },
  845. {
  846. "_key" : "88013",
  847. "_id" : "worldEdges/88013",
  848. "_from" : "worldVertices/country-brazil",
  849. "_to" : "worldVertices/continent-south-america",
  850. "_rev" : "_ZJNT-XC--C",
  851. "type" : "is-in"
  852. },
  853. {
  854. "_key" : "88015",
  855. "_id" : "worldEdges/88015",
  856. "_from" : "worldVertices/country-brunei",
  857. "_to" : "worldVertices/continent-asia",
  858. "_rev" : "_ZJNT-XC--E",
  859. "type" : "is-in"
  860. },
  861. {
  862. "_key" : "88017",
  863. "_id" : "worldEdges/88017",
  864. "_from" : "worldVertices/country-bulgaria",
  865. "_to" : "worldVertices/continent-europe",
  866. "_rev" : "_ZJNT-XC--G",
  867. "type" : "is-in"
  868. },
  869. {
  870. "_key" : "88019",
  871. "_id" : "worldEdges/88019",
  872. "_from" : "worldVertices/country-burkina-faso",
  873. "_to" : "worldVertices/continent-africa",
  874. "_rev" : "_ZJNT-XG---",
  875. "type" : "is-in"
  876. },
  877. {
  878. "_key" : "88021",
  879. "_id" : "worldEdges/88021",
  880. "_from" : "worldVertices/country-burundi",
  881. "_to" : "worldVertices/continent-africa",
  882. "_rev" : "_ZJNT-XG--A",
  883. "type" : "is-in"
  884. },
  885. {
  886. "_key" : "88023",
  887. "_id" : "worldEdges/88023",
  888. "_from" : "worldVertices/country-cambodia",
  889. "_to" : "worldVertices/continent-asia",
  890. "_rev" : "_ZJNT-XG--C",
  891. "type" : "is-in"
  892. },
  893. {
  894. "_key" : "88025",
  895. "_id" : "worldEdges/88025",
  896. "_from" : "worldVertices/country-cameroon",
  897. "_to" : "worldVertices/continent-africa",
  898. "_rev" : "_ZJNT-XG--E",
  899. "type" : "is-in"
  900. },
  901. {
  902. "_key" : "88027",
  903. "_id" : "worldEdges/88027",
  904. "_from" : "worldVertices/country-canada",
  905. "_to" : "worldVertices/continent-north-america",
  906. "_rev" : "_ZJNT-XK---",
  907. "type" : "is-in"
  908. },
  909. {
  910. "_key" : "88029",
  911. "_id" : "worldEdges/88029",
  912. "_from" : "worldVertices/country-chad",
  913. "_to" : "worldVertices/continent-africa",
  914. "_rev" : "_ZJNT-XK--A",
  915. "type" : "is-in"
  916. },
  917. {
  918. "_key" : "88031",
  919. "_id" : "worldEdges/88031",
  920. "_from" : "worldVertices/country-chile",
  921. "_to" : "worldVertices/continent-south-america",
  922. "_rev" : "_ZJNT-XK--C",
  923. "type" : "is-in"
  924. },
  925. {
  926. "_key" : "88033",
  927. "_id" : "worldEdges/88033",
  928. "_from" : "worldVertices/country-colombia",
  929. "_to" : "worldVertices/continent-south-america",
  930. "_rev" : "_ZJNT-XO---",
  931. "type" : "is-in"
  932. },
  933. {
  934. "_key" : "88035",
  935. "_id" : "worldEdges/88035",
  936. "_from" : "worldVertices/country-cote-d-ivoire",
  937. "_to" : "worldVertices/continent-africa",
  938. "_rev" : "_ZJNT-XO--A",
  939. "type" : "is-in"
  940. },
  941. {
  942. "_key" : "88037",
  943. "_id" : "worldEdges/88037",
  944. "_from" : "worldVertices/country-croatia",
  945. "_to" : "worldVertices/continent-europe",
  946. "_rev" : "_ZJNT-XO--C",
  947. "type" : "is-in"
  948. },
  949. {
  950. "_key" : "88039",
  951. "_id" : "worldEdges/88039",
  952. "_from" : "worldVertices/country-czech-republic",
  953. "_to" : "worldVertices/continent-europe",
  954. "_rev" : "_ZJNT-XO--E",
  955. "type" : "is-in"
  956. },
  957. {
  958. "_key" : "88041",
  959. "_id" : "worldEdges/88041",
  960. "_from" : "worldVertices/country-denmark",
  961. "_to" : "worldVertices/continent-europe",
  962. "_rev" : "_ZJNT-XS---",
  963. "type" : "is-in"
  964. },
  965. {
  966. "_key" : "88043",
  967. "_id" : "worldEdges/88043",
  968. "_from" : "worldVertices/country-ecuador",
  969. "_to" : "worldVertices/continent-south-america",
  970. "_rev" : "_ZJNT-XS--A",
  971. "type" : "is-in"
  972. },
  973. {
  974. "_key" : "88045",
  975. "_id" : "worldEdges/88045",
  976. "_from" : "worldVertices/country-egypt",
  977. "_to" : "worldVertices/continent-africa",
  978. "_rev" : "_ZJNT-XS--C",
  979. "type" : "is-in"
  980. },
  981. {
  982. "_key" : "88047",
  983. "_id" : "worldEdges/88047",
  984. "_from" : "worldVertices/country-eritrea",
  985. "_to" : "worldVertices/continent-africa",
  986. "_rev" : "_ZJNT-XS--E",
  987. "type" : "is-in"
  988. },
  989. {
  990. "_key" : "88049",
  991. "_id" : "worldEdges/88049",
  992. "_from" : "worldVertices/country-finland",
  993. "_to" : "worldVertices/continent-europe",
  994. "_rev" : "_ZJNT-XS--G",
  995. "type" : "is-in"
  996. },
  997. {
  998. "_key" : "88051",
  999. "_id" : "worldEdges/88051",
  1000. "_from" : "worldVertices/country-france",
  1001. "_to" : "worldVertices/continent-europe",
  1002. "_rev" : "_ZJNT-XW---",
  1003. "type" : "is-in"
  1004. },
  1005. {
  1006. "_key" : "88053",
  1007. "_id" : "worldEdges/88053",
  1008. "_from" : "worldVertices/country-germany",
  1009. "_to" : "worldVertices/continent-europe",
  1010. "_rev" : "_ZJNT-XW--A",
  1011. "type" : "is-in"
  1012. },
  1013. {
  1014. "_key" : "88055",
  1015. "_id" : "worldEdges/88055",
  1016. "_from" : "worldVertices/country-people-s-republic-of-china",
  1017. "_to" : "worldVertices/continent-asia",
  1018. "_rev" : "_ZJNT-XW--C",
  1019. "type" : "is-in"
  1020. },
  1021. {
  1022. "_key" : "88057",
  1023. "_id" : "worldEdges/88057",
  1024. "_from" : "worldVertices/capital-algiers",
  1025. "_to" : "worldVertices/country-algeria",
  1026. "_rev" : "_ZJNT-XW--E",
  1027. "type" : "is-in"
  1028. },
  1029. {
  1030. "_key" : "88059",
  1031. "_id" : "worldEdges/88059",
  1032. "_from" : "worldVertices/capital-andorra-la-vella",
  1033. "_to" : "worldVertices/country-andorra",
  1034. "_rev" : "_ZJNT-Xa---",
  1035. "type" : "is-in"
  1036. },
  1037. {
  1038. "_key" : "88061",
  1039. "_id" : "worldEdges/88061",
  1040. "_from" : "worldVertices/capital-asmara",
  1041. "_to" : "worldVertices/country-eritrea",
  1042. "_rev" : "_ZJNT-Xa--A",
  1043. "type" : "is-in"
  1044. },
  1045. {
  1046. "_key" : "88063",
  1047. "_id" : "worldEdges/88063",
  1048. "_from" : "worldVertices/capital-bandar-seri-begawan",
  1049. "_to" : "worldVertices/country-brunei",
  1050. "_rev" : "_ZJNT-Xa--C",
  1051. "type" : "is-in"
  1052. },
  1053. {
  1054. "_key" : "88065",
  1055. "_id" : "worldEdges/88065",
  1056. "_from" : "worldVertices/capital-beijing",
  1057. "_to" : "worldVertices/country-people-s-republic-of-china",
  1058. "_rev" : "_ZJNT-Xa--E",
  1059. "type" : "is-in"
  1060. },
  1061. {
  1062. "_key" : "88067",
  1063. "_id" : "worldEdges/88067",
  1064. "_from" : "worldVertices/capital-berlin",
  1065. "_to" : "worldVertices/country-germany",
  1066. "_rev" : "_ZJNT-Xe---",
  1067. "type" : "is-in"
  1068. },
  1069. {
  1070. "_key" : "88069",
  1071. "_id" : "worldEdges/88069",
  1072. "_from" : "worldVertices/capital-bogota",
  1073. "_to" : "worldVertices/country-colombia",
  1074. "_rev" : "_ZJNT-Xe--A",
  1075. "type" : "is-in"
  1076. },
  1077. {
  1078. "_key" : "88071",
  1079. "_id" : "worldEdges/88071",
  1080. "_from" : "worldVertices/capital-brasilia",
  1081. "_to" : "worldVertices/country-brazil",
  1082. "_rev" : "_ZJNT-Xe--C",
  1083. "type" : "is-in"
  1084. },
  1085. {
  1086. "_key" : "88073",
  1087. "_id" : "worldEdges/88073",
  1088. "_from" : "worldVertices/capital-bridgetown",
  1089. "_to" : "worldVertices/country-barbados",
  1090. "_rev" : "_ZJNT-Xi---",
  1091. "type" : "is-in"
  1092. },
  1093. {
  1094. "_key" : "88075",
  1095. "_id" : "worldEdges/88075",
  1096. "_from" : "worldVertices/capital-brussels",
  1097. "_to" : "worldVertices/country-belgium",
  1098. "_rev" : "_ZJNT-Xi--A",
  1099. "type" : "is-in"
  1100. },
  1101. {
  1102. "_key" : "88077",
  1103. "_id" : "worldEdges/88077",
  1104. "_from" : "worldVertices/capital-buenos-aires",
  1105. "_to" : "worldVertices/country-argentina",
  1106. "_rev" : "_ZJNT-Xi--C",
  1107. "type" : "is-in"
  1108. },
  1109. {
  1110. "_key" : "88079",
  1111. "_id" : "worldEdges/88079",
  1112. "_from" : "worldVertices/capital-bujumbura",
  1113. "_to" : "worldVertices/country-burundi",
  1114. "_rev" : "_ZJNT-Xi--E",
  1115. "type" : "is-in"
  1116. },
  1117. {
  1118. "_key" : "88081",
  1119. "_id" : "worldEdges/88081",
  1120. "_from" : "worldVertices/capital-cairo",
  1121. "_to" : "worldVertices/country-egypt",
  1122. "_rev" : "_ZJNT-Xi--G",
  1123. "type" : "is-in"
  1124. },
  1125. {
  1126. "_key" : "88083",
  1127. "_id" : "worldEdges/88083",
  1128. "_from" : "worldVertices/capital-canberra",
  1129. "_to" : "worldVertices/country-australia",
  1130. "_rev" : "_ZJNT-Xm---",
  1131. "type" : "is-in"
  1132. },
  1133. {
  1134. "_key" : "88085",
  1135. "_id" : "worldEdges/88085",
  1136. "_from" : "worldVertices/capital-copenhagen",
  1137. "_to" : "worldVertices/country-denmark",
  1138. "_rev" : "_ZJNT-Xm--A",
  1139. "type" : "is-in"
  1140. },
  1141. {
  1142. "_key" : "88087",
  1143. "_id" : "worldEdges/88087",
  1144. "_from" : "worldVertices/capital-dhaka",
  1145. "_to" : "worldVertices/country-bangladesh",
  1146. "_rev" : "_ZJNT-Xm--C",
  1147. "type" : "is-in"
  1148. },
  1149. {
  1150. "_key" : "88089",
  1151. "_id" : "worldEdges/88089",
  1152. "_from" : "worldVertices/capital-gaborone",
  1153. "_to" : "worldVertices/country-botswana",
  1154. "_rev" : "_ZJNT-Xm--E",
  1155. "type" : "is-in"
  1156. },
  1157. {
  1158. "_key" : "88091",
  1159. "_id" : "worldEdges/88091",
  1160. "_from" : "worldVertices/capital-helsinki",
  1161. "_to" : "worldVertices/country-finland",
  1162. "_rev" : "_ZJNT-Xq--_",
  1163. "type" : "is-in"
  1164. },
  1165. {
  1166. "_key" : "88093",
  1167. "_id" : "worldEdges/88093",
  1168. "_from" : "worldVertices/capital-kabul",
  1169. "_to" : "worldVertices/country-afghanistan",
  1170. "_rev" : "_ZJNT-Xq--B",
  1171. "type" : "is-in"
  1172. },
  1173. {
  1174. "_key" : "88095",
  1175. "_id" : "worldEdges/88095",
  1176. "_from" : "worldVertices/capital-la-paz",
  1177. "_to" : "worldVertices/country-bolivia",
  1178. "_rev" : "_ZJNT-Xq--D",
  1179. "type" : "is-in"
  1180. },
  1181. {
  1182. "_key" : "88097",
  1183. "_id" : "worldEdges/88097",
  1184. "_from" : "worldVertices/capital-luanda",
  1185. "_to" : "worldVertices/country-angola",
  1186. "_rev" : "_ZJNT-Xq--F",
  1187. "type" : "is-in"
  1188. },
  1189. {
  1190. "_key" : "88099",
  1191. "_id" : "worldEdges/88099",
  1192. "_from" : "worldVertices/capital-manama",
  1193. "_to" : "worldVertices/country-bahrain",
  1194. "_rev" : "_ZJNT-Xu---",
  1195. "type" : "is-in"
  1196. },
  1197. {
  1198. "_key" : "88101",
  1199. "_id" : "worldEdges/88101",
  1200. "_from" : "worldVertices/capital-nassau",
  1201. "_to" : "worldVertices/country-bahamas",
  1202. "_rev" : "_ZJNT-Xu--A",
  1203. "type" : "is-in"
  1204. },
  1205. {
  1206. "_key" : "88103",
  1207. "_id" : "worldEdges/88103",
  1208. "_from" : "worldVertices/capital-n-djamena",
  1209. "_to" : "worldVertices/country-chad",
  1210. "_rev" : "_ZJNT-Xu--C",
  1211. "type" : "is-in"
  1212. },
  1213. {
  1214. "_key" : "88105",
  1215. "_id" : "worldEdges/88105",
  1216. "_from" : "worldVertices/capital-ottawa",
  1217. "_to" : "worldVertices/country-canada",
  1218. "_rev" : "_ZJNT-Xu--E",
  1219. "type" : "is-in"
  1220. },
  1221. {
  1222. "_key" : "88107",
  1223. "_id" : "worldEdges/88107",
  1224. "_from" : "worldVertices/capital-ouagadougou",
  1225. "_to" : "worldVertices/country-burkina-faso",
  1226. "_rev" : "_ZJNT-Xy---",
  1227. "type" : "is-in"
  1228. },
  1229. {
  1230. "_key" : "88109",
  1231. "_id" : "worldEdges/88109",
  1232. "_from" : "worldVertices/capital-paris",
  1233. "_to" : "worldVertices/country-france",
  1234. "_rev" : "_ZJNT-Xy--A",
  1235. "type" : "is-in"
  1236. },
  1237. {
  1238. "_key" : "88111",
  1239. "_id" : "worldEdges/88111",
  1240. "_from" : "worldVertices/capital-phnom-penh",
  1241. "_to" : "worldVertices/country-cambodia",
  1242. "_rev" : "_ZJNT-Xy--C",
  1243. "type" : "is-in"
  1244. },
  1245. {
  1246. "_key" : "88113",
  1247. "_id" : "worldEdges/88113",
  1248. "_from" : "worldVertices/capital-prague",
  1249. "_to" : "worldVertices/country-czech-republic",
  1250. "_rev" : "_ZJNT-Xy--E",
  1251. "type" : "is-in"
  1252. },
  1253. {
  1254. "_key" : "88115",
  1255. "_id" : "worldEdges/88115",
  1256. "_from" : "worldVertices/capital-quito",
  1257. "_to" : "worldVertices/country-ecuador",
  1258. "_rev" : "_ZJNT-X2---",
  1259. "type" : "is-in"
  1260. },
  1261. {
  1262. "_key" : "88117",
  1263. "_id" : "worldEdges/88117",
  1264. "_from" : "worldVertices/capital-saint-john-s",
  1265. "_to" : "worldVertices/country-antigua-and-barbuda",
  1266. "_rev" : "_ZJNT-X2--A",
  1267. "type" : "is-in"
  1268. },
  1269. {
  1270. "_key" : "88119",
  1271. "_id" : "worldEdges/88119",
  1272. "_from" : "worldVertices/capital-santiago",
  1273. "_to" : "worldVertices/country-chile",
  1274. "_rev" : "_ZJNT-X2--C",
  1275. "type" : "is-in"
  1276. },
  1277. {
  1278. "_key" : "88121",
  1279. "_id" : "worldEdges/88121",
  1280. "_from" : "worldVertices/capital-sarajevo",
  1281. "_to" : "worldVertices/country-bosnia-and-herzegovina",
  1282. "_rev" : "_ZJNT-X2--E",
  1283. "type" : "is-in"
  1284. },
  1285. {
  1286. "_key" : "88123",
  1287. "_id" : "worldEdges/88123",
  1288. "_from" : "worldVertices/capital-sofia",
  1289. "_to" : "worldVertices/country-bulgaria",
  1290. "_rev" : "_ZJNT-X6---",
  1291. "type" : "is-in"
  1292. },
  1293. {
  1294. "_key" : "88125",
  1295. "_id" : "worldEdges/88125",
  1296. "_from" : "worldVertices/capital-thimphu",
  1297. "_to" : "worldVertices/country-bhutan",
  1298. "_rev" : "_ZJNT-X6--A",
  1299. "type" : "is-in"
  1300. },
  1301. {
  1302. "_key" : "88127",
  1303. "_id" : "worldEdges/88127",
  1304. "_from" : "worldVertices/capital-tirana",
  1305. "_to" : "worldVertices/country-albania",
  1306. "_rev" : "_ZJNT-X6--C",
  1307. "type" : "is-in"
  1308. },
  1309. {
  1310. "_key" : "88129",
  1311. "_id" : "worldEdges/88129",
  1312. "_from" : "worldVertices/capital-vienna",
  1313. "_to" : "worldVertices/country-austria",
  1314. "_rev" : "_ZJNT-X6--E",
  1315. "type" : "is-in"
  1316. },
  1317. {
  1318. "_key" : "88131",
  1319. "_id" : "worldEdges/88131",
  1320. "_from" : "worldVertices/capital-yamoussoukro",
  1321. "_to" : "worldVertices/country-cote-d-ivoire",
  1322. "_rev" : "_ZJNT-Y----",
  1323. "type" : "is-in"
  1324. },
  1325. {
  1326. "_key" : "88133",
  1327. "_id" : "worldEdges/88133",
  1328. "_from" : "worldVertices/capital-yaounde",
  1329. "_to" : "worldVertices/country-cameroon",
  1330. "_rev" : "_ZJNT-Y---A",
  1331. "type" : "is-in"
  1332. },
  1333. {
  1334. "_key" : "88135",
  1335. "_id" : "worldEdges/88135",
  1336. "_from" : "worldVertices/capital-zagreb",
  1337. "_to" : "worldVertices/country-croatia",
  1338. "_rev" : "_ZJNT-Y---C",
  1339. "type" : "is-in"
  1340. }
  1341. ]

Hide execution results

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 mpsverts collection and _edges in the mpsedges 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:

  1. arangosh> var examples = require("@arangodb/graph-examples/example-graph.js");
  2. arangosh> var g = examples.loadGraph("mps_graph");
  3. arangosh> db.mps_verts.toArray();
  4. arangosh> db.mps_edges.toArray();
  5. arangosh> examples.dropGraph("mps_graph");

Show execution results

  1. [
  2. {
  3. "_key" : "A",
  4. "_id" : "mps_verts/A",
  5. "_rev" : "_ZJNT-Si---"
  6. },
  7. {
  8. "_key" : "B",
  9. "_id" : "mps_verts/B",
  10. "_rev" : "_ZJNT-Si--A"
  11. },
  12. {
  13. "_key" : "C",
  14. "_id" : "mps_verts/C",
  15. "_rev" : "_ZJNT-Si--C"
  16. },
  17. {
  18. "_key" : "D",
  19. "_id" : "mps_verts/D",
  20. "_rev" : "_ZJNT-Sm---"
  21. },
  22. {
  23. "_key" : "E",
  24. "_id" : "mps_verts/E",
  25. "_rev" : "_ZJNT-Sm--A"
  26. },
  27. {
  28. "_key" : "F",
  29. "_id" : "mps_verts/F",
  30. "_rev" : "_ZJNT-Sm--C"
  31. }
  32. ]
  33. [
  34. {
  35. "_key" : "87731",
  36. "_id" : "mps_edges/87731",
  37. "_from" : "mps_verts/A",
  38. "_to" : "mps_verts/B",
  39. "_rev" : "_ZJNT-Sm--E",
  40. "vertex" : "A"
  41. },
  42. {
  43. "_key" : "87733",
  44. "_id" : "mps_edges/87733",
  45. "_from" : "mps_verts/A",
  46. "_to" : "mps_verts/E",
  47. "_rev" : "_ZJNT-Sq---",
  48. "vertex" : "A"
  49. },
  50. {
  51. "_key" : "87735",
  52. "_id" : "mps_edges/87735",
  53. "_from" : "mps_verts/A",
  54. "_to" : "mps_verts/D",
  55. "_rev" : "_ZJNT-Sq--A",
  56. "vertex" : "A"
  57. },
  58. {
  59. "_key" : "87737",
  60. "_id" : "mps_edges/87737",
  61. "_from" : "mps_verts/B",
  62. "_to" : "mps_verts/C",
  63. "_rev" : "_ZJNT-Sq--C",
  64. "vertex" : "B"
  65. },
  66. {
  67. "_key" : "87739",
  68. "_id" : "mps_edges/87739",
  69. "_from" : "mps_verts/D",
  70. "_to" : "mps_verts/C",
  71. "_rev" : "_ZJNT-Su---",
  72. "vertex" : "D"
  73. },
  74. {
  75. "_key" : "87741",
  76. "_id" : "mps_edges/87741",
  77. "_from" : "mps_verts/E",
  78. "_to" : "mps_verts/F",
  79. "_rev" : "_ZJNT-Su--A",
  80. "vertex" : "E"
  81. },
  82. {
  83. "_key" : "87743",
  84. "_id" : "mps_edges/87743",
  85. "_from" : "mps_verts/F",
  86. "_to" : "mps_verts/C",
  87. "_rev" : "_ZJNT-Su--C",
  88. "vertex" : "F"
  89. }
  90. ]

Hide execution results

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 networkfrom Slovakia that we used for performance testing on several databases;You will find importing scripts etc. in this blogpost.

Cookbook examples

The above referenced chapters describe the various APIs of ArangoDBs graph engine with small examples. Our cookbook has some more real life examples: