Commit dbc6521b authored by Jörg Schad's avatar Jörg Schad
Browse files

Updated ArangoDB doc links.

parent 488e8e12
......@@ -40,10 +40,10 @@ It is possible install ArangoDB both downloading the installer and have a stand-
**IMPORTANT NOTE:** since this is still a prototype it is not yet supported the management of the users. This means that each installation you choose must disable security. This is a known limitation that will be removed when the first stable version will be released.
#### Setup with Docker <a name="docker"></a>
To setup an ArangoDB instance using Docker you can [follow those instructions](https://docs.arangodb.com/3.4/Manual/Deployment/SingleInstance/ManualStart.html#manual-start-in-docker).
To setup an ArangoDB instance using Docker you can [follow those instructions](https://www.arangodb.com/docs/stable/deployment-docker.html).
#### Setup from installer <a name="installer"></a>
To setup an ArangoDB instance using the stand-alone version you can [follow those instructions](https://docs.arangodb.com/3.4/Manual/GettingStarted/Installation.html).
To setup an ArangoDB instance using the stand-alone version you can [follow those instructions](https://www.arangodb.com/docs/stable/getting-started-installation.html).
## ArangoDB basic concepts <a name="arangoconcepts"></a>
In order to understand the examples in the next sections it is desirable understand some basic concepts of the behaving and logic of ArangoDB. Each instance of an ArangoDB server can store multiple databases: even if you don't create any database, there is the default one named **\_system**. Every operation you invoke that is invoked with no database specified affects the **\_system** one. It is suggested to not use this database for applications.
......@@ -55,9 +55,9 @@ ArangoDB is a **Multi-Model database**, this means that there are multiple ways
For details please refer to the official ArangoDB documentation:
* **Quick introduction** https://docs.arangodb.com/3.4/Manual/GettingStarted/DatabasesCollectionsDocuments.html
* **Core Concepts** https://docs.arangodb.com/3.4/Manual/DataModeling/
* **AQL** https://docs.arangodb.com/3.4/AQL/
* **Quick introduction** https://www.arangodb.com/docs/stable/getting-started-databases-collections-documents.html
* **Core Concepts** https://www.arangodb.com/docs/stable/data-modeling.html
* **AQL** https://www.arangodb.com/docs/stable/aql/
## Install the package <a name="installation"></a>
To install the latest version of the aRangodb package you have to run the following commands:
......@@ -88,7 +88,7 @@ library(aRangodb)
```
### Connection to ArangoDB server <a name="connectarango"></a>
Connect to an ArangoDB server up and running
```R
......@@ -100,16 +100,16 @@ arangoConnection <- arango_connection(<instance_ip>, <instance_port>, <username>
Create a "sandbox" database: to create a database, if it is not found, use the _createOnFail_ option (default is FALSE):
```R
sandboxArangoDb <-
arangoConnection %>%
sandboxArangoDb <-
arangoConnection %>%
arango_database("sandbox", createOnFail = TRUE)
```
To use the default database (**DISCOURAGED**) you can do:
```R
defaultArangoDb <-
arangoConnection %>%
defaultArangoDb <-
arangoConnection %>%
arango_database()
```
......@@ -132,33 +132,33 @@ Again it has been used the option _createOnFail_ to create the collections if th
Now we have two different collections: we can populate with some data for subsequent examples using the aRangodb::document_insert(key) in order to create a new document with the given key as identifier: after that we can set its values using the aRangodb::document_set() function. The insertion, and the values' updates, are consolidated in the db once invoked the aRangodb::collection_update() function. It could be a limitation, but for synchronous update support there will be a dedicated release.
```R
persons %>%
document_insert("john.doe") %>%
document_set(age=30, birthday="17/01/1989") %>%
persons %>%
document_insert("john.doe") %>%
document_set(age=30, birthday="17/01/1989") %>%
collection_update()
persons %>%
document_insert("alice.foo") %>%
document_set(age=36, birthday="07/02/1983", graduated = TRUE) %>%
persons %>%
document_insert("alice.foo") %>%
document_set(age=36, birthday="07/02/1983", graduated = TRUE) %>%
collection_update()
persons %>%
document_insert("brandon.fee") %>%
document_set(age=36, birthday="03/11/1983", jobTitle="Software Developer") %>%
persons %>%
document_insert("brandon.fee") %>%
document_set(age=36, birthday="03/11/1983", jobTitle="Software Developer") %>%
collection_update()
persons %>%
document_insert("charlie.foo") %>%
document_set(age=34, birthday="03/02/1985") %>%
persons %>%
document_insert("charlie.foo") %>%
document_set(age=34, birthday="03/02/1985") %>%
collection_update()
cities %>%
document_insert("London") %>%
document_set(position=list(latitude=51.5098, longitude=-2.0122), capital=TRUE, country="UK") %>%
cities %>%
document_insert("London") %>%
document_set(position=list(latitude=51.5098, longitude=-2.0122), capital=TRUE, country="UK") %>%
collection_update()
cities %>%
document_insert("Manchester") %>%
cities %>%
document_insert("Manchester") %>%
document_set(position=list(latitude=53.4839, longitude=-2.2446), capital=FALSE, country="UK") %>%
collection_update()
```
......@@ -208,15 +208,15 @@ if(!is.null(filtered.cities$London)){
You can use the aRangodb::document_set() or aRangodb::document_unset() methods to insert/update or remove an attribute from a document. For example, the following code shows an insertion, followed by an update and an unset.
```R
Lyon <- cities %>%
document_insert("Lyon") %>%
Lyon <- cities %>%
document_insert("Lyon") %>%
document_set(capital=FALSE, country="Fran") %>% # wrong insertion
collection_update()
Lyon %>%
document_set(country="France") %>% # update
collection_update()
Lyon %>%
document_unset(capital) %>% # no more important
collection_update()
......@@ -228,12 +228,12 @@ you need to specify the string containing the query using the \@variable_name to
Do you want to get all the persons with age more than come threshold?
```R
searchByAgeGreaterThen <-
sandboxArangoDb %>%
searchByAgeGreaterThen <-
sandboxArangoDb %>%
aql("FOR p IN person FILTER p.age > @age RETURN p")
```
The previous commands affect the current environment by adding a new function, named _searchByAgeGreaterThan_, where formal parameters are the ones corresponding to the variables left unbind in the AQL query, in this case _age_. Before returning a function, the aRango::aql() command execute the parsing of the query, so that syntax errors will be highlighted as error in the definition of the function.
The previous commands affect the current environment by adding a new function, named _searchByAgeGreaterThan_, where formal parameters are the ones corresponding to the variables left unbind in the AQL query, in this case _age_. Before returning a function, the aRango::aql() command execute the parsing of the query, so that syntax errors will be highlighted as error in the definition of the function.
In conclusion from now on you can now execute the query as normal R function:
```R
......@@ -254,8 +254,8 @@ print(paste0("'I'm Alice Foo, isn't it?' ", filtered.persons$doc0$getKey() == "a
Last but not least, you can define a graph structure in the same way you can define a collection.
```R
residenceGraph <-
sandboxArangoDb %>%
residenceGraph <-
sandboxArangoDb %>%
arango_graph("residence", createOnFail = TRUE)
```
......@@ -263,16 +263,16 @@ If you created the graph from scratch, as in this case, you can add the definiti
that the graph can store. Adding an edge will automatically adds the collections to the graph as possible sources of edges, and it will creates a collection for the edge relation if they don't exist yet.
```R
residenceGraph <-
residenceGraph %>%
residenceGraph <-
residenceGraph %>%
define_edge("person", "lives_in", "city")
livesInCollection <-
sandboxArangoDb %>%
livesInCollection <-
sandboxArangoDb %>%
arango_collection("lives_in")
if(!(is.null(livesInCollection))){
print(paste0("'Voilà, I'm an edge collection, isn't it?' ",
print(paste0("'Voilà, I'm an edge collection, isn't it?' ",
"'",livesInCollection$getType() == collection_type$EDGE,"'"))
}
```
......@@ -280,16 +280,16 @@ if(!(is.null(livesInCollection))){
Also collections will be automatically created if not in the collection set:
```R
residenceGraph <-
residenceGraph %>%
residenceGraph <-
residenceGraph %>%
define_edge(cities, "had_weather", "weather")
weatherCollection <-
sandboxArangoDb %>%
weatherCollection <-
sandboxArangoDb %>%
arango_collection("weather")
if(!(is.null(weatherCollection))){
print(paste0("'Voilà, I'm a document collection, isn't it?' ",
print(paste0("'Voilà, I'm a document collection, isn't it?' ",
"'",weatherCollection$getType() == collection_type$DOCUMENT,"'"))
}
```
......@@ -297,7 +297,7 @@ if(!(is.null(weatherCollection))){
But a graph isn't useful if you cannot populate it with relations. Just use the aRangodb::add_edges() method and the relational operators!
```R
residenceGraph <-
residenceGraph <-
residenceGraph %>%
add_edges("lives_in" %owns% edge(all.persons$john.doe %->% all.cities$London)) %>%
add_edges("lives_in" %owns% edge(all.persons$brandon.fee %->% all.cities$Manchester, since="09/01/2016"))
......@@ -306,7 +306,7 @@ residenceGraph <-
You can select all the nodes and relations belonging to the graph by using the aRangodb::all_graph() function:
```R
residences.graph <-
residences.graph <-
residenceGraph %>%
all_graph()
```
......@@ -314,7 +314,7 @@ residences.graph <-
However in most of the cases the entire graph is not relevant for the analysis, so you may want to focus on a specific part. You can use the aRangodb::traversal() function, that implements a basic support for the AQL traversal mechanism. Starting from specific vertices of interest you can get all the edges (up to a depth you can indicate) incident on those particular vertices, called in fact start vertices. For example you may want to know all the vertices, with distance at most 2, that have an edge incident on London vertex:
```R
london.residence <- residenceGraph %>%
london.residence <- residenceGraph %>%
traversal(vertices = c(all.cities$London), depth = 2)
```
......@@ -323,7 +323,7 @@ london.residence <- residenceGraph %>%
A feature provided by the aRangodb package is the visualization of graphs: the underlying engine used is the visNetwork package. Once you have retrieved a graph, the whole graph or the result of some traversal, you can simply call the aRangodb::visualize() function:
```R
london.residence %>% visualize()
london.residence %>% visualize()
```
The function result is shown in the following image:
......@@ -333,7 +333,7 @@ The function result is shown in the following image:
It is also possible to have more complex visualization: you can add legend, icons (from FontAwesome 4.7), and direction of edges. For example the following command produces the graph in the next image:
```R
london.center %>%
london.center %>%
viz_vertices(
icon=list(person = "f007", city="f015")
) %>%
......@@ -459,7 +459,7 @@ ArangoGraph <- ArangoGraph %>% remove_edges(...) # takes a list of list represen
To simplify the process of addition/removal of edges you can use the relationa operators for inbound edges %<-% or outbound edges %->%, aRangodb::edge() function and the %owns% relation.
```R
list <- ArangoDocument %->% ArangoDocument # returns a list(`_from`=..., `_to`=...)
list <- ArangoDocument %->% ArangoDocument # returns a list(`_from`=..., `_to`=...)
list <- character %owns% edge(list, ...) # returns a list containing the from/to information, the collection name representing the edge and the values (if any) for this edge
```
......@@ -553,7 +553,7 @@ The following is an uncomplete frequently-updated list to recap the major featur
* First release of the package
* Version **0.1.0**:
* first stable release with major bug fixing
* first stable release with major bug fixing
* complete unit tests coverage
* Version **0.2.0**:
......@@ -561,10 +561,10 @@ The following is an uncomplete frequently-updated list to recap the major featur
* bulk insertion of CSV files
* bulk export of graphs/collection in JSON files
* bulk export of graphs/collection in CSV files
* Version **0.3.0**:
* support for basic algorithms on graphs
* ...
## Citation <a name="citation"></a>
......@@ -581,4 +581,4 @@ A BibTeX entry for LaTeX users is
address = {Pisa, Italia},
year = {2019},
url = {www.kode-solutions.net}
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment