SlideShare uma empresa Scribd logo
1 de 181
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

Mais conteúdo relacionado

Destaque

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 WhereEugene Hanikblum
 
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 LearningChris 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 landscapeLinkurious
 
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 DatabasesPyData
 
Solving Problems with Graphs
Solving Problems with GraphsSolving Problems with Graphs
Solving Problems with GraphsMarko Rodriguez
 
Using graph technologies to fight fraud
Using graph technologies to fight fraudUsing graph technologies to fight fraud
Using graph technologies to fight fraudLinkurious
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4jNeo4j
 
Link analysis .. Data Mining
Link analysis .. Data MiningLink analysis .. Data Mining
Link analysis .. Data MiningMustafa Salam
 
Business Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money LaunderingBusiness Intelligence For Anti-Money Laundering
Business Intelligence For Anti-Money LaunderingKartik Mehta
 
Machine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksMachine Learning: Introduction to Neural Networks
Machine Learning: Introduction to Neural NetworksFrancesco 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 DataMarko Rodriguez
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming PatternMarko Rodriguez
 
Relational to Big Graph
Relational to Big GraphRelational to Big Graph
Relational to Big GraphNeo4j
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph DatabasesAntonio 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 SparkKenny 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 DatabasesMax De Marzi
 

Destaque (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
 

Último

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Último (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

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

Notas do Editor

  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