SlideShare a Scribd company logo
#whoami 
• Christophe Willemsen 
• Bruges (Belgium) 
• Created Graphgen (graphgen.neoxygen.io) 
! 
! 
! 
! 
• @ Graph Aware
#how-it-started
#github-data-archive 
• Github Events 
• archive available @ http://www.githubarchive.org/ 
• events json files per hour 
• approx. 10k events per hour 
• ! the file in itself is not valid json, all file rows are 
valid json
#event-types 
• CommitCommentEvent 
• CreateEvent 
• DeleteEvent 
• DeploymentEvent 
• DeploymentStatusEvent 
• DownloadEvent 
• FollowEvent 
• ForkEvent 
• ForkApplyEvent 
• GistEvent 
• GollumEvent 
• IssueCommentEvent 
• IssuesEvent 
• MemberEvent 
• PageBuildEvent 
• PublicEvent 
• PullRequestEvent 
• PullRequestReviewCommentEvent 
• PushEvent 
• ReleaseEvent 
• StatusEvent 
• TeamAddEvent 
• WatchEvent
#gh4j 
Github Events importer for Neo4j 
Parse file + build customized Cypher Statements for 
each event + load in Neo4j
#PullRequestEvent 
Payload and informations from the past 
• You get information of the PR 
• You can also build informations about the repo, who is 
owning it for e.g. 
• On which branch 
• Depending of the P.R. Action (open/close/merge), you 
can determine for a close/merge who opened first the PR 
and from which fork it is coming
MERGE (u:User {name:'pixelfreak2005'}) 
CREATE (ev:PullRequestEvent {time:toInt(1401606356) }) 
MERGE (u)-[:DO]->(ev) 
MERGE (pr:PullRequest {html_url:'https://github.com/pixelfreak2005/liqiud_android_packages_apps_Settings/pull/2'}) 
SET pr += { id:toInt(16573622), number:toInt(2), state:'open'} 
MERGE (ev)-[:PR_OPEN]->(pr) 
MERGE (ow:User {name:'pixelfreak2005'}) 
MERGE (or:Repository {id:toInt(20338536), name:'liqiud_android_packages_apps_Settings'}) 
MERGE (or)-[:OWNED_BY]->(ow) 
MERGE (pr)-[:PR_ON_REPO]->(or)
#ForkEvent 
MERGE (u:User {name:'rudymalhi'}) 
CREATE (ev:ForkEvent {time:toInt(1401606379) }) MERGE (u)-[:DO]->(ev) 
CREATE (fork:Fork:Repository {name:'Full-Stack-JS-Nodember'}) 
MERGE (ev)-[:FORK]->(fork)-[:OWNED_BY]->(u) 
MERGE (bro:User {name:'mgenev'}) 
MERGE (br:Repository {id:toInt(15503488), name:'Full-Stack-JS-Nodember'})-[:OWNED_BY]->(bro) 
MERGE (fork)-[:FORK_OF]->(br)
#IssueCommentEvent 
You can check if the issue is related to a P.R. and build the complete P.R. schema 
MERGE (u:User {name:'johanneswilm'}) 
CREATE (ev:IssueCommentEvent {time:toInt(1401606384) }) 
MERGE (u)-[:DO]->(ev) 
MERGE (comment:IssueComment {id:toInt(44769338)}) 
MERGE (ev)-[:ISSUE_COMMENT]->(comment) 
MERGE (issue:Issue {id:toInt(34722578)}) 
MERGE (repo:Repository {id:toInt(14487686)}) 
MERGE (comment)-[:COMMENT_ON]->(issue)-[:ISSUE_ON]->(repo) 
SET repo.name = 'diffDOM' 
MERGE (owner:User {name:'fiduswriter'}) 
MERGE (comment)-[:COMMENT_ON]->(issue)-[:ISSUE_ON]->(repo)-[:OWNED_BY]->(owner)
Let’s have some fun and try some queries 
! 
demo
who did the most events ? 
! 
MATCH (u:User)-[r:DO]->() 
RETURN u.name, count(r) as events 
ORDER BY events DESC 
LIMIT 1
which repo has been the most touched ? 
! 
MATCH (repo:Repository)<-[r]-() 
RETURN repo.name, count(r) as touchs 
ORDER BY touchs DESC 
LIMIT 1
which repo has been the most forked ? 
! 
MATCH (repo:Repository)<-[:FORK_OF]-(fork:Fork)<-[:FORK]- 
(event:ForkEvent) 
RETURN repo.name, count(event) as forks 
ORDER BY forks DESC 
LIMIT 1
which repo has the most merged PRs ? 
! 
MATCH (repo:Repository)<-[:PR_ON_REPO]- 
(pr:PullRequest)<-[merge:PR_MERGE]-() 
RETURN repo.name, count(merge) as merges 
ORDER BY merges DESC 
LIMIT 1
how much forks are resulting in an open PR ? 
! 
MATCH p=(u:User)-[:DO]->(fe:ForkEvent)-[:FORK]->(fork:Fork) 
-[:FORK_OF]->(repo:Repository)<-[:PR_ON_REPO]-(pr:PullRequest) 
-[:PR_OPEN]-(pre:PullRequestEvent)<-[:DO]-(u2:User)<-[:OWNED_BY]- 
(f2:Fork)<-[:BRANCH_OF]-(br:Branch)<-[:FROM_BRANCH]-(pr2:PullRequest) 
WHERE u = u2 AND fork = f2 AND pr = pr2 
RETURN count(p)
Number of comments on a PR before the PR is merged ? 
! 
MATCH p=(ice:IssueCommentEvent)-[:ISSUE_COMMENT]->(comment:IssueComment) 
-[:COMMENT_ON]->(issue:Issue)-[:BOUND_TO_PR]->(pr:PullRequest) 
<-[:PR_MERGE]-(pre:PullRequestEvent) 
WHERE ice.time <= pre.time 
WITH pr, count(comment) as comments 
RETURN avg(comments)
Top contributor ? 
Which user has the most merged PR’s on repositories 
not owned by him 
! 
MATCH (u:User)-[r:DO]->(fe:PullRequestEvent)-[:PR_OPEN]->(pr:PullRequest {state:'merged'}) 
-[:PR_ON_REPO]-(repo:Repository)-[:OWNED_BY]->(u2:User) 
WHERE NOT u = u2 
RETURN u.name, count(r) as prs 
ORDER BY prs DESC 
LIMIT 1
Relate together Users having Merged PR's on same 
repositories, could serve as Follow Recommendations Engine! 
! 
MATCH p=(u:User)-[:DO]-(e:PullRequestEvent)-->(pr:PullRequest {state:'merged'})- 
[:PR_ON_REPO]->(r:Repository)<-[:PR_ON_REPO]-(pr2:PullRequest 
{state:'merged'})--(e2:PullRequestEvent)<-[:DO]-(u2:User) 
WHERE NOT u = u2 
WITH nodes(p) as coll 
WITH head(coll) as st, last(coll) as end 
MERGE (st)-[r:HAVE_WORKED_ON_SAME_REPO]-(end) 
ON MATCH SET r.w = (r.w) + 1 
ON CREATE SET r.w = 1
QUESTIONS ?
• More queries in the gist file : https://gist.github.com/ikwattro/ 
071d36f135131e8e4442 
• Not valid with Github Live API (different payload) 
• zipped db file http://bit.ly/1BaMCy9
THANK YOU 
@ikwattro
avg time between a repo is forked and this fork result in 
an opened PR ? 
! 
MATCH p=(u:User)-[:DO]->(fe:ForkEvent)-[:FORK]->(fork:Fork)-[:FORK_OF] 
->(repo:Repository)<-[:PR_ON_REPO]-(pr:PullRequest)-[:PR_OPEN]- 
(pre:PullRequestEvent) 
<-[:DO]-(u2:User)<-[:OWNED_BY]-(f2:Fork)<-[:BRANCH_OF]-(br:Branch)<- 
[:FROM_BRANCH]-(pr2:PullRequest) 
WHERE u = u2 AND fork = f2 AND pr = pr2 
RETURN count(p), avg(pre.time - fe.time) as offsetTime

More Related Content

What's hot

Gittalk
GittalkGittalk
Gittalk
prtinsley
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
bryanbibat
 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
Tsuyoshi Yamamoto
 
Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commands
th507
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
Lucas Videla
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
Yuriy Senko
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
themystic_ca
 
10 tips for making Bash a sane programming language
10 tips for making Bash a sane programming language10 tips for making Bash a sane programming language
10 tips for making Bash a sane programming language
Yaroslav Tkachenko
 
Asynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
Asynchronous CompletableFuture Presentation by László-Róbert Albert @CrossoverAsynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
Asynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
Crossover Romania
 
Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Nginx3
Nginx3Nginx3
Nginx3
kantohibi
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)
Puppet
 
The async/await concurrency pattern in Golang
The async/await concurrency pattern in GolangThe async/await concurrency pattern in Golang
The async/await concurrency pattern in Golang
Matteo Madeddu
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
Tsuyoshi Yamamoto
 
My Notes from https://www.codeschool.com/courses/git-real
My Notes from  https://www.codeschool.com/courses/git-realMy Notes from  https://www.codeschool.com/courses/git-real
My Notes from https://www.codeschool.com/courses/git-real
Eneldo Serrata
 
Gaelyk
GaelykGaelyk
Git github
Git githubGit github
Git github
Anurag Deb
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
Luciano Mammino
 

What's hot (20)

Gittalk
GittalkGittalk
Gittalk
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
 
Git: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commandsGit: An introduction of plumbing and porcelain commands
Git: An introduction of plumbing and porcelain commands
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
10 tips for making Bash a sane programming language
10 tips for making Bash a sane programming language10 tips for making Bash a sane programming language
10 tips for making Bash a sane programming language
 
Asynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
Asynchronous CompletableFuture Presentation by László-Róbert Albert @CrossoverAsynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
Asynchronous CompletableFuture Presentation by László-Róbert Albert @Crossover
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Nginx3
Nginx3Nginx3
Nginx3
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)
 
The async/await concurrency pattern in Golang
The async/await concurrency pattern in GolangThe async/await concurrency pattern in Golang
The async/await concurrency pattern in Golang
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
 
My Notes from https://www.codeschool.com/courses/git-real
My Notes from  https://www.codeschool.com/courses/git-realMy Notes from  https://www.codeschool.com/courses/git-real
My Notes from https://www.codeschool.com/courses/git-real
 
Gaelyk
GaelykGaelyk
Gaelyk
 
Git github
Git githubGit github
Git github
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
 

Viewers also liked

Graph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with GraphgenGraph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with Graphgen
Christophe Willemsen
 
GMDSS - Practice1
GMDSS - Practice1GMDSS - Practice1
GMDSS - Practice1
Christophe Willemsen
 
Management des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLPManagement des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLP
Christophe Willemsen
 
Neo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected ThingsNeo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected Things
Christophe Willemsen
 
Recommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHPRecommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHP
Christophe Willemsen
 
Graphgen - le générateur de graphes
Graphgen - le générateur de graphesGraphgen - le générateur de graphes
Graphgen - le générateur de graphes
Christophe Willemsen
 
20161020 - Paris - Retour GC
20161020  - Paris - Retour GC20161020  - Paris - Retour GC
20161020 - Paris - Retour GC
Benoît Simard
 
Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16
Christophe Willemsen
 
Moteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareRecoMoteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareReco
Christophe Willemsen
 
Recommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation EngineRecommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation Engine
Christophe Willemsen
 

Viewers also liked (11)

Graph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with GraphgenGraph Database Prototyping made easy with Graphgen
Graph Database Prototyping made easy with Graphgen
 
GMDSS - Practice1
GMDSS - Practice1GMDSS - Practice1
GMDSS - Practice1
 
Management des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLPManagement des issues Github avec Neo4j et NLP
Management des issues Github avec Neo4j et NLP
 
Présentation symfony drupal
Présentation symfony drupalPrésentation symfony drupal
Présentation symfony drupal
 
Neo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected ThingsNeo4j au secours de l'Internet of Connected Things
Neo4j au secours de l'Internet of Connected Things
 
Recommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHPRecommendation Engines with Neo4j, Symfony and Reco4PHP
Recommendation Engines with Neo4j, Symfony and Reco4PHP
 
Graphgen - le générateur de graphes
Graphgen - le générateur de graphesGraphgen - le générateur de graphes
Graphgen - le générateur de graphes
 
20161020 - Paris - Retour GC
20161020  - Paris - Retour GC20161020  - Paris - Retour GC
20161020 - Paris - Retour GC
 
Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16Your own recommendation engine with neo4j and reco4php - DPC16
Your own recommendation engine with neo4j and reco4php - DPC16
 
Moteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareRecoMoteurs de recommendation avec Neo4j et GraphAwareReco
Moteurs de recommendation avec Neo4j et GraphAwareReco
 
Recommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation EngineRecommandations avec Neo4j et le GraphAware Recommendation Engine
Recommandations avec Neo4j et le GraphAware Recommendation Engine
 

Similar to Analysing Github events with Neo4j

Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
Bo-Yi Wu
 
Finding Clojure
Finding ClojureFinding Clojure
Finding Clojure
Matthew McCullough
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
Ladislav Prskavec
 
dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
Flavio Poletti
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
Sumedt Jitpukdebodin
 
Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"
Fwdays
 
ConFoo 2016 - Mum, I want to be a Groovy full-stack developer
ConFoo 2016 - Mum, I want to be a Groovy full-stack developerConFoo 2016 - Mum, I want to be a Groovy full-stack developer
ConFoo 2016 - Mum, I want to be a Groovy full-stack developer
Iván López Martín
 
FrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) SwiftFrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) Swift
Chris Bailey
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Yros
 
groovy & grails - lecture 13
groovy & grails - lecture 13groovy & grails - lecture 13
groovy & grails - lecture 13
Alexandre Masselot
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
GR8Conf
 
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developerGR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
Iván López Martín
 
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developerSpring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Iván López Martín
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
Vincent Terrasi
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
phanhung20
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
Mike Pittaro
 
リローダブルClojureアプリケーション
リローダブルClojureアプリケーションリローダブルClojureアプリケーション
リローダブルClojureアプリケーション
Kenji Nakamura
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
C4Media
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
Ramon Ribeiro Rabello
 
Go Web Development
Go Web DevelopmentGo Web Development
Go Web Development
Cheng-Yi Yu
 

Similar to Analysing Github events with Neo4j (20)

Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Finding Clojure
Finding ClojureFinding Clojure
Finding Clojure
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
 
dotCloud and go
dotCloud and godotCloud and go
dotCloud and go
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"Denys Serhiienko "ASGI in depth"
Denys Serhiienko "ASGI in depth"
 
ConFoo 2016 - Mum, I want to be a Groovy full-stack developer
ConFoo 2016 - Mum, I want to be a Groovy full-stack developerConFoo 2016 - Mum, I want to be a Groovy full-stack developer
ConFoo 2016 - Mum, I want to be a Groovy full-stack developer
 
FrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) SwiftFrenchKit 2017: Server(less) Swift
FrenchKit 2017: Server(less) Swift
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
groovy & grails - lecture 13
groovy & grails - lecture 13groovy & grails - lecture 13
groovy & grails - lecture 13
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developerGR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
GR8Conf 2016 - Mum, I want to be a Groovy full-stack developer
 
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developerSpring I/O 2015 - Mum, I want to be a Groovy full-stack developer
Spring I/O 2015 - Mum, I want to be a Groovy full-stack developer
 
How to automate all your SEO projects
How to automate all your SEO projectsHow to automate all your SEO projects
How to automate all your SEO projects
 
Non stop random2b
Non stop random2bNon stop random2b
Non stop random2b
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
 
リローダブルClojureアプリケーション
リローダブルClojureアプリケーションリローダブルClojureアプリケーション
リローダブルClojureアプリケーション
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
 
Go Web Development
Go Web DevelopmentGo Web Development
Go Web Development
 

Recently uploaded

UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 

Recently uploaded (20)

UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 

Analysing Github events with Neo4j

  • 1.
  • 2. #whoami • Christophe Willemsen • Bruges (Belgium) • Created Graphgen (graphgen.neoxygen.io) ! ! ! ! • @ Graph Aware
  • 4. #github-data-archive • Github Events • archive available @ http://www.githubarchive.org/ • events json files per hour • approx. 10k events per hour • ! the file in itself is not valid json, all file rows are valid json
  • 5. #event-types • CommitCommentEvent • CreateEvent • DeleteEvent • DeploymentEvent • DeploymentStatusEvent • DownloadEvent • FollowEvent • ForkEvent • ForkApplyEvent • GistEvent • GollumEvent • IssueCommentEvent • IssuesEvent • MemberEvent • PageBuildEvent • PublicEvent • PullRequestEvent • PullRequestReviewCommentEvent • PushEvent • ReleaseEvent • StatusEvent • TeamAddEvent • WatchEvent
  • 6. #gh4j Github Events importer for Neo4j Parse file + build customized Cypher Statements for each event + load in Neo4j
  • 7. #PullRequestEvent Payload and informations from the past • You get information of the PR • You can also build informations about the repo, who is owning it for e.g. • On which branch • Depending of the P.R. Action (open/close/merge), you can determine for a close/merge who opened first the PR and from which fork it is coming
  • 8. MERGE (u:User {name:'pixelfreak2005'}) CREATE (ev:PullRequestEvent {time:toInt(1401606356) }) MERGE (u)-[:DO]->(ev) MERGE (pr:PullRequest {html_url:'https://github.com/pixelfreak2005/liqiud_android_packages_apps_Settings/pull/2'}) SET pr += { id:toInt(16573622), number:toInt(2), state:'open'} MERGE (ev)-[:PR_OPEN]->(pr) MERGE (ow:User {name:'pixelfreak2005'}) MERGE (or:Repository {id:toInt(20338536), name:'liqiud_android_packages_apps_Settings'}) MERGE (or)-[:OWNED_BY]->(ow) MERGE (pr)-[:PR_ON_REPO]->(or)
  • 9. #ForkEvent MERGE (u:User {name:'rudymalhi'}) CREATE (ev:ForkEvent {time:toInt(1401606379) }) MERGE (u)-[:DO]->(ev) CREATE (fork:Fork:Repository {name:'Full-Stack-JS-Nodember'}) MERGE (ev)-[:FORK]->(fork)-[:OWNED_BY]->(u) MERGE (bro:User {name:'mgenev'}) MERGE (br:Repository {id:toInt(15503488), name:'Full-Stack-JS-Nodember'})-[:OWNED_BY]->(bro) MERGE (fork)-[:FORK_OF]->(br)
  • 10. #IssueCommentEvent You can check if the issue is related to a P.R. and build the complete P.R. schema MERGE (u:User {name:'johanneswilm'}) CREATE (ev:IssueCommentEvent {time:toInt(1401606384) }) MERGE (u)-[:DO]->(ev) MERGE (comment:IssueComment {id:toInt(44769338)}) MERGE (ev)-[:ISSUE_COMMENT]->(comment) MERGE (issue:Issue {id:toInt(34722578)}) MERGE (repo:Repository {id:toInt(14487686)}) MERGE (comment)-[:COMMENT_ON]->(issue)-[:ISSUE_ON]->(repo) SET repo.name = 'diffDOM' MERGE (owner:User {name:'fiduswriter'}) MERGE (comment)-[:COMMENT_ON]->(issue)-[:ISSUE_ON]->(repo)-[:OWNED_BY]->(owner)
  • 11. Let’s have some fun and try some queries ! demo
  • 12. who did the most events ? ! MATCH (u:User)-[r:DO]->() RETURN u.name, count(r) as events ORDER BY events DESC LIMIT 1
  • 13. which repo has been the most touched ? ! MATCH (repo:Repository)<-[r]-() RETURN repo.name, count(r) as touchs ORDER BY touchs DESC LIMIT 1
  • 14. which repo has been the most forked ? ! MATCH (repo:Repository)<-[:FORK_OF]-(fork:Fork)<-[:FORK]- (event:ForkEvent) RETURN repo.name, count(event) as forks ORDER BY forks DESC LIMIT 1
  • 15. which repo has the most merged PRs ? ! MATCH (repo:Repository)<-[:PR_ON_REPO]- (pr:PullRequest)<-[merge:PR_MERGE]-() RETURN repo.name, count(merge) as merges ORDER BY merges DESC LIMIT 1
  • 16. how much forks are resulting in an open PR ? ! MATCH p=(u:User)-[:DO]->(fe:ForkEvent)-[:FORK]->(fork:Fork) -[:FORK_OF]->(repo:Repository)<-[:PR_ON_REPO]-(pr:PullRequest) -[:PR_OPEN]-(pre:PullRequestEvent)<-[:DO]-(u2:User)<-[:OWNED_BY]- (f2:Fork)<-[:BRANCH_OF]-(br:Branch)<-[:FROM_BRANCH]-(pr2:PullRequest) WHERE u = u2 AND fork = f2 AND pr = pr2 RETURN count(p)
  • 17.
  • 18. Number of comments on a PR before the PR is merged ? ! MATCH p=(ice:IssueCommentEvent)-[:ISSUE_COMMENT]->(comment:IssueComment) -[:COMMENT_ON]->(issue:Issue)-[:BOUND_TO_PR]->(pr:PullRequest) <-[:PR_MERGE]-(pre:PullRequestEvent) WHERE ice.time <= pre.time WITH pr, count(comment) as comments RETURN avg(comments)
  • 19. Top contributor ? Which user has the most merged PR’s on repositories not owned by him ! MATCH (u:User)-[r:DO]->(fe:PullRequestEvent)-[:PR_OPEN]->(pr:PullRequest {state:'merged'}) -[:PR_ON_REPO]-(repo:Repository)-[:OWNED_BY]->(u2:User) WHERE NOT u = u2 RETURN u.name, count(r) as prs ORDER BY prs DESC LIMIT 1
  • 20. Relate together Users having Merged PR's on same repositories, could serve as Follow Recommendations Engine! ! MATCH p=(u:User)-[:DO]-(e:PullRequestEvent)-->(pr:PullRequest {state:'merged'})- [:PR_ON_REPO]->(r:Repository)<-[:PR_ON_REPO]-(pr2:PullRequest {state:'merged'})--(e2:PullRequestEvent)<-[:DO]-(u2:User) WHERE NOT u = u2 WITH nodes(p) as coll WITH head(coll) as st, last(coll) as end MERGE (st)-[r:HAVE_WORKED_ON_SAME_REPO]-(end) ON MATCH SET r.w = (r.w) + 1 ON CREATE SET r.w = 1
  • 22. • More queries in the gist file : https://gist.github.com/ikwattro/ 071d36f135131e8e4442 • Not valid with Github Live API (different payload) • zipped db file http://bit.ly/1BaMCy9
  • 24. avg time between a repo is forked and this fork result in an opened PR ? ! MATCH p=(u:User)-[:DO]->(fe:ForkEvent)-[:FORK]->(fork:Fork)-[:FORK_OF] ->(repo:Repository)<-[:PR_ON_REPO]-(pr:PullRequest)-[:PR_OPEN]- (pre:PullRequestEvent) <-[:DO]-(u2:User)<-[:OWNED_BY]-(f2:Fork)<-[:BRANCH_OF]-(br:Branch)<- [:FROM_BRANCH]-(pr2:PullRequest) WHERE u = u2 AND fork = f2 AND pr = pr2 RETURN count(p), avg(pre.time - fe.time) as offsetTime