SlideShare a Scribd company logo
Github in a Graph
      with Neo4j
Andreas Kollegger
@akollegger
#neo4j
                    1
1
How we'll get the Octocat into the Graph

   1.Intro to Graphs, Socially
   2.Graph Database Essentials
   3.Github as a Graph
   4.Workshop!



                                      2
Graphs...


            3
Meet Emil...
Meet Emil...




               Emil
Meet Emil...
๏ from: Sweden




                 Emil
Meet Emil...
๏ from: Sweden
๏ appearance: blonde and handsome




                        Emil
Meet Emil...
๏ from: Sweden
๏ appearance: blonde and handsome
๏ personality: super friendly nerd




                           Emil
Meet Emil...
๏ from: Sweden
๏ appearance: blonde and handsome
๏ personality: super friendly nerd
๏ interests: piano, pickled herring




                            Emil
Emil has some friends




                 Emil
Emil has some friends
๏ Kerstin: his sister




                        Emil


                               Kerstin
Emil has some friends
๏ Kerstin: his sister
๏ Peter: his buddy




                     Peter   Emil


                                    Kerstin
Emil has some friends
๏ Kerstin: his sister
๏ Peter: his buddy
๏ Andreas: me!




                        Peter   Emil

              Andreas
                                       Kerstin
His friends introduced more friends




                  Peter   Emil

        Andreas
                                 Kerstin
His friends introduced more friends
๏ Michael: master hacker




        Michael             Peter   Emil

                  Andreas
                                           Kerstin
His friends introduced more friends
๏ Michael: master hacker
๏ Johan: technology sage




        Michael                            Johan
                            Peter   Emil

                  Andreas
                                                   Kerstin
His friends introduced more friends
๏ Michael: master hacker
๏ Johan: technology sage
๏ Madelene: polyglot journalist




        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
His friends introduced more friends
๏ Michael: master hacker
๏ Johan: technology sage
๏ Madelene: polyglot journalist
๏ Allison: marketing maven




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
So, we have a bunch of people




                                                                 Allison
     Michael                                       Johan
                         Peter   Emil

               Andreas
                                        Madelene           Kerstin
So, we have a bunch of people
๏ how do we know they are friends?




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
So, we have a bunch of people
๏ how do we know they are friends?
๏ either ask each pair: are you friends?




                                                                     Allison
         Michael                                       Johan
                             Peter   Emil

                   Andreas
                                            Madelene           Kerstin
So, we have a bunch of people
๏ how do we know they are friends?
๏ either ask each pair: are you friends?
๏ or, we can add explicit connections




                                                                     Allison
         Michael                                       Johan
                             Peter   Emil

                   Andreas
                                            Madelene           Kerstin
So, we have a bunch of people
๏ how do we know they are friends?
๏ either ask each pair: are you friends?
๏ or, we can add explicit connections




                                                                     Allison
         Michael                                       Johan
                             Peter   Emil

                   Andreas
                                            Madelene           Kerstin
There's a problem here




                                                                 Allison
     Michael                                       Johan
                         Peter   Emil

               Andreas
                                        Madelene           Kerstin
There's a problem here
๏ Emil is awesome




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
There's a problem here
๏ Emil is awesome
๏ What about other relationships?




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
There's a problem here
๏ Emil is awesome
๏ What about other relationships?
๏ We mentioned "introductions" so there must've
    been at least some pre-existing connections




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
There's a problem here
๏ Emil is awesome
๏ What about other relationships?
๏ We mentioned "introductions" so there must've
    been at least some pre-existing connections




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil

                  Andreas
                                           Madelene           Kerstin
This can continue...




                                                                 Allison
     Michael                                       Johan
                         Peter   Emil

               Andreas
                                        Madelene           Kerstin
This can continue...




                                                                   Allison
       Michael                                       Johan
                           Peter   Emil
Anna
                 Andreas                                                     Adam
                                          Madelene           Kerstin
This can continue...
๏ this is how social networks grow




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can continue...
๏ this is how social networks grow
๏ either meet people directly




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can continue...
๏ this is how social networks grow
๏ either meet people directly
๏ or be introduced




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can be useful




                                                                   Allison
       Michael                                       Johan
                           Peter   Emil
Anna
                 Andreas                                                     Adam
                                          Madelene           Kerstin
This can be useful
๏ professional recommendation (LinkedIn)




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can be useful
๏ professional recommendation (LinkedIn)
๏ product recommendation (Amazon)




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can be useful
๏ professional recommendation (LinkedIn)
๏ product recommendation (Amazon)
๏ restaurant recommendations (Yelp)




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This can be useful
๏ professional recommendation (LinkedIn)
๏ product recommendation (Amazon)
๏ restaurant recommendations (Yelp)
๏ same domain, or reaching across domains




                                                                    Allison
        Michael                                       Johan
                            Peter   Emil
 Anna
                  Andreas                                                     Adam
                                           Madelene           Kerstin
This is really just data




                                                                   Allison
       Michael                                       Johan
                           Peter   Emil
Anna
                 Andreas                                                     Adam
                                          Madelene           Kerstin
This is really just data
๏ it's just a graph




                                                                     Allison
         Michael                                       Johan
                             Peter   Emil
 Anna
                   Andreas                                                     Adam
                                            Madelene           Kerstin
12
A graph?


           12
Yes, a graph...




                  13
Yes, a graph...
๏ you know the common data structures




                                        13
Yes, a graph...
๏ you know the common data structures
  •linked lists, trees, object "graphs"




                                          13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure




                                                  13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure
   •suitable for any connected data




                                                  13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure
   •suitable for any connected data
๏ well-understood patterns and algorithms




                                                  13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure
   •suitable for any connected data
๏ well-understood patterns and algorithms
   •studied since Leonard Euler's 7 Bridges (1736)


                                                     13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure
   •suitable for any connected data
๏ well-understood patterns and algorithms
   •studied since Leonard Euler's 7 Bridges (1736)
   •Codd's Relational Model (1970)

                                                     13
Yes, a graph...
๏ you know the common data structures
   •linked lists, trees, object "graphs"
๏ a graph is the general purpose data structure
   •suitable for any connected data
๏ well-understood patterns and algorithms
   •studied since Leonard Euler's 7 Bridges (1736)
   •Codd's Relational Model (1970)
   •not a new idea, just an idea who's time is now
                                                     13
14
Everyone is talking about graphs...




                                      14
Everyone is talking about graphs...



Facebook Open Graph




                                        14
Everyone is talking about graphs...



Facebook Open Graph




                                        14
Emil's Graph
Emil's Graph




     Emil
Emil's Graph

     Peter




                    Kerstin

             Emil




Andreas
Emil's Graph

          Peter             Johan




                                        Kerstin

Michael            Emil




                                    Madelene
     Andreas


                  Allison
Emil's Graph

          Peter             Johan




                                                  star
                                        Kerstin

Michael            Emil




                                    Madelene
     Andreas


                  Allison
Emil's Graph

          Peter             Johan




                                                  star
                                        Kerstin

Michael            Emil




                                    Madelene
     Andreas


                  Allison
Emil's Graph

          Peter             Johan




                                                             star
                                        Kerstin

Michael            Emil




                                    Madelene
     Andreas


                  Allison




                                                  butterfly
Emil's Graph

          Peter             Johan




                                                             star
                                        Kerstin

Michael            Emil




                                    Madelene
     Andreas


                  Allison




                                                  butterfly
Emil's Graph

                    Peter             Johan

diamond

                                                                       star
                                                  Kerstin

          Michael            Emil




                                              Madelene
               Andreas


                            Allison




                                                            butterfly
Emil's Graph

                     Peter             Johan

diamond

                                                                        star
                                                   Kerstin

           Michael            Emil




                                               Madelene
                Andreas


                             Allison

    Anna

                                                             butterfly


                             Adam
Emil's Graph

                            Peter             Johan

       diamond

                                                                               star
                                                          Kerstin

                  Michael            Emil




                                                      Madelene
                       Andreas


                                    Allison

           Anna

                                                                    butterfly


bull                                Adam
16
Well known named graphs




                          16
Well known named graphs



    star




                          16
Well known named graphs



    star     butterfly




                          16
Well known named graphs



    star     butterfly     diamond




                                    16
Well known named graphs



    star     butterfly     diamond   bull




                                           16
Well known named graphs



    star      butterfly    diamond   bull




   franklin




                                           16
Well known named graphs



    star       butterfly   diamond   bull




   franklin   robertson




                                           16
Well known named graphs



    star       butterfly   diamond   bull




   franklin   robertson   horton




                                           16
Well known named graphs



    star       butterfly   diamond        bull




   franklin   robertson   horton    hall-janko




                                                 16
16
Text




       17
The best known of all possible graphs...




                      Text




                                           17
18
How can you use this?
With a Graph Database


                    18
A graph database...




                      19
A graph database...

๏ optimized for the connections between records




                                                  19
A graph database...

๏ optimized for the connections between records
๏ really, really fast at querying across records




                                                   19
A graph database...

๏ optimized for the connections between records
๏ really, really fast at querying across records
๏ a database: transactional with the usual
    operations




                                                   19
A graph database...

๏ optimized for the connections between records
๏ really, really fast at querying across records
๏ a database: transactional with the usual
    operations
๏ “A relational database may tell you
    the average age of everyone at this workshop,
  but a graph database will tell you
    who is most likely to buy you a beer.”


                                                    19
20
You know relational




                      20
You know relational




                      20
You know relational




         foo

                      20
You know relational




         foo          bar

                            20
You know relational




         foo   foo_bar   bar

                               20
You know relational




         foo   foo_bar   bar

                               20
You know relational




         foo   foo_bar   bar

                               20
You know relational




         foo   foo_bar   bar

                               20
You know relational
now consider relationships...




                                20
You know relational
now consider relationships...




                                20
You know relational
now consider relationships...




                                20
You know relational
now consider relationships...




                                20
You know relational
now consider relationships...




                                20
