Neo4j gRaphs

Bea Hernández

2018-02-14

About

Data Scientist focused on finding patterns and relations between online consumers. She also co-organizes R-Ladies Madrid and is a member of the NASADatanauts.

Twitter / Github : @Chucheria

About

  1. About Graphs
  2. About Neo4j data in R
  3. About analyzing and visualizing Neo4j data in R

Graphs + Neo4j

Graphs + Neo4j

A graph G is a collection of entities (nodes) and the relationships (edges) that connect those entities

G = {N, E}

Graphs + Neo4j

A graph database stores your data in a graph.

Tables and foreign keys are nodes and relationships.

  • What does math say?

Graphs can be undirected

  • What does Neo4j say?

You have to make directed relationships. Forget about them when you make your queries.

Graphs + Neo4j

Nodes can have properties.

Relationships can have properties.

Node labels are the best. Gives us set advantages.

## [[1]]
##  [1] "studio"       "releaseDate"  "imdbId"       "description" 
##  [5] "runtime"      "language"     "title"        "version"     
##  [9] "trailer"      "imageUrl"     "genre"        "tagline"     
## [13] "lastModified" "id"           "homepage"

Neo4j + R

Neo4j + R

Set your environment

Neo4j + R

Neo4j + R

Neo4j + R

Neo4j + R

Visualize

RStats

RStats

Betweenness centrality

The betweenness centrality for each vertex is the number of these shortest paths that pass through the vertex. It represents the degree of which nodes stand between each other.

\[betweenness(v) = \sum_{x \neq y \in V} \frac{\sigma_{xy}(v)}{\sigma_{xy}}\]

RStats

Betweenness centrality

##     Larry Simms     Arthur Lake           Daisy Penny Singleton 
##       129.01905        55.02381        64.12143        55.12143 
##   Danny Mummert 
##        97.35476

RStats

Betweenness centrality

Let’s Kahoot!

Come and play

Kahoot