Chapter 1 About

This book is a user companion for using Neo4J and R together with the {neo4r} package.

1.1 {neo4r}

The goal of {neo4r} is to provide a modern and flexible Neo4J driver for R.

It’s modern in the sense that the results are returned as tibbles whenever possible, it relies on modern tools, and it is designed to work with pipes. Our goal is to provide a driver that can be easily integrated in a data analysis workflow, especially by providing an API working smoothly with other data analysis ({dplyr} or {purrr}) and graph packages ({igraph}, {ggraph}, {visNetwork}…).

It’s flexible in the sense that it is rather unopinionated regarding the way it returns the results, by trying to stay as close as possible to the way Neo4J returns data. That way, you have the control over the way you will compute the results. At the same time, the result is not too complex, so that the “heavy lifting” of data wrangling is not left to the user.

The connexion object is also an easy to control R6 method, allowing you to update and query information from the API.

Sending data for this book:

library(neo4r)
con <- neo4j_api$new(
  url = "http://localhost:7474",
  user = "neo4j", 
  password = "password"
  )
# Note that play_movies is only available for versions >= 0.1.3 
play_movies() %>%
  call_neo4j(con)
## $a
## # A tibble: 10 x 2
##     born name     
##    <int> <chr>    
##  1  1956 Tom Hanks
##  2  1956 Tom Hanks
##  3  1956 Tom Hanks
##  4  1956 Tom Hanks
##  5  1956 Tom Hanks
##  6  1956 Tom Hanks
##  7  1956 Tom Hanks
##  8  1956 Tom Hanks
##  9  1956 Tom Hanks
## 10  1956 Tom Hanks
## 
## $m
## # A tibble: 10 x 3
##    tagline                                         title           released
##    <chr>                                           <chr>              <int>
##  1 In every life there comes a time when that thi… That Thing You…     1996
##  2 Once in a lifetime you get a chance to do some… A League of Th…     1992
##  3 What if someone you never met, someone you nev… Sleepless in S…     1993
##  4 A stiff drink. A little mascara. A lot of nerv… Charlie Wilson…     2007
##  5 At the edge of the world, his journey begins.   Cast Away           2000
##  6 Walk a mile youll never forget.                 The Green Mile      1999
##  7 Break The Codes                                 The Da Vinci C…     2006
##  8 This Holiday Season… Believe                    The Polar Expr…     2004
##  9 A story of love, lava and burning desire.       Joe Versus the…     1990
## 10 Everything is connected                         Cloud Atlas         2012
## 
## $d
## # A tibble: 10 x 2
##     born name                
##    <int> <chr>               
##  1  1956 Tom Hanks           
##  2  1943 Penny Marshall      
##  3  1941 Nora Ephron         
##  4  1931 Mike Nichols        
##  5  1951 Robert Zemeckis     
##  6  1959 Frank Darabont      
##  7  1954 Ron Howard          
##  8  1951 Robert Zemeckis     
##  9  1950 John Patrick Stanley
## 10  1965 Tom Tykwer          
## 
## attr(,"class")
## [1] "neo"  "list"