You know relational
now consider relationships...




                                20
20
21
We're talking about a
Property Graph




                        21
We're talking about a
Property Graph


    Nodes




                        21
We're talking about a
Property Graph


    Nodes


     Relationships




                        21
We're talking about a
Property Graph
                                            Em                                       Joh
                                                 il                                      a   n
                                  knows                                     knows
                     Alli                                         Tob                                    Lar

    Nodes
                            son                                       ias           knows                   s
                                                          knows
                                          And                                       And                  knows
                     knows                      rea                                       rés
                                                      s
                                                          knows             knows                knows
                     Pet                                          Miic
                                                                  Mc                knows                 Ian
                        er                knows                        a
                                                                       a
                                  knows                   knows
                                           De                                       Mic
                                              lia                                      h   ael

     Relationships

            Properties (each a key+value)

       + Indexes (for easy look-ups)
                                                                                                                 21
21
22
And, but, so how do you
query this "graph" database?



                         22
23
Cypher - a graph query language
๏ a pattern-matching query language
๏ declarative grammar with clauses (like SQL)
๏ aggregation, ordering, limits
๏ create, read, update, delete




                                                23
Cypher - a graph query language
๏ a pattern-matching query language
๏ declarative grammar with clauses (like SQL)
๏ aggregation, ordering, limits
๏ create, read, update, delete

    // get node 1, traverse 2 steps away
    start a=node(1) match (a)--()--(c) return c

    // create a node with a 'name' property
    CREATE (me {name: 'Andreas'}) return me


๏ more on this later...
                                                23
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching




                            24
Cypher - pattern matching syntax




                                   25
Cypher - pattern matching syntax




                                   25
Cypher - pattern matching syntax




       () --> ()

                                   25
Cypher - pattern matching syntax




                                   26
Cypher - pattern matching syntax



         A               B




                                   26
Cypher - pattern matching syntax



         A               B

     (A) --> (B)

                                   26
Cypher - pattern matching syntax




                                   27
Cypher - pattern matching syntax



         A               B




                                   27
Cypher - pattern matching syntax



         A               B

      (A) -- (B)

                                   27
Cypher - pattern matching syntax




                                   28
Cypher - pattern matching syntax


               LOVES
         A               B




                                   28
Cypher - pattern matching syntax


               LOVES
         A               B

       A -[:LOVES]-> B


                                   28
Cypher - pattern matching syntax




                                   29
Cypher - pattern matching syntax



   A             B             C




                                   29
Cypher - pattern matching syntax



   A             B             C

  A --> B --> C

                                   29
Cypher - pattern matching syntax




                                   30
Cypher - pattern matching syntax

                 A


             B        C



                                   30
Cypher - pattern matching syntax

                 A


             B        C

  A --> B --> C, A --> C

                                   30
Cypher - pattern matching syntax

                 A


             B        C

  A --> B --> C, A --> C
   A --> B --> C <-- A
                                   30
31
Cypher - read clauses




                        31
Cypher - read clauses
  // get node 1, traverse 2 steps away
  START a=node(1) MATCH (a)--()--(c) RETURN c

  // get node from an index, return it
  START a=node:users(login='akollegger')
  RETURN a

  // get node from an index, match, filter
  // with where, then return results
  START a=node:users(login='akollegger')
  MATCH (a)-[r]-(b) WHERE b.login='jakewins'
  RETURN r,b


                                           31
Cypher - CREATE a node


         A




                         32
Cypher - CREATE a node


          A



  // create a person named Andreas
  CREATE (a {name:'Andreas'})



                                     32
Cypher - CREATE relationships




                                33
Cypher - CREATE relationships

                LOVES
         A                 B




                                33
Cypher - CREATE relationships

                LOVES
         A                 B

       A -[:LOVES]-> B




                                33
Cypher - CREATE relationships

                  LOVES
          A                    B

       A -[:LOVES]-> B

  // create love between two people
  START a=node:people(name='Andreas'),
   b=node:people(name='Anna')
  CREATE a-[:LOVES]->(b)

                                         33
Cypher - CREATE UNIQUE data




                              34
Cypher - CREATE UNIQUE data

              LOVES
        A               B




                              34
Cypher - CREATE UNIQUE data

              LOVES
        A               B

      A -[:LOVES]-> B




                              34
Cypher - CREATE UNIQUE data

                  LOVES
          A                    B

       A -[:LOVES]-> B

  // create love between two people
  START a=node:people(name='Andreas'),
   b=node:people(name='Anna')
  CREATE UNIQUE a-[:LOVES]->(b)

                                         34
Cypher - CREATE full path




                            35
Cypher - CREATE full path

                LOVES
         A                  B




                                35
Cypher - CREATE full path

                LOVES
         A                  B

       A -[:LOVES]-> B




                                35
Cypher - CREATE full path

                   LOVES
           A                    B

        A -[:LOVES]-> B

   // create an entire path at once
   CREATE p=(a {name:'Andreas'})-[:LOVES]->
    (b {name:'Anna'}) return p


                                          35
