SlideShare a Scribd company logo
1 of 102
•                  (   )

    •   @kimuras

•                          G(2007   )

•
    •
•
Agenda

• Introduction
• The past work
• Introduction to GraphDB
• Introduction to Neo4j
• Introduction to analysis sample
Introduction
Motivation for social graph analysis
mixi
                 30000000

                                   ID
                 22500000
# of member id




                 15000000



                  7500000



                        0
                            2007        2008   2009   2010   2011
                                               year
What is Social Graph?
Feed Back
Feed Back
Feed Back
Feed Back
Feed Back
Approach for SG
    analysis


       Feed Back
The past work
•
•
Relational Databases

                                        Dump &
                                        Denormalization




from_id    to_id    id   name     age                     Key      value

1          2        1    Kimura   18                      From:1   2,3

1          3        2    kato     45                      From:2   3

2          3        3    ito      21                      Prof:1   Kimura,18
                                                          Prof:2   Kato,45
Relational Databases

                                        Dump &

                   reimplementation     Denormalization




from_id    to_id    id   name     age                     Key      value

1
1
           2
           3
                   maintenance cost
                    1
                    2
                         Kimura
                         kato
                                  18
                                  45
                                                          From:1
                                                          From:2
                                                                   2,3
                                                                   3

2          3        3    ito      21                      Prof:1   Kimuras,18
                                                          Prof:2   Kato,45

                               scalability
Introduction to GraphDB
What is graph
What is graph
 Vertex (node :   )
What is graph
         Vertex (node :   )




Edge (     )
What is graph
         Vertex (node :   )


          Undirected graph (   )

Edge (     )
What is graph
         Vertex (node :   )




Edge (     )
What is graph
         Vertex (node :   )




Edge (     )
What is graph
         Vertex (node :   )




Edge (     )
What is graph
         Vertex (node :     )


               Directed graph (   )

Edge (     )
What is GraphDB
         Vertex (node :   )




Edge (     )
What is GraphDB
ID:   1
               Vertex (node :   )
NAME: kimura
PROP: Male
AGE: 18




Edge (           )
What is GraphDB
ID:   1
               Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




Edge (           )
                     ID:   2
                     NAME: ITO
                     PROP: Female
                     AGE: 21
What is GraphDB
ID:   1
               Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




Edge (           )
                     ID:   2
                     NAME: ITO
                     PROP: Female
                     AGE: 21
What is GraphDB
ID:   1
               Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




Edge (           )
                     ID:   2
                     NAME: ITO
                     PROP: Female
                     AGE: 21
What is GraphDB
ID:   1
                       Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




 Edge (                  )
                             ID:   2
ID:       3                  NAME: ITO
LABEL:    Like               PROP: Female
Since:    2011/08/06         AGE: 21
OutGoing: 2
What is GraphDB
ID:   1
                       Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




 Edge (                  )
                             ID:   2
ID:       3                  NAME: ITO
LABEL:    Like               PROP: Female
Since:    2011/08/06         AGE: 21
OutGoing: 2
What is GraphDB
ID:   1
                       Vertex (node :       )
NAME: kimura
PROP: Male
AGE: 18




 Edge (                  )
                             ID:   2
ID:       3                  NAME: ITO
LABEL:    Like               PROP: Female
Since:    2011/08/06         AGE: 21
OutGoing: 2
The implementations
   for GraphDB




  http://en.wikipedia.org/wiki/GraphDB
Introduction to Neo4j
GraphDB Neo4j
       •     True ACID transactions
       •     High availability
       •     Scales to billions of nods and relationships
       •     High speed querying through traversals


               Single instance(GPLv3)   Multiple instance(AGPLv3)
Embedded       EmbeddedGraphDatabase    HighlyAvailableGraphDatabase
Standalone     Neo4j Server             Neo4j Server high availability mode


                                                   http://neo4j.org/
Other my favorite features
       for Neo4j
• RESTful APIs
• Query Language(Cypher)
• Full indexing
   – lucene