Cypher - update a Node


         A




                         36
Cypher - update a Node


          A



  // update the nerdiness of Andreas
  START a=node:people(name='Andreas')
  SET a.nerdiness = 10


                                        36
Cypher - DELETE data




                       37
Cypher - DELETE data

               LOVES
         A             B




                           37
Cypher - DELETE data

               LOVES
         A             B

       A -[:LOVES]-> B




                           37
Cypher - DELETE data

                  LOVES
          A                    B

       A -[:LOVES]-> B

  // Goodbye Anna! remove relationships
  START a=node:people(name='Anna')
  MATCH a-[r]-(b)
  DELETE a,r

                                          37
Github as a Graph


                    38
Github - collaborative coding
๏ Hosting of git repositories
๏ Prominent social aspect
   • follow other coders
   • collaborate with other coders
   • branches and forks
   • watch repositories
   • star repositories

                                     39
Github User Graph - simple

                                 User
   login: "octocat"
   id: 1
   avatar_url: "https://github.com/images/error/octocat_happy.gif"
   gravatar_id: "somehexcode"
   url: "https://api.github.com/users/octocat"                       akollegger    follows   jakewins
   name: "monalisa octocat"
   company: "GitHub"
   blog: "https://github.com/blog"
   location: "San Francisco"
   email: "octocat@github.com"                                                               follows
   hireable: false                                                     follows
   bio: "There once was..."
   public_repos: 2                                                                nawroth
   public_gists: 1
   followers: 20
   following: 0
   html_url: "https://github.com/octocat"
   created_at: "2008-01-14T04:33:35Z"
   type: "User"




details: http://developer.github.com                                                                    40
Github User Graph - complete


                                       akollegger    follows   jakewins




                                         follows               follows


                                                    nawroth




details: http://developer.github.com                                      41
Github User Graph - complete




                           akollegger    follows   jakewins




                             follows               follows


                                        nawroth




details: http://developer.github.com                          41
Github User Graph - complete
                                                               heroku



                                                           member of


                     neo4j                                      mattt




                                                     follows
                   member of


                                        akollegger              follows   jakewins


                     owns

                                          follows                         follows


                  FEC_GRAPH                                    nawroth


                                                               follows


                      collaborates on
                                                                jexp




details: http://developer.github.com                                                 41
Github User Graph - complete
                                                                                    heroku



                                                                                member of


                                          neo4j                                      mattt




                                                                          follows
                                        member of


                                                             akollegger              follows   jakewins


                                          owns

                                                               follows                         follows


                                       FEC_GRAPH                                    nawroth


                                                                                    follows


                                           collaborates on
                                                                                     jexp




details: http://developer.github.com                                                             41
Github User Graph - complete
                                                                                    heroku



                                                                                member of


(user)-[:follows]->(users)                neo4j                                      mattt




                                                                          follows
                                        member of


                                                             akollegger              follows   jakewins


                                          owns

                                                               follows                         follows


                                       FEC_GRAPH                                    nawroth


                                                                                    follows


                                           collaborates on
                                                                                     jexp




details: http://developer.github.com                                                             41
Github User Graph - complete
                                                                                    heroku



                                                                                member of


(user)-[:follows]->(users)                neo4j                                      mattt

(user)-[:member_of]->(org)
                                                                          follows
                                        member of


                                                             akollegger              follows   jakewins


                                          owns

                                                               follows                         follows


                                       FEC_GRAPH                                    nawroth


                                                                                    follows


                                           collaborates on
                                                                                     jexp




details: http://developer.github.com                                                             41
Github User Graph - complete
                                                                                    heroku



                                                                                member of


(user)-[:follows]->(users)                neo4j                                      mattt

(user)-[:member_of]->(org)
(user)-[:owns]->(repository)            member of
                                                                          follows



                                                             akollegger              follows   jakewins


                                          owns

                                                               follows                         follows


                                       FEC_GRAPH                                    nawroth


                                                                                    follows


                                           collaborates on
                                                                                     jexp




details: http://developer.github.com                                                             41
Github User Graph - complete
                                                                                    heroku



                                                                                member of


(user)-[:follows]->(users)                neo4j                                      mattt

(user)-[:member_of]->(org)
(user)-[:owns]->(repository)            member of
                                                                          follows

(user)-[:collaborates_on]->(repos)
                                                             akollegger              follows   jakewins


                                          owns

                                                               follows                         follows


                                       FEC_GRAPH                                    nawroth


                                                                                    follows


                                           collaborates on
                                                                                     jexp




details: http://developer.github.com                                                             41
Workshop


           42
Preparations


๏Get on Github
๏Get Neo4j




                      43
What would you like to do?


A.Data Import
B.Cypher Query Challenge
C.Graph Visualization




                              44
Ready to Start? Go here...


๏http://graphhub-east.github.com
๏http://graphhub-west.github.com




                                   45
46
and, Thanks :)




                 46
Github in a Graph

More Related Content

Viewers also liked

NoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and WhereNoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and Where
Eugene Hanikblum
 
Link Analysis
Link AnalysisLink Analysis
An Introduction to Neural Networks and Machine Learning
An Introduction to Neural Networks and Machine LearningAn Introduction to Neural Networks and Machine Learning
An Introduction to Neural Networks and Machine Learning
Chris Nicholls
 
Reinforcing AML systems with graph technologies.
Reinforcing AML systems with graph technologies.Reinforcing AML systems with graph technologies.
Reinforcing AML systems with graph technologies.
Linkurious
 
Introduction to the graph technologies landscape
Introduction to the graph technologies landscapeIntroduction to the graph technologies landscape
Introduction to the graph technologies landscape
Linkurious
 
Building a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with RBuilding a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with R
DataWorks Summit/Hadoop Summit
 
GraphGen: Conducting Graph Analytics over Relational Databases
GraphGen: Conducting Graph Analytics over Relational DatabasesGraphGen: Conducting Graph Analytics over Relational Databases
GraphGen: Conducting Graph Analytics over Relational Databases
PyData
 
Solving Problems with Graphs
Solving Problems with GraphsSolving Problems with Graphs
Solving Problems with Graphs
Marko Rodriguez
 
Using graph technologies to fight fraud
Using graph technologies to fight fraudUsing graph technologies to fight fraud
Using graph technologies to fight fraud
Linkurious
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
Neo4j
 
Link analysis .. Data Mining
Link analysis .. Data MiningLink analysis .. Data Mining
Link analysis .. Data Mining
Mustafa Salam
 
Business Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money LaunderingBusiness Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money Laundering
Kartik Mehta
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural Networks
Francesco Collova'
 
Graph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of DataGraph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of Data
Marko Rodriguez
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
Marko Rodriguez
 
Relational to Big Graph
Relational to Big GraphRelational to Big Graph
Relational to Big Graph
Neo4j
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
Antonio Maccioni
 
Big Graph Analytics on Neo4j with Apache Spark
Big Graph Analytics on Neo4j with Apache SparkBig Graph Analytics on Neo4j with Apache Spark
Big Graph Analytics on Neo4j with Apache Spark
Kenny Bastani
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...
Neo4j
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
Max De Marzi
 

Viewers also liked (20)

NoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and WhereNoSQL Graph Databases - Why, When and Where
NoSQL Graph Databases - Why, When and Where
 
Link Analysis
Link AnalysisLink Analysis
Link Analysis
 
An Introduction to Neural Networks and Machine Learning
An Introduction to Neural Networks and Machine LearningAn Introduction to Neural Networks and Machine Learning
An Introduction to Neural Networks and Machine Learning
 
Reinforcing AML systems with graph technologies.
Reinforcing AML systems with graph technologies.Reinforcing AML systems with graph technologies.
Reinforcing AML systems with graph technologies.
 
Introduction to the graph technologies landscape
Introduction to the graph technologies landscapeIntroduction to the graph technologies landscape
Introduction to the graph technologies landscape
 
Building a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with RBuilding a Scalable Data Science Platform with R
Building a Scalable Data Science Platform with R
 
GraphGen: Conducting Graph Analytics over Relational Databases
GraphGen: Conducting Graph Analytics over Relational DatabasesGraphGen: Conducting Graph Analytics over Relational Databases
GraphGen: Conducting Graph Analytics over Relational Databases
 
Solving Problems with Graphs
Solving Problems with GraphsSolving Problems with Graphs
Solving Problems with Graphs
 
Using graph technologies to fight fraud
Using graph technologies to fight fraudUsing graph technologies to fight fraud
Using graph technologies to fight fraud
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Link analysis .. Data Mining
Link analysis .. Data MiningLink analysis .. Data Mining
Link analysis .. Data Mining
 
Business Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money LaunderingBusiness Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money Laundering
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural Networks
 
Graph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of DataGraph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of Data
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
 
Relational to Big Graph
Relational to Big GraphRelational to Big Graph
Relational to Big Graph
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
 
Big Graph Analytics on Neo4j with Apache Spark
Big Graph Analytics on Neo4j with Apache SparkBig Graph Analytics on Neo4j with Apache Spark
Big Graph Analytics on Neo4j with Apache Spark
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 

Recently uploaded

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 

Recently uploaded (20)

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 