• Implemented graph algorithm
 – A*, Dijkstra
 – High speed traverse
• Gremlin supported
 – Like a query language

                         http://www.tinkerpop.com/post/4633229547/tinkerpop-graph-stack
Introduction simple Neo4j usecase
           Single node           Multi node
Embedded



           Analyses system       Analyses system




           Analyses system       Analyses system
Server
Introduction simple Neo4j usecase
           Single node           Multi node
Embedded



           Analyses system       Analyses system




           Analyses system       Analyses system
Server
Introduction simple Neo4j usecase
              Single node          Multi node
           Analyses system
Embedded



                                   Analyses system




             Analyses system       Analyses system
Server
Introduction simple Neo4j usecase
              Single node          Multi node
           Analyses system
Embedded



                                   Analyses system




             Analyses system       Analyses system
Server
Introduction to simple
   embedded Neo4j

• Insert Vertices & make Relationships
 • Single node & Embedded
• Traversal sample
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {
        GraphDatabaseService graphDb = new
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {
            tx.finish();
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {
        GraphDatabaseService graphDb = new
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {
            tx.finish();
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {            ID:   1
        GraphDatabaseService graphDb = new                    NAME: kimura
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {
            tx.finish();
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {            ID:   1
        GraphDatabaseService graphDb = new                    NAME: kimura
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {
            tx.finish();
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {            ID:   1
        GraphDatabaseService graphDb = new                    NAME: kimura
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {                                           ID:   2
            tx.finish();                                      NAME: Kato
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {            ID:   1
        GraphDatabaseService graphDb = new                    NAME: kimura
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
            firstNode.setProperty("Name", "Kimura");
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {                                           ID:   2
            tx.finish();                                      NAME: Kato
        }
        graphDb.shutdown();
    }
}
Insert vertices,
                   make relationship
public final class InputVertex {
    public static void main(final String[] args) {                             ID:   1
        GraphDatabaseService graphDb = new                                     NAME: kimura
                       EmbeddedGraphDatabase("/tmp/neo4j");
        Transaction tx = graphDb.beginTx();
        try {
            Node firstNode = graphDb.createNode();
                                                              ID:       3
            firstNode.setProperty("Name", "Kimura");          Relation: Like
            Node secondNode = graphDb.createNode();
            secondNode.setProperty("Name", "Kato");
            firstNode.createRelationshipTo(secondNode,
                 DynamicRelationshipType.withName("LIKE"));
            tx.success();
        } finally {                                                            ID:   2
            tx.finish();                                                       NAME: Kato
        }
        graphDb.shutdown();
    }
}
Batch Insert
     • Non thread safe, non transaction
     • But very fast!
public final class Batch {
    public static void main(final String[] args) {
        BatchInserter inserter = new BatchInserterImpl("/tmp/neo4j",
                BatchInserterImpl.loadProperties("/tmp/neo4j.props"));
        Map<String, Object> prop = new HashMap<String, Object>();
        prop.put("Name", "Kimura");
        prop.put("Age", 21);
        long node1 = inserter.createNode(prop);

        prop.put("Name", "Kato");
        prop.put("Age", 21);
        long node2 = inserter.createNode(prop);
        inserter.createRelationship(node1, node2,
                DynamicRelationshipType.withName("LIKE"), null);
        inserter.shutdown();
    }
}
Traversal sample
    •
public static void main(final String[] args) {
        GraphDatabaseService graphDB = new EmbeddedGraphDatabase(args[0]);
        Node node = graphDB.getNodeById(1);
        Traverser friends = node.traverse(
          //
          Order.DEPTH_FIRST,   BREADTH_FIRST
          //
          StopEvaluator.END_OF_GRAPH,   DEPTH_ONE
          //
          ReturnableEvaluator.ALL_BUT_START_NODE,     ALL, isReturnableNode()
          //
          DynamicRelationshipType.withName("LIKE"),
          //
          Direction.OUTGOING);   INCOMING, BOTH
        for (Node nodeBuf : friends) {
            TraversalPosition currentPosition = friends.currentPosition();
        }
   }
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.BREADTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Traversal sample
    Order.DEPTH_FIRST
•
Neoclipse sample




       http://wiki.neo4j.org/content/Neoclipse
experiment
•   mixi             Neo4j

•
    •   Machine: 24 core CPU, Memory 65GB

    •   Neo4j: BatchInsert, community, embedded

•   Data

    •                1500                    6

                   513m17sec (about 8.6h)
Network Dataset
•   Stanford Large Network Dataset Collection

    •    SNAP has a Wide variety of graph data!
             Social Networks             Communication networks

            Citation networks             Collaboration networks

               Web graphs             Product co-purchasing networks

     Internet peer-to-peer networks           Road networks

        Autonomous systems graphs            Signed networks

    Wikipedia networks and metadata      Memetracker and Twitter


                            http://snap.stanford.edu/data/index.html
Introduction to Analysis
        Sample
Architecture

   Service
                  Database   Analysis   Visualization
(Social Graph)
Introduction Analyses
          Sample


• Centrality (       )

• Clustering coefficient (   )
Centrality (       )

•       =


            Pagerank
•
•   =   Vertex   (   )
•
•   =   Vertex       (   )



    1            1



                 1
•
•   =       Vertex        (   )


              2
    1                 1


        2
                      1
                  2
•
•   =       Vertex        (   )


              2
    1                 1


        2
                      1
                  2
•
•   =       Vertex        (   )


              2
    1                 1
                  4
        2
                      1
                  2
•
•   =       Vertex        (   )


              2
    1                 1
                  4
        2
                      1
                  2
mixi

 •     1000

 •             summary


Min      1st Que. Median     Mean    3rd Que.    Max

1.00          3.00   10.00   25.69    30.00     903.00
•
    •   ≒
•
    •   ≒
            =0/3=0
•
    •   ≒
            =0/3=0


            =1/3
•
    •   ≒
            =0/3=0


            =1/3


            =2/3
•
    •   ≒
            =0/3=0


            =1/3


            =2/3


            =3/3=1
•   1000

•                     summary


Min        1st Que. Median   Mean     3rd Que.   Max

0.00        0.00    0.1157   0.2071    0.2667    1.000
•   25   0.08
•   14   0.17
•   10   0.68
•   4   1
Visualization Sample
•          2hop      Social Graph


•   Edge


    •                              (              )


•   Vertex


    •                       (                 )


•                 Gephi
                          http://gephi.org/
•   Social Graph

    •
•   GraphDB

•   Neo4j

•   R

•   Visualization
Thanks!

More Related Content

Similar to ソーシャルグラフ分析

Better DSL Support for Groovy-Eclipse
Better DSL Support for Groovy-EclipseBetter DSL Support for Groovy-Eclipse
Better DSL Support for Groovy-EclipseAndrew Eisenberg
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Databricks
 
Challenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkChallenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkDatabricks
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengChallenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengDatabricks
 
The InfoGrid Graph DataBase
The InfoGrid Graph DataBaseThe InfoGrid Graph DataBase
The InfoGrid Graph DataBaseInfoGrid.org
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large GraphsNishant Gandhi
 
Odessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and PythonOdessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and PythonMax Klymyshyn
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdbWei-Bo Chen
 
BUILDING WHILE FLYING
BUILDING WHILE FLYINGBUILDING WHILE FLYING
BUILDING WHILE FLYINGKamal Shannak
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Databricks
 
Designing an Objective-C Framework about 3D
Designing an Objective-C Framework about 3DDesigning an Objective-C Framework about 3D
Designing an Objective-C Framework about 3Drsebbe
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoAchim Friedland
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceNeo4j
 
HBaseCon 2015: HBase @ CyberAgent
HBaseCon 2015: HBase @ CyberAgentHBaseCon 2015: HBase @ CyberAgent
HBaseCon 2015: HBase @ CyberAgentHBaseCon
 
Graph technology meetup slides
Graph technology meetup slidesGraph technology meetup slides
Graph technology meetup slidesSean Mulvehill
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingNesreen K. Ahmed
 
MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012Steven Francia
 
Triton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaTriton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaWei-Bo Chen
 
MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview LectureJohn Yates
 

Similar to ソーシャルグラフ分析 (20)

Better DSL Support for Groovy-Eclipse
Better DSL Support for Groovy-EclipseBetter DSL Support for Groovy-Eclipse
Better DSL Support for Groovy-Eclipse
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™
 
Challenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkChallenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache Spark
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengChallenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
 
The InfoGrid Graph DataBase
The InfoGrid Graph DataBaseThe InfoGrid Graph DataBase
The InfoGrid Graph DataBase
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Odessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and PythonOdessapy2013 - Graph databases and Python
Odessapy2013 - Graph databases and Python
 
Triton and symbolic execution on gdb
Triton and symbolic execution on gdbTriton and symbolic execution on gdb
Triton and symbolic execution on gdb
 
BUILDING WHILE FLYING
BUILDING WHILE FLYINGBUILDING WHILE FLYING
BUILDING WHILE FLYING
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™
 
Designing an Objective-C Framework about 3D
Designing an Objective-C Framework about 3DDesigning an Objective-C Framework about 3D
Designing an Objective-C Framework about 3D
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
 
HBaseCon 2015: HBase @ CyberAgent
HBaseCon 2015: HBase @ CyberAgentHBaseCon 2015: HBase @ CyberAgent
HBaseCon 2015: HBase @ CyberAgent
 
Graph technology meetup slides
Graph technology meetup slidesGraph technology meetup slides
Graph technology meetup slides
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Neo4j: Graph-like power
Neo4j: Graph-like powerNeo4j: Graph-like power
Neo4j: Graph-like power
 
MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012MongoDB, Hadoop and humongous data - MongoSV 2012
MongoDB, Hadoop and humongous data - MongoSV 2012
 
Triton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON ChinaTriton and Symbolic execution on GDB@DEF CON China
Triton and Symbolic execution on GDB@DEF CON China
 
MathWorks Interview Lecture
MathWorks Interview LectureMathWorks Interview Lecture
MathWorks Interview Lecture
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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...
 

ソーシャルグラフ分析

  • 1.
  • 2. ( ) • @kimuras • G(2007 ) • • •
  • 3. Agenda • Introduction • The past work • Introduction to GraphDB • Introduction to Neo4j • Introduction to analysis sample
  • 5. Motivation for social graph analysis
  • 6. mixi 30000000 ID 22500000 # of member id 15000000 7500000 0 2007 2008 2009 2010 2011 year
  • 7. What is Social Graph?
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 20. Approach for SG analysis Feed Back
  • 23. Relational Databases Dump & Denormalization from_id to_id id name age Key value 1 2 1 Kimura 18 From:1 2,3 1 3 2 kato 45 From:2 3 2 3 3 ito 21 Prof:1 Kimura,18 Prof:2 Kato,45
  • 24. Relational Databases Dump & reimplementation Denormalization from_id to_id id name age Key value 1 1 2 3 maintenance cost 1 2 Kimura kato 18 45 From:1 From:2 2,3 3 2 3 3 ito 21 Prof:1 Kimuras,18 Prof:2 Kato,45 scalability
  • 27. What is graph Vertex (node : )
  • 28. What is graph Vertex (node : ) Edge ( )
  • 29. What is graph Vertex (node : ) Undirected graph ( ) Edge ( )
  • 30. What is graph Vertex (node : ) Edge ( )
  • 31. What is graph Vertex (node : ) Edge ( )
  • 32. What is graph Vertex (node : ) Edge ( )
  • 33. What is graph Vertex (node : ) Directed graph ( ) Edge ( )
  • 34. What is GraphDB Vertex (node : ) Edge ( )
  • 35. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( )
  • 36. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 37. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 38. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 NAME: ITO PROP: Female AGE: 21
  • 39. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 ID: 3 NAME: ITO LABEL: Like PROP: Female Since: 2011/08/06 AGE: 21 OutGoing: 2
  • 40. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 ID: 3 NAME: ITO LABEL: Like PROP: Female Since: 2011/08/06 AGE: 21 OutGoing: 2
  • 41. What is GraphDB ID: 1 Vertex (node : ) NAME: kimura PROP: Male AGE: 18 Edge ( ) ID: 2 ID: 3 NAME: ITO LABEL: Like PROP: Female Since: 2011/08/06 AGE: 21 OutGoing: 2
  • 42. The implementations for GraphDB http://en.wikipedia.org/wiki/GraphDB
  • 44. GraphDB Neo4j • True ACID transactions • High availability • Scales to billions of nods and relationships • High speed querying through traversals Single instance(GPLv3) Multiple instance(AGPLv3) Embedded EmbeddedGraphDatabase HighlyAvailableGraphDatabase Standalone Neo4j Server Neo4j Server high availability mode http://neo4j.org/
  • 45. Other my favorite features for Neo4j • RESTful APIs • Query Language(Cypher) • Full indexing – lucene • Implemented graph algorithm – A*, Dijkstra – High speed traverse • Gremlin supported – Like a query language http://www.tinkerpop.com/post/4633229547/tinkerpop-graph-stack
  • 46. Introduction simple Neo4j usecase Single node Multi node Embedded Analyses system Analyses system Analyses system Analyses system Server
  • 47. Introduction simple Neo4j usecase Single node Multi node Embedded Analyses system Analyses system Analyses system Analyses system Server
  • 48. Introduction simple Neo4j usecase Single node Multi node Analyses system Embedded Analyses system Analyses system Analyses system Server
  • 49. Introduction simple Neo4j usecase Single node Multi node Analyses system Embedded Analyses system Analyses system Analyses system Server
  • 50. Introduction to simple embedded Neo4j • Insert Vertices & make Relationships • Single node & Embedded • Traversal sample
  • 51. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { GraphDatabaseService graphDb = new EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); } }
  • 52. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { GraphDatabaseService graphDb = new EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); } }
  • 53. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); } }
  • 54. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { tx.finish(); } graphDb.shutdown(); } }
  • 55. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); } }
  • 56. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); firstNode.setProperty("Name", "Kimura"); Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); } }
  • 57. Insert vertices, make relationship public final class InputVertex { public static void main(final String[] args) { ID: 1 GraphDatabaseService graphDb = new NAME: kimura EmbeddedGraphDatabase("/tmp/neo4j"); Transaction tx = graphDb.beginTx(); try { Node firstNode = graphDb.createNode(); ID: 3 firstNode.setProperty("Name", "Kimura"); Relation: Like Node secondNode = graphDb.createNode(); secondNode.setProperty("Name", "Kato"); firstNode.createRelationshipTo(secondNode, DynamicRelationshipType.withName("LIKE")); tx.success(); } finally { ID: 2 tx.finish(); NAME: Kato } graphDb.shutdown(); } }
  • 58. Batch Insert • Non thread safe, non transaction • But very fast! public final class Batch { public static void main(final String[] args) { BatchInserter inserter = new BatchInserterImpl("/tmp/neo4j", BatchInserterImpl.loadProperties("/tmp/neo4j.props")); Map<String, Object> prop = new HashMap<String, Object>(); prop.put("Name", "Kimura"); prop.put("Age", 21); long node1 = inserter.createNode(prop); prop.put("Name", "Kato"); prop.put("Age", 21); long node2 = inserter.createNode(prop); inserter.createRelationship(node1, node2, DynamicRelationshipType.withName("LIKE"), null); inserter.shutdown(); } }
  • 59. Traversal sample • public static void main(final String[] args) { GraphDatabaseService graphDB = new EmbeddedGraphDatabase(args[0]); Node node = graphDB.getNodeById(1); Traverser friends = node.traverse( // Order.DEPTH_FIRST, BREADTH_FIRST // StopEvaluator.END_OF_GRAPH, DEPTH_ONE // ReturnableEvaluator.ALL_BUT_START_NODE, ALL, isReturnableNode() // DynamicRelationshipType.withName("LIKE"), // Direction.OUTGOING); INCOMING, BOTH for (Node nodeBuf : friends) { TraversalPosition currentPosition = friends.currentPosition(); } }
  • 60. Traversal sample Order.BREADTH_FIRST •
  • 61. Traversal sample Order.BREADTH_FIRST •
  • 62. Traversal sample Order.BREADTH_FIRST •
  • 63. Traversal sample Order.BREADTH_FIRST •
  • 64. Traversal sample Order.BREADTH_FIRST •
  • 65. Traversal sample Order.BREADTH_FIRST •
  • 66. Traversal sample Order.DEPTH_FIRST •
  • 67. Traversal sample Order.DEPTH_FIRST •
  • 68. Traversal sample Order.DEPTH_FIRST •
  • 69. Traversal sample Order.DEPTH_FIRST •
  • 70. Traversal sample Order.DEPTH_FIRST •
  • 71. Traversal sample Order.DEPTH_FIRST •
  • 72. Neoclipse sample http://wiki.neo4j.org/content/Neoclipse
  • 73. experiment • mixi Neo4j • • Machine: 24 core CPU, Memory 65GB • Neo4j: BatchInsert, community, embedded • Data • 1500 6 513m17sec (about 8.6h)
  • 74. Network Dataset • Stanford Large Network Dataset Collection • SNAP has a Wide variety of graph data! Social Networks Communication networks Citation networks Collaboration networks Web graphs Product co-purchasing networks Internet peer-to-peer networks Road networks Autonomous systems graphs Signed networks Wikipedia networks and metadata Memetracker and Twitter http://snap.stanford.edu/data/index.html
  • 76. Architecture Service Database Analysis Visualization (Social Graph)
  • 77. Introduction Analyses Sample • Centrality ( ) • Clustering coefficient ( )
  • 78. Centrality ( ) • = Pagerank
  • 79. • • = Vertex ( )
  • 80. • • = Vertex ( ) 1 1 1
  • 81. • • = Vertex ( ) 2 1 1 2 1 2
  • 82. • • = Vertex ( ) 2 1 1 2 1 2
  • 83. • • = Vertex ( ) 2 1 1 4 2 1 2
  • 84. • • = Vertex ( ) 2 1 1 4 2 1 2
  • 85. mixi • 1000 • summary Min 1st Que. Median Mean 3rd Que. Max 1.00 3.00 10.00 25.69 30.00 903.00
  • 86. • ≒
  • 87. • ≒ =0/3=0
  • 88. • ≒ =0/3=0 =1/3
  • 89. • ≒ =0/3=0 =1/3 =2/3
  • 90. • ≒ =0/3=0 =1/3 =2/3 =3/3=1
  • 91. 1000 • summary Min 1st Que. Median Mean 3rd Que. Max 0.00 0.00 0.1157 0.2071 0.2667 1.000
  • 92.
  • 93.
  • 94. 25 0.08
  • 95. 14 0.17
  • 96. 10 0.68
  • 97. 4 1
  • 99. 2hop Social Graph • Edge • ( ) • Vertex • ( ) • Gephi http://gephi.org/
  • 100.
  • 101. Social Graph • • GraphDB • Neo4j • R • Visualization

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. &amp;#x30FB;TC&amp;#x3082;mysql&amp;#x3082;&amp;#x73FE;&amp;#x5F79;&amp;#x3060;&amp;#x3057;&amp;#x3001;&amp;#x5927;&amp;#x597D;&amp;#x304D;\n
  41. &amp;#x30FB;TC&amp;#x3082;mysql&amp;#x3082;&amp;#x73FE;&amp;#x5F79;&amp;#x3060;&amp;#x3057;&amp;#x3001;&amp;#x5927;&amp;#x597D;&amp;#x304D;\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