Github in a Graph

  • 1. Github in a Graph with Neo4j Andreas Kollegger @akollegger #neo4j 1
  • 2. 1
  • 3. How we'll get the Octocat into the Graph 1.Intro to Graphs, Socially 2.Graph Database Essentials 3.Github as a Graph 4.Workshop! 2
  • 8. Meet Emil... ๏ from: Sweden ๏ appearance: blonde and handsome Emil
  • 9. Meet Emil... ๏ from: Sweden ๏ appearance: blonde and handsome ๏ personality: super friendly nerd Emil
  • 10. Meet Emil... ๏ from: Sweden ๏ appearance: blonde and handsome ๏ personality: super friendly nerd ๏ interests: piano, pickled herring Emil
  • 11. Emil has some friends Emil
  • 12. Emil has some friends ๏ Kerstin: his sister Emil Kerstin
  • 13. Emil has some friends ๏ Kerstin: his sister ๏ Peter: his buddy Peter Emil Kerstin
  • 14. Emil has some friends ๏ Kerstin: his sister ๏ Peter: his buddy ๏ Andreas: me! Peter Emil Andreas Kerstin
  • 15. His friends introduced more friends Peter Emil Andreas Kerstin
  • 16. His friends introduced more friends ๏ Michael: master hacker Michael Peter Emil Andreas Kerstin
  • 17. His friends introduced more friends ๏ Michael: master hacker ๏ Johan: technology sage Michael Johan Peter Emil Andreas Kerstin
  • 18. His friends introduced more friends ๏ Michael: master hacker ๏ Johan: technology sage ๏ Madelene: polyglot journalist Michael Johan Peter Emil Andreas Madelene Kerstin
  • 19. His friends introduced more friends ๏ Michael: master hacker ๏ Johan: technology sage ๏ Madelene: polyglot journalist ๏ Allison: marketing maven Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 20. So, we have a bunch of people Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 21. So, we have a bunch of people ๏ how do we know they are friends? Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 22. So, we have a bunch of people ๏ how do we know they are friends? ๏ either ask each pair: are you friends? Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 23. So, we have a bunch of people ๏ how do we know they are friends? ๏ either ask each pair: are you friends? ๏ or, we can add explicit connections Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 24. So, we have a bunch of people ๏ how do we know they are friends? ๏ either ask each pair: are you friends? ๏ or, we can add explicit connections Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 25. There's a problem here Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 26. There's a problem here ๏ Emil is awesome Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 27. There's a problem here ๏ Emil is awesome ๏ What about other relationships? Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 28. There's a problem here ๏ Emil is awesome ๏ What about other relationships? ๏ We mentioned "introductions" so there must've been at least some pre-existing connections Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 29. There's a problem here ๏ Emil is awesome ๏ What about other relationships? ๏ We mentioned "introductions" so there must've been at least some pre-existing connections Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 30. This can continue... Allison Michael Johan Peter Emil Andreas Madelene Kerstin
  • 31. This can continue... Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 32. This can continue... ๏ this is how social networks grow Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 33. This can continue... ๏ this is how social networks grow ๏ either meet people directly Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 34. This can continue... ๏ this is how social networks grow ๏ either meet people directly ๏ or be introduced Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 35. This can be useful Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 36. This can be useful ๏ professional recommendation (LinkedIn) Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 37. This can be useful ๏ professional recommendation (LinkedIn) ๏ product recommendation (Amazon) Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 38. This can be useful ๏ professional recommendation (LinkedIn) ๏ product recommendation (Amazon) ๏ restaurant recommendations (Yelp) Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 39. This can be useful ๏ professional recommendation (LinkedIn) ๏ product recommendation (Amazon) ๏ restaurant recommendations (Yelp) ๏ same domain, or reaching across domains Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 40. This is really just data Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 41. This is really just data ๏ it's just a graph Allison Michael Johan Peter Emil Anna Andreas Adam Madelene Kerstin
  • 42. 12
  • 43. A graph? 12
  • 45. Yes, a graph... ๏ you know the common data structures 13
  • 46. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" 13
  • 47. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure 13
  • 48. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data 13
  • 49. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data ๏ well-understood patterns and algorithms 13
  • 50. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data ๏ well-understood patterns and algorithms •studied since Leonard Euler's 7 Bridges (1736) 13
  • 51. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data ๏ well-understood patterns and algorithms •studied since Leonard Euler's 7 Bridges (1736) •Codd's Relational Model (1970) 13
  • 52. Yes, a graph... ๏ you know the common data structures •linked lists, trees, object "graphs" ๏ a graph is the general purpose data structure •suitable for any connected data ๏ well-understood patterns and algorithms •studied since Leonard Euler's 7 Bridges (1736) •Codd's Relational Model (1970) •not a new idea, just an idea who's time is now 13
  • 53. 14
  • 54. Everyone is talking about graphs... 14
  • 55. Everyone is talking about graphs... Facebook Open Graph 14
  • 56. Everyone is talking about graphs... Facebook Open Graph 14
  • 58. Emil's Graph Emil
  • 59. Emil's Graph Peter Kerstin Emil Andreas
  • 60. Emil's Graph Peter Johan Kerstin Michael Emil Madelene Andreas Allison
  • 61. Emil's Graph Peter Johan star Kerstin Michael Emil Madelene Andreas Allison
  • 62. Emil's Graph Peter Johan star Kerstin Michael Emil Madelene Andreas Allison
  • 63. Emil's Graph Peter Johan star Kerstin Michael Emil Madelene Andreas Allison butterfly
  • 64. Emil's Graph Peter Johan star Kerstin Michael Emil Madelene Andreas Allison butterfly
  • 65. Emil's Graph Peter Johan diamond star Kerstin Michael Emil Madelene Andreas Allison butterfly
  • 66. Emil's Graph Peter Johan diamond star Kerstin Michael Emil Madelene Andreas Allison Anna butterfly Adam
  • 67. Emil's Graph Peter Johan diamond star Kerstin Michael Emil Madelene Andreas Allison Anna butterfly bull Adam
  • 68. 16
  • 69. Well known named graphs 16
  • 70. Well known named graphs star 16
  • 71. Well known named graphs star butterfly 16
  • 72. Well known named graphs star butterfly diamond 16
  • 73. Well known named graphs star butterfly diamond bull 16
  • 74. Well known named graphs star butterfly diamond bull franklin 16
  • 75. Well known named graphs star butterfly diamond bull franklin robertson 16
  • 76. Well known named graphs star butterfly diamond bull franklin robertson horton 16
  • 77. Well known named graphs star butterfly diamond bull franklin robertson horton hall-janko 16
  • 78. 16
  • 79. Text 17
  • 80. The best known of all possible graphs... Text 17
  • 81. 18
  • 82. How can you use this? With a Graph Database 18
  • 84. A graph database... ๏ optimized for the connections between records 19
  • 85. A graph database... ๏ optimized for the connections between records ๏ really, really fast at querying across records 19
  • 86. A graph database... ๏ optimized for the connections between records ๏ really, really fast at querying across records ๏ a database: transactional with the usual operations 19
  • 87. A graph database... ๏ optimized for the connections between records ๏ really, really fast at querying across records ๏ a database: transactional with the usual operations ๏ “A relational database may tell you the average age of everyone at this workshop, but a graph database will tell you who is most likely to buy you a beer.” 19
  • 88. 20
  • 92. You know relational foo bar 20
  • 93. You know relational foo foo_bar bar 20
  • 94. You know relational foo foo_bar bar 20
  • 95. You know relational foo foo_bar bar 20
  • 96. You know relational foo foo_bar bar 20
  • 97. You know relational now consider relationships... 20
  • 98. You know relational now consider relationships... 20
  • 99. You know relational now consider relationships... 20
  • 100. You know relational now consider relationships... 20
  • 101. You know relational now consider relationships... 20
  • 102. You know relational now consider relationships... 20
  • 103. 20
  • 104. 21
  • 105. We're talking about a Property Graph 21
  • 106. We're talking about a Property Graph Nodes 21
  • 107. We're talking about a Property Graph Nodes Relationships 21
  • 108. We're talking about a Property Graph Em Joh il a n knows knows Alli Tob Lar Nodes son ias knows s knows And And knows knows rea rés s knows knows knows Pet Miic Mc knows Ian er knows a a knows knows De Mic lia h ael Relationships Properties (each a key+value) + Indexes (for easy look-ups) 21
  • 109. 21
  • 110. 22
  • 111. And, but, so how do you query this "graph" database? 22
  • 112. 23
  • 113. Cypher - a graph query language ๏ a pattern-matching query language ๏ declarative grammar with clauses (like SQL) ๏ aggregation, ordering, limits ๏ create, read, update, delete 23
  • 114. Cypher - a graph query language ๏ a pattern-matching query language ๏ declarative grammar with clauses (like SQL) ๏ aggregation, ordering, limits ๏ create, read, update, delete // get node 1, traverse 2 steps away start a=node(1) match (a)--()--(c) return c // create a node with a 'name' property CREATE (me {name: 'Andreas'}) return me ๏ more on this later... 23
  • 115. Cypher - pattern matching 24
  • 116. Cypher - pattern matching 24
  • 117. Cypher - pattern matching 24
  • 118. Cypher - pattern matching 24
  • 119. Cypher - pattern matching 24
  • 120. Cypher - pattern matching 24
  • 121. Cypher - pattern matching 24
  • 122. Cypher - pattern matching syntax 25
  • 123. Cypher - pattern matching syntax 25
  • 124. Cypher - pattern matching syntax () --> () 25
  • 125. Cypher - pattern matching syntax 26
  • 126. Cypher - pattern matching syntax A B 26
  • 127. Cypher - pattern matching syntax A B (A) --> (B) 26
  • 128. Cypher - pattern matching syntax 27
  • 129. Cypher - pattern matching syntax A B 27
  • 130. Cypher - pattern matching syntax A B (A) -- (B) 27
  • 131. Cypher - pattern matching syntax 28
  • 132. Cypher - pattern matching syntax LOVES A B 28
  • 133. Cypher - pattern matching syntax LOVES A B A -[:LOVES]-> B 28
  • 134. Cypher - pattern matching syntax 29
  • 135. Cypher - pattern matching syntax A B C 29
  • 136. Cypher - pattern matching syntax A B C A --> B --> C 29
  • 137. Cypher - pattern matching syntax 30
  • 138. Cypher - pattern matching syntax A B C 30
  • 139. Cypher - pattern matching syntax A B C A --> B --> C, A --> C 30
  • 140. Cypher - pattern matching syntax A B C A --> B --> C, A --> C A --> B --> C <-- A 30
  • 141. 31
  • 142. Cypher - read clauses 31
  • 143. Cypher - read clauses // get node 1, traverse 2 steps away START a=node(1) MATCH (a)--()--(c) RETURN c // get node from an index, return it START a=node:users(login='akollegger') RETURN a // get node from an index, match, filter // with where, then return results START a=node:users(login='akollegger') MATCH (a)-[r]-(b) WHERE b.login='jakewins' RETURN r,b 31
  • 144. Cypher - CREATE a node A 32
  • 145. Cypher - CREATE a node A // create a person named Andreas CREATE (a {name:'Andreas'}) 32
  • 146. Cypher - CREATE relationships 33
  • 147. Cypher - CREATE relationships LOVES A B 33
  • 148. Cypher - CREATE relationships LOVES A B A -[:LOVES]-> B 33
  • 149. Cypher - CREATE relationships LOVES A B A -[:LOVES]-> B // create love between two people START a=node:people(name='Andreas'), b=node:people(name='Anna') CREATE a-[:LOVES]->(b) 33
  • 150. Cypher - CREATE UNIQUE data 34
  • 151. Cypher - CREATE UNIQUE data LOVES A B 34
  • 152. Cypher - CREATE UNIQUE data LOVES A B A -[:LOVES]-> B 34
  • 153. Cypher - CREATE UNIQUE data LOVES A B A -[:LOVES]-> B // create love between two people START a=node:people(name='Andreas'), b=node:people(name='Anna') CREATE UNIQUE a-[:LOVES]->(b) 34
  • 154. Cypher - CREATE full path 35
  • 155. Cypher - CREATE full path LOVES A B 35
  • 156. Cypher - CREATE full path LOVES A B A -[:LOVES]-> B 35
  • 157. Cypher - CREATE full path LOVES A B A -[:LOVES]-> B // create an entire path at once CREATE p=(a {name:'Andreas'})-[:LOVES]-> (b {name:'Anna'}) return p 35
  • 158. Cypher - update a Node A 36
  • 159. Cypher - update a Node A // update the nerdiness of Andreas START a=node:people(name='Andreas') SET a.nerdiness = 10 36
  • 160. Cypher - DELETE data 37
  • 161. Cypher - DELETE data LOVES A B 37
  • 162. Cypher - DELETE data LOVES A B A -[:LOVES]-> B 37
  • 163. Cypher - DELETE data LOVES A B A -[:LOVES]-> B // Goodbye Anna! remove relationships START a=node:people(name='Anna') MATCH a-[r]-(b) DELETE a,r 37
  • 164. Github as a Graph 38
  • 165. Github - collaborative coding ๏ Hosting of git repositories ๏ Prominent social aspect • follow other coders • collaborate with other coders • branches and forks • watch repositories • star repositories 39
  • 166. Github User Graph - simple User login: "octocat" id: 1 avatar_url: "https://github.com/images/error/octocat_happy.gif" gravatar_id: "somehexcode" url: "https://api.github.com/users/octocat" akollegger follows jakewins name: "monalisa octocat" company: "GitHub" blog: "https://github.com/blog" location: "San Francisco" email: "octocat@github.com" follows hireable: false follows bio: "There once was..." public_repos: 2 nawroth public_gists: 1 followers: 20 following: 0 html_url: "https://github.com/octocat" created_at: "2008-01-14T04:33:35Z" type: "User" details: http://developer.github.com 40
  • 167. Github User Graph - complete akollegger follows jakewins follows follows nawroth details: http://developer.github.com 41
  • 168. Github User Graph - complete akollegger follows jakewins follows follows nawroth details: http://developer.github.com 41
  • 169. Github User Graph - complete heroku member of neo4j mattt follows member of akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 170. Github User Graph - complete heroku member of neo4j mattt follows member of akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 171. Github User Graph - complete heroku member of (user)-[:follows]->(users) neo4j mattt follows member of akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 172. Github User Graph - complete heroku member of (user)-[:follows]->(users) neo4j mattt (user)-[:member_of]->(org) follows member of akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 173. Github User Graph - complete heroku member of (user)-[:follows]->(users) neo4j mattt (user)-[:member_of]->(org) (user)-[:owns]->(repository) member of follows akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 174. Github User Graph - complete heroku member of (user)-[:follows]->(users) neo4j mattt (user)-[:member_of]->(org) (user)-[:owns]->(repository) member of follows (user)-[:collaborates_on]->(repos) akollegger follows jakewins owns follows follows FEC_GRAPH nawroth follows collaborates on jexp details: http://developer.github.com 41
  • 175. Workshop 42
  • 177. What would you like to do? A.Data Import B.Cypher Query Challenge C.Graph Visualization 44
  • 178. Ready to Start? Go here... ๏http://graphhub-east.github.com ๏http://graphhub-west.github.com 45
  • 179. 46

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n
  196. \n
  197. \n
  198. \n
  199. \n
  200. \n
  201. \n
  202. \n
  203. \n
  204. \n
  205. \n
  206. \n
  207. \n
  208. \n
  209. \n
  210. \n
  211. \n
  212. \n
  213. \n
  214. \n
  215. \n
  216. \n
  217. \n
  218. \n
  219. \n
  220. \n
  221. \n
  222. \n