Skip to content

Instantly share code, notes, and snippets.

@olgen
Forked from maylim17/gist-of-gists
Last active August 29, 2015 14:25
Show Gist options
  • Save olgen/1e487cddedba410b04f5 to your computer and use it in GitHub Desktop.
Save olgen/1e487cddedba410b04f5 to your computer and use it in GitHub Desktop.
Gist of Gists
= Samantha prototype: Knowledge Graph & Chat-Bot
:author: Eugen Martin
:twitter: @olgen_morten
:tags: domain:graph-database, use-case:knowledge-base
'''
== Introduction
This is an example of a *knowledge graph* built from Git and Trello data. It is currently being used by our *chat-bot* plugin. We explain the Data model below.
== Chat-Bot
image::https://raw.githubusercontent.com/olgen/lita-samantha/master/images/Slack.png[Samantha on Slack]
We have implemented a Chat-Bot-Plugin for the *Lita* chat-bot framework: https://github.com/olgen/lita-samantha
It can answer a predefined set of questions, like "what's happening?", i.e. "What topics have been worked on recently?" or "who is an expert on CSS?", i.e. "Who worked with CSS the most?"
*We would be happy to invite you to our Slack-Team, so you can pet our bot!*
'''
== Knowledge Graph
We compiled this example data set using git-log on our last project and the corresponding Trello-Board.
We used all commits (1.4k) in a repository from our last project and mapped them to git-commits (*GitCommit*), authors (*Person*) and topics (*Topic*). Commits not matching any topics were omitted.
Trello data has been compiled to cards (*TrelloCard*), attachments (*TrelloAttachment*) and members (*Person*).
Topic extraction was done in a very basic way based on whitelist matching and #tags extraction. This needs to be vastly improved in the future.
'''
== Data Set
We compiled an example data set in cypher. You can find the complete Cypher-source in: https://gist.github.com/olgen/1e487cddedba410b04f5
*Please give it some seconds to load...*
//setup
//hide
[source,cypher]
----
//Create :Domain
CREATE (fix:Topic {title:'fix'})
CREATE (trello_card_54db979cc403b27147347a65:TrelloCard {name:'#acquisition: new pricing page'})
CREATE (acquisition:Topic {title:'acquisition'})
CREATE (trello_card_54db979cc403b27147347a65)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_attachment_54db98236f30e8fcdde39ec0:TrelloAttachment {name:'Plans [iPad landscape 1024x690].png', created_at:1423677475})
CREATE (trello_attachment_54db98236f30e8fcdde39ec0)-[:BELONGS_TO {created_at:1423677475}]->(trello_card_54db979cc403b27147347a65)
CREATE (person_bj_rn_schefzyk:Person {name:'Björn Schefzyk'})
CREATE (person_bj_rn_schefzyk)-[:CREATED {created_at:1423677475}]->(trello_attachment_54db98236f30e8fcdde39ec0)
CREATE (trello_card_5527a20dbae39881e3be5000:TrelloCard {name:'#acquisition: download option on sign-up & payment page'})
CREATE (trello_card_5527a20dbae39881e3be5000)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_card_5450b7e8b38eba3a8b7e9347:TrelloCard {name:'#acquisition: gifting'})
CREATE (trello_card_5450b7e8b38eba3a8b7e9347)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_attachment_5466171648d8e6948f790e56:TrelloAttachment {name:'web-iOS_UX_gifting_bs02.pdf', created_at:1415976726})
CREATE (trello_attachment_5466171648d8e6948f790e56)-[:BELONGS_TO {created_at:1415976726}]->(trello_card_5450b7e8b38eba3a8b7e9347)
CREATE (person_bj_rn_schefzyk)-[:CREATED {created_at:1415976726}]->(trello_attachment_5466171648d8e6948f790e56)
CREATE (trello_card_557fe844c61e7fdbfc98dc9a:TrelloCard {name:'#analytics: add full conversion tracking for FB ads'})
CREATE (tracking:Topic {title:'tracking'})
CREATE (trello_card_557fe844c61e7fdbfc98dc9a)-[:HAS_TOPIC ]->(tracking)
CREATE (trello_card_556440409fe4aabc6c21201a:TrelloCard {name:'#tracking: add landing page module view events (again)'})
CREATE (trello_card_556440409fe4aabc6c21201a)-[:HAS_TOPIC ]->(tracking)
CREATE (trello_card_55279bbe1dffd5139d3193a6:TrelloCard {name:'#ads: add google conversion tracking'})
CREATE (trello_card_55279bbe1dffd5139d3193a6)-[:HAS_TOPIC ]->(tracking)
CREATE (trello_card_55279bc937aaa870e38c6b0f:TrelloCard {name:'#ads: add twitter conversion tracking'})
CREATE (trello_card_55279bc937aaa870e38c6b0f)-[:HAS_TOPIC ]->(tracking)
CREATE (trello_card_551532d430ae755b0390f900:TrelloCard {name:'#acquisition: enable A/B testing'})
CREATE (trello_card_551532d430ae755b0390f900)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_card_551ab748922a7d2ad88d71a2:TrelloCard {name:'#tracking: add twitter conversion tracking'})
CREATE (trello_card_551ab748922a7d2ad88d71a2)-[:HAS_TOPIC ]->(tracking)
CREATE (trello_card_551127db15404fcf7193e457:TrelloCard {name:'#acquisition: D2P2 finetuning'})
CREATE (trello_card_551127db15404fcf7193e457)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_card_54f6d8aa63e32eaa6aa8c430:TrelloCard {name:'#acquisition: D2P2'})
CREATE (trello_card_54f6d8aa63e32eaa6aa8c430)-[:HAS_TOPIC ]->(acquisition)
CREATE (trello_attachment_5502f3590c678ec6db7458a9:TrelloAttachment {name:'Plan+Pay [Mobile Portrait].png', created_at:1426256729})
CREATE (trello_attachment_5502f3590c678ec6db7458a9)-[:BELONGS_TO {created_at:1426256729}]->(trello_card_54f6d8aa63e32eaa6aa8c430)
CREATE (person_bj_rn_schefzyk)-[:CREATED {created_at:1426256729}]->(trello_attachment_5502f3590c678ec6db7458a9)
CREATE (trello_attachment_5502f35de35259d69c5010d3:TrelloAttachment {name:'Signup [Mobile Portrait].png', created_at:1426256733})
CREATE (trello_attachment_5502f35de35259d69c5010d3)-[:BELONGS_TO {created_at:1426256733}]->(trello_card_54f6d8aa63e32eaa6aa8c430)
CREATE (person_bj_rn_schefzyk)-[:CREATED {created_at:1426256733}]->(trello_attachment_5502f35de35259d69c5010d3)
CREATE (commit_b44c0e7:GitCommit {title:'remove download-app.scss, cleanup related content', created_at:1431096824})
CREATE (person_eugen_martin:Person {name:'Eugen Martin'})
CREATE (person_eugen_martin)-[:CREATED {created_at:1431096824}]->(commit_b44c0e7)
CREATE (css:Topic {title:'css'})
CREATE (commit_b44c0e7)-[:HAS_TOPIC ]->(css)
CREATE (commit_1a7c30e:GitCommit {title:'remove a couple of js & css resources', created_at:1431096617})
CREATE (person_eugen_martin)-[:CREATED {created_at:1431096617}]->(commit_1a7c30e)
CREATE (js:Topic {title:'js'})
CREATE (commit_1a7c30e)-[:HAS_TOPIC ]->(js)
CREATE (commit_1a7c30e)-[:HAS_TOPIC ]->(css)
CREATE (commit_ab6bc3b:GitCommit {title:'cleanup basic.js, remove holding.js cleanup turbine.js some cleaning on head.thml.haml', created_at:1431095884})
CREATE (person_eugen_martin)-[:CREATED {created_at:1431095884}]->(commit_ab6bc3b)
CREATE (commit_ab6bc3b)-[:HAS_TOPIC ]->(js)
CREATE (commit_cd5611a:GitCommit {title:'remove advanced.js', created_at:1431094981})
CREATE (person_eugen_martin)-[:CREATED {created_at:1431094981}]->(commit_cd5611a)
CREATE (commit_cd5611a)-[:HAS_TOPIC ]->(js)
CREATE (commit_4d7f784:GitCommit {title:'remove landing_page related html & css', created_at:1431010720})
CREATE (person_eugen_martin)-[:CREATED {created_at:1431010720}]->(commit_4d7f784)
CREATE (commit_4d7f784)-[:HAS_TOPIC ]->(css)
CREATE (commit_782b052:GitCommit {title:'Fix Google tracking', created_at:1429635622})
CREATE (person_alejandro_pe_rez_roca:Person {name:'Alejandro Pérez Roca'})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1429635622}]->(commit_782b052)
CREATE (commit_782b052)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_782b052)-[:HAS_TOPIC ]->(fix)
CREATE (commit_e2a059f:GitCommit {title:'Merge branch "feature/conversion-tracking" into staging', created_at:1429623873})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1429623873}]->(commit_e2a059f)
CREATE (commit_e2a059f)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_6f9d187:GitCommit {title:'Add Google conversion tracking', created_at:1429623864})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1429623864}]->(commit_6f9d187)
CREATE (commit_6f9d187)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_b48ea1e:GitCommit {title:'Remove swipeshow from basic js', created_at:1429283402})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1429283402}]->(commit_b48ea1e)
CREATE (commit_b48ea1e)-[:HAS_TOPIC ]->(js)
CREATE (commit_11f5511:GitCommit {title:'Make sure basic.js is compile to inject vars', created_at:1428676803})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428676803}]->(commit_11f5511)
CREATE (commit_11f5511)-[:HAS_TOPIC ]->(js)
CREATE (commit_3b76364:GitCommit {title:'Include slides in hero.js to avoid extra request', created_at:1428590494})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428590494}]->(commit_3b76364)
CREATE (commit_3b76364)-[:HAS_TOPIC ]->(js)
CREATE (commit_d7ab818:GitCommit {title:'Build screenshot section with CSS', created_at:1428576700})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428576700}]->(commit_d7ab818)
CREATE (commit_d7ab818)-[:HAS_TOPIC ]->(css)
CREATE (commit_75e3d2c:GitCommit {title:'Remove basic.js from precompilation for testing', created_at:1428504229})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428504229}]->(commit_75e3d2c)
CREATE (commit_75e3d2c)-[:HAS_TOPIC ]->(js)
CREATE (commit_b700f1c:GitCommit {title:'Remove alternative hero css', created_at:1428502882})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428502882}]->(commit_b700f1c)
CREATE (commit_b700f1c)-[:HAS_TOPIC ]->(css)
CREATE (commit_2ed5c94:GitCommit {title:'Add Twitter conversion tracking', created_at:1428489059})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428489059}]->(commit_2ed5c94)
CREATE (commit_2ed5c94)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_3e9183b:GitCommit {title:'Add Twitter conversion tracking', created_at:1428489059})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1428489059}]->(commit_3e9183b)
CREATE (commit_3e9183b)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_e32a0e0:GitCommit {title:'add /s/:token path - fix advanced.js.erb', created_at:1427108988})
CREATE (person_eugen_martin)-[:CREATED {created_at:1427108988}]->(commit_e32a0e0)
CREATE (commit_e32a0e0)-[:HAS_TOPIC ]->(js)
CREATE (commit_e32a0e0)-[:HAS_TOPIC ]->(fix)
CREATE (commit_02357af:GitCommit {title:'Update tracking and copy', created_at:1425056341})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1425056341}]->(commit_02357af)
CREATE (commit_02357af)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_3c9028f:GitCommit {title:'Remove download event tracking and loading page', created_at:1424184080})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1424184080}]->(commit_3c9028f)
CREATE (commit_3c9028f)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_165fa9f:GitCommit {title:'Send tracking_id to sign up', created_at:1424166996})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1424166996}]->(commit_165fa9f)
CREATE (commit_165fa9f)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_cba82e8:GitCommit {title:'Add tracking for CTA click', created_at:1424094128})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1424094128}]->(commit_cba82e8)
CREATE (commit_cba82e8)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_edec6b8:GitCommit {title:'Fix wrong syntax in bower.json', created_at:1423825227})
CREATE (person_alejandro_pe_rez_roca)-[:CREATED {created_at:1423825227}]->(commit_edec6b8)
CREATE (commit_edec6b8)-[:HAS_TOPIC ]->(js)
CREATE (commit_9505d31:GitCommit {title:'disable assets compression for css', created_at:1414579719})
CREATE (person_eugen_martin)-[:CREATED {created_at:1414579719}]->(commit_9505d31)
CREATE (commit_9505d31)-[:HAS_TOPIC ]->(css)
CREATE (commit_b113260:GitCommit {title:'Fixed the cukes + minor CSS changes', created_at:1412953453})
CREATE (person_will_madden:Person {name:'Will Madden'})
CREATE (person_will_madden)-[:CREATED {created_at:1412953453}]->(commit_b113260)
CREATE (commit_b113260)-[:HAS_TOPIC ]->(css)
CREATE (commit_99433ec:GitCommit {title:'Fixed some more download page CSS', created_at:1412691603})
CREATE (person_will_madden)-[:CREATED {created_at:1412691603}]->(commit_99433ec)
CREATE (commit_99433ec)-[:HAS_TOPIC ]->(css)
CREATE (commit_0626e80:GitCommit {title:'Made app insensitive to tracking failures', created_at:1412690954})
CREATE (person_will_madden)-[:CREATED {created_at:1412690954}]->(commit_0626e80)
CREATE (commit_0626e80)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_784c46c:GitCommit {title:'Fixed some CSS bugs', created_at:1412690447})
CREATE (person_will_madden)-[:CREATED {created_at:1412690447}]->(commit_784c46c)
CREATE (commit_784c46c)-[:HAS_TOPIC ]->(css)
CREATE (commit_69067c8:GitCommit {title:'Minor CSS change', created_at:1412687921})
CREATE (person_will_madden)-[:CREATED {created_at:1412687921}]->(commit_69067c8)
CREATE (commit_69067c8)-[:HAS_TOPIC ]->(css)
CREATE (commit_96bac43:GitCommit {title:'Fixed a bug in the landing page JS', created_at:1412687860})
CREATE (person_will_madden)-[:CREATED {created_at:1412687860}]->(commit_96bac43)
CREATE (commit_96bac43)-[:HAS_TOPIC ]->(js)
CREATE (commit_7aeb9e4:GitCommit {title:'Refactored App.trackingParams and optimizely method into the trackers', created_at:1412682497})
CREATE (person_will_madden)-[:CREATED {created_at:1412682497}]->(commit_7aeb9e4)
CREATE (commit_7aeb9e4)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_23d813b:GitCommit {title:'Deleted onboarding.js', created_at:1412682142})
CREATE (person_will_madden)-[:CREATED {created_at:1412682142}]->(commit_23d813b)
CREATE (commit_23d813b)-[:HAS_TOPIC ]->(js)
CREATE (commit_6f9e43b:GitCommit {title:'Set up new tracker in advanced.js manifest', created_at:1412610875})
CREATE (person_will_madden)-[:CREATED {created_at:1412610875}]->(commit_6f9e43b)
CREATE (commit_6f9e43b)-[:HAS_TOPIC ]->(js)
CREATE (commit_cc15e5a:GitCommit {title:'Renamed “main.js” -> “advanced.js” yeeeeeah', created_at:1412258321})
CREATE (person_will_madden)-[:CREATED {created_at:1412258321}]->(commit_cc15e5a)
CREATE (commit_cc15e5a)-[:HAS_TOPIC ]->(js)
CREATE (commit_c27a6d2:GitCommit {title:'Deleted some tracking for Optimizely', created_at:1412258273})
CREATE (person_will_madden)-[:CREATED {created_at:1412258273}]->(commit_c27a6d2)
CREATE (commit_c27a6d2)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_95f1722:GitCommit {title:'Added FB download tracking pixel', created_at:1411736323})
CREATE (person_will_madden)-[:CREATED {created_at:1411736323}]->(commit_95f1722)
CREATE (commit_95f1722)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_8b6ddef:GitCommit {title:'Added tracking to download page', created_at:1410278171})
CREATE (person_will_madden)-[:CREATED {created_at:1410278171}]->(commit_8b6ddef)
CREATE (commit_8b6ddef)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_4631886:GitCommit {title:'Made DownloadAppView propagate tracking params', created_at:1410180305})
CREATE (person_will_madden)-[:CREATED {created_at:1410180305}]->(commit_4631886)
CREATE (commit_4631886)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_7e2e848:GitCommit {title:'Removed explosion on multiple inclusion of App.js', created_at:1410166891})
CREATE (person_will_madden)-[:CREATED {created_at:1410166891}]->(commit_7e2e848)
CREATE (commit_7e2e848)-[:HAS_TOPIC ]->(js)
CREATE (commit_d71b1a7:GitCommit {title:'Added machine dependency to bower.json', created_at:1409908705})
CREATE (person_will_madden)-[:CREATED {created_at:1409908705}]->(commit_d71b1a7)
CREATE (commit_d71b1a7)-[:HAS_TOPIC ]->(js)
CREATE (commit_6351eb0:GitCommit {title:'Made the DownloadAppView alter its CSS class based on its state', created_at:1409845076})
CREATE (person_will_madden)-[:CREATED {created_at:1409845076}]->(commit_6351eb0)
CREATE (commit_6351eb0)-[:HAS_TOPIC ]->(css)
CREATE (commit_b316002:GitCommit {title:'Added Turbine.onboarding.country_check to the JS Turbine client', created_at:1409833692})
CREATE (person_will_madden)-[:CREATED {created_at:1409833692}]->(commit_b316002)
CREATE (commit_b316002)-[:HAS_TOPIC ]->(js)
CREATE (commit_bcc2117:GitCommit {title:'Added a JS implementation of Interactors and Organisers', created_at:1409830485})
CREATE (person_will_madden)-[:CREATED {created_at:1409830485}]->(commit_bcc2117)
CREATE (commit_bcc2117)-[:HAS_TOPIC ]->(js)
CREATE (commit_b5aba49:GitCommit {title:'Replaced another crappy CSS selector', created_at:1409327114})
CREATE (person_will_madden)-[:CREATED {created_at:1409327114}]->(commit_b5aba49)
CREATE (commit_b5aba49)-[:HAS_TOPIC ]->(css)
CREATE (commit_74af862:GitCommit {title:'Added Optimizely tracking for successfully requesting an invite', created_at:1409231431})
CREATE (person_will_madden)-[:CREATED {created_at:1409231431}]->(commit_74af862)
CREATE (commit_74af862)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_1bea81e:GitCommit {title:'Added a node version requirement to package.json', created_at:1409144688})
CREATE (person_will_madden)-[:CREATED {created_at:1409144688}]->(commit_1bea81e)
CREATE (commit_1bea81e)-[:HAS_TOPIC ]->(js)
CREATE (commit_efd040e:GitCommit {title:'Added selenium-standalone to package.json', created_at:1408368341})
CREATE (person_will_madden)-[:CREATED {created_at:1408368341}]->(commit_efd040e)
CREATE (commit_efd040e)-[:HAS_TOPIC ]->(js)
CREATE (commit_ac605a3:GitCommit {title:'Changed bower.json to use git:// for our fork of Espi-Modules', created_at:1408022604})
CREATE (person_will_madden)-[:CREATED {created_at:1408022604}]->(commit_ac605a3)
CREATE (commit_ac605a3)-[:HAS_TOPIC ]->(js)
CREATE (commit_91b27e3:GitCommit {title:'Rewrote header CSS to fix a bug and be generally more maintainable', created_at:1408021763})
CREATE (person_will_madden)-[:CREATED {created_at:1408021763}]->(commit_91b27e3)
CREATE (commit_91b27e3)-[:HAS_TOPIC ]->(fix)
CREATE (commit_91b27e3)-[:HAS_TOPIC ]->(css)
CREATE (commit_7ab5aa8:GitCommit {title:'Made the modal JS trigger an event on the element that triggers the modal', created_at:1408103872})
CREATE (person_will_madden)-[:CREATED {created_at:1408103872}]->(commit_7ab5aa8)
CREATE (commit_7ab5aa8)-[:HAS_TOPIC ]->(js)
CREATE (commit_923b700:GitCommit {title:'A bunch of tiny CSS changes', created_at:1407773998})
CREATE (person_will_madden)-[:CREATED {created_at:1407773998}]->(commit_923b700)
CREATE (commit_923b700)-[:HAS_TOPIC ]->(css)
CREATE (commit_0ac00b2:GitCommit {title:'Tweaks to the hero module CSS with Frauke', created_at:1407254668})
CREATE (person_will_madden)-[:CREATED {created_at:1407254668}]->(commit_0ac00b2)
CREATE (commit_0ac00b2)-[:HAS_TOPIC ]->(css)
CREATE (commit_dd3272e:GitCommit {title:'update core - fix tracking issue with "token" property - minor logging changes', created_at:1407162675})
CREATE (person_eugen_martin)-[:CREATED {created_at:1407162675}]->(commit_dd3272e)
CREATE (commit_dd3272e)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_dd3272e)-[:HAS_TOPIC ]->(fix)
CREATE (commit_bf57c32:GitCommit {title:'Added tracking_id to request invite form', created_at:1406887309})
CREATE (person_will_madden)-[:CREATED {created_at:1406887309}]->(commit_bf57c32)
CREATE (commit_bf57c32)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_6470b51:GitCommit {title:'Deleted collections (mosaic) loading JS', created_at:1406815271})
CREATE (person_will_madden)-[:CREATED {created_at:1406815271}]->(commit_6470b51)
CREATE (commit_6470b51)-[:HAS_TOPIC ]->(js)
CREATE (commit_e3fd73c:GitCommit {title:'Fixed some landing page CSS on iPads', created_at:1406741752})
CREATE (commit_e3fd73c)-[:HAS_TOPIC ]->(fix)
CREATE (person_will_madden)-[:CREATED {created_at:1406741752}]->(commit_e3fd73c)
CREATE (commit_e3fd73c)-[:HAS_TOPIC ]->(css)
CREATE (commit_c09b3db:GitCommit {title:'Fixed a bunch of little CSS problems on different devices', created_at:1406738718})
CREATE (person_will_madden)-[:CREATED {created_at:1406738718}]->(commit_c09b3db)
CREATE (commit_c09b3db)-[:HAS_TOPIC ]->(css)
CREATE (commit_f5d7feb:GitCommit {title:'Moved the fittext invocation into the hero JS initializer', created_at:1406729370})
CREATE (person_will_madden)-[:CREATED {created_at:1406729370}]->(commit_f5d7feb)
CREATE (commit_f5d7feb)-[:HAS_TOPIC ]->(js)
CREATE (commit_d3b2dac:GitCommit {title:'Removed testing CSS', created_at:1406706842})
CREATE (person_will_madden)-[:CREATED {created_at:1406706842}]->(commit_d3b2dac)
CREATE (commit_d3b2dac)-[:HAS_TOPIC ]->(css)
CREATE (commit_7230bab:GitCommit {title:'Updated some copy, fixed some errors in the dummy hero JSON :’(', created_at:1406125135})
CREATE (person_will_madden)-[:CREATED {created_at:1406125135}]->(commit_7230bab)
CREATE (commit_7230bab)-[:HAS_TOPIC ]->(js)
CREATE (commit_839acab:GitCommit {title:'Refactored hero CSS a bit', created_at:1406124981})
CREATE (person_will_madden)-[:CREATED {created_at:1406124981}]->(commit_839acab)
CREATE (commit_839acab)-[:HAS_TOPIC ]->(css)
CREATE (commit_bf1ff99:GitCommit {title:'Removed selectors from hero JS', created_at:1406124665})
CREATE (person_will_madden)-[:CREATED {created_at:1406124665}]->(commit_bf1ff99)
CREATE (commit_bf1ff99)-[:HAS_TOPIC ]->(js)
CREATE (commit_c3f0ff8:GitCommit {title:'Tweaked the hero CSS a ton', created_at:1406121013})
CREATE (person_will_madden)-[:CREATED {created_at:1406121013}]->(commit_c3f0ff8)
CREATE (commit_c3f0ff8)-[:HAS_TOPIC ]->(css)
CREATE (commit_0a8f275:GitCommit {title:'Fixed some bugs in hero.js', created_at:1406120996})
CREATE (person_will_madden)-[:CREATED {created_at:1406120996}]->(commit_0a8f275)
CREATE (commit_0a8f275)-[:HAS_TOPIC ]->(js)
CREATE (commit_7410304:GitCommit {title:'Removed initial AJAX call from Hero JS', created_at:1405945234})
CREATE (person_will_madden)-[:CREATED {created_at:1405945234}]->(commit_7410304)
CREATE (commit_7410304)-[:HAS_TOPIC ]->(js)
CREATE (commit_8188157:GitCommit {title:'Refactored Hero JS to store its state on its instance instead of a global variable', created_at:1405944260})
CREATE (person_will_madden)-[:CREATED {created_at:1405944260}]->(commit_8188157)
CREATE (commit_8188157)-[:HAS_TOPIC ]->(js)
CREATE (commit_488f68d:GitCommit {title:'Changed the hero JS to accept its element as an argument', created_at:1405942746})
CREATE (person_will_madden)-[:CREATED {created_at:1405942746}]->(commit_488f68d)
CREATE (commit_488f68d)-[:HAS_TOPIC ]->(js)
CREATE (commit_49ebf87:GitCommit {title:'Extracted rgbaster out of jquery.adaptive-backgrounds.js and added error handling', created_at:1406301871})
CREATE (person_will_madden)-[:CREATED {created_at:1406301871}]->(commit_49ebf87)
CREATE (commit_49ebf87)-[:HAS_TOPIC ]->(js)
CREATE (commit_341d20d:GitCommit {title:'Stripped unused CSS classes', created_at:1405425042})
CREATE (person_will_madden)-[:CREATED {created_at:1405425042}]->(commit_341d20d)
CREATE (commit_341d20d)-[:HAS_TOPIC ]->(css)
CREATE (commit_973ec79:GitCommit {title:'Somehow failed to commit the change-password-form.js file', created_at:1405422857})
CREATE (person_will_madden)-[:CREATED {created_at:1405422857}]->(commit_973ec79)
CREATE (commit_973ec79)-[:HAS_TOPIC ]->(js)
CREATE (commit_0547ac8:GitCommit {title:'Fixed a bug in main.js.erb', created_at:1405416234})
CREATE (person_will_madden)-[:CREATED {created_at:1405416234}]->(commit_0547ac8)
CREATE (commit_0547ac8)-[:HAS_TOPIC ]->(js)
CREATE (commit_1cb9b8d:GitCommit {title:'Added ES6 promise polyfill to JS specs', created_at:1405412484})
CREATE (person_will_madden)-[:CREATED {created_at:1405412484}]->(commit_1cb9b8d)
CREATE (commit_1cb9b8d)-[:HAS_TOPIC ]->(js)
CREATE (commit_4c58786:GitCommit {title:'Installed the ChangePasswordForm PO in ESPI’s main.js', created_at:1404834087})
CREATE (person_will_madden)-[:CREATED {created_at:1404834087}]->(commit_4c58786)
CREATE (commit_4c58786)-[:HAS_TOPIC ]->(js)
CREATE (commit_cd05ccc:GitCommit {title:'Added the JS PasswordRecoveryPage (Page Object)', created_at:1404824325})
CREATE (person_will_madden)-[:CREATED {created_at:1404824325}]->(commit_cd05ccc)
CREATE (commit_cd05ccc)-[:HAS_TOPIC ]->(js)
CREATE (commit_9c9b662:GitCommit {title:'Merge pull request #9 from blloon/js-email-confirmation', created_at:1405008452})
CREATE (person_will_madden)-[:CREATED {created_at:1405008452}]->(commit_9c9b662)
CREATE (commit_9c9b662)-[:HAS_TOPIC ]->(js)
CREATE (commit_8baa98e:GitCommit {title:'Initialized a Turbine JS client in main.js', created_at:1404997099})
CREATE (person_will_madden)-[:CREATED {created_at:1404997099}]->(commit_8baa98e)
CREATE (commit_8baa98e)-[:HAS_TOPIC ]->(js)
CREATE (commit_8ef1c6f:GitCommit {title:'Added Turbine JS client', created_at:1404996811})
CREATE (person_will_madden)-[:CREATED {created_at:1404996811}]->(commit_8ef1c6f)
CREATE (commit_8ef1c6f)-[:HAS_TOPIC ]->(js)
CREATE (commit_2250d61:GitCommit {title:'Implemented EmailConfirmationPage JS component', created_at:1404984896})
CREATE (person_will_madden)-[:CREATED {created_at:1404984896}]->(commit_2250d61)
CREATE (commit_2250d61)-[:HAS_TOPIC ]->(js)
CREATE (commit_73983ec:GitCommit {title:'Refactored modules/App.js to be safe to include', created_at:1404824069})
CREATE (person_will_madden)-[:CREATED {created_at:1404824069}]->(commit_73983ec)
CREATE (commit_73983ec)-[:HAS_TOPIC ]->(js)
CREATE (commit_8b5882e:GitCommit {title:'Fixed method definition in TurbineClient (JS)', created_at:1404914052})
CREATE (person_will_madden)-[:CREATED {created_at:1404914052}]->(commit_8b5882e)
CREATE (commit_8b5882e)-[:HAS_TOPIC ]->(js)
CREATE (commit_85ad81a:GitCommit {title:'Improved error handling in Turbine JS client', created_at:1404310984})
CREATE (person_will_madden)-[:CREATED {created_at:1404310984}]->(commit_85ad81a)
CREATE (commit_85ad81a)-[:HAS_TOPIC ]->(js)
CREATE (commit_9d1033d:GitCommit {title:'update core - update rails to 4.1.3 due to: https://groups.google.com/forum/#!topic/rubyonrails-security/wDxePLJGZdI', created_at:1404387268})
CREATE (person_eugen_martin)-[:CREATED {created_at:1404387268}]->(commit_9d1033d)
CREATE (ruby:Topic {title:'ruby'})
CREATE (commit_9d1033d)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_2a5169b:GitCommit {title:'Implemented a simple Turbine JS client', created_at:1404140272})
CREATE (person_will_madden)-[:CREATED {created_at:1404140272}]->(commit_2a5169b)
CREATE (commit_2a5169b)-[:HAS_TOPIC ]->(js)
CREATE (commit_360a019:GitCommit {title:'Started working on Turbine JS client', created_at:1403868968})
CREATE (person_will_madden)-[:CREATED {created_at:1403868968}]->(commit_360a019)
CREATE (commit_360a019)-[:HAS_TOPIC ]->(js)
CREATE (commit_6901650:GitCommit {title:'Added Cucumber.js', created_at:1403787416})
CREATE (person_will_madden)-[:CREATED {created_at:1403787416}]->(commit_6901650)
CREATE (commit_6901650)-[:HAS_TOPIC ]->(js)
CREATE (commit_8f237e6:GitCommit {title:'Upgraded Ruby to 2.1.2', created_at:1403528590})
CREATE (person_will_madden)-[:CREATED {created_at:1403528590}]->(commit_8f237e6)
CREATE (commit_8f237e6)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_f9f5505:GitCommit {title:'Updated Ruby to 2.1.2', created_at:1403335684})
CREATE (person_will_madden)-[:CREATED {created_at:1403335684}]->(commit_f9f5505)
CREATE (commit_f9f5505)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_5ea0ee5:GitCommit {title:'Brackets fixes js', created_at:1403012284})
CREATE (person_charles_axel_pauwels:Person {name:'Charles-Axel Pauwels'})
CREATE (person_charles_axel_pauwels)-[:CREATED {created_at:1403012284}]->(commit_5ea0ee5)
CREATE (commit_5ea0ee5)-[:HAS_TOPIC ]->(js)
CREATE (commit_667f8a9:GitCommit {title:'Fix JS', created_at:1403010984})
CREATE (person_matt_berridge:Person {name:'Matt Berridge'})
CREATE (person_matt_berridge)-[:CREATED {created_at:1403010984}]->(commit_667f8a9)
CREATE (commit_667f8a9)-[:HAS_TOPIC ]->(js)
CREATE (commit_667f8a9)-[:HAS_TOPIC ]->(fix)
CREATE (commit_1cfadc8:GitCommit {title:'Cc form JS', created_at:1403005549})
CREATE (person_matt_berridge)-[:CREATED {created_at:1403005549}]->(commit_1cfadc8)
CREATE (commit_1cfadc8)-[:HAS_TOPIC ]->(js)
CREATE (commit_a27e82b:GitCommit {title:'Fix no js view', created_at:1403005478})
CREATE (person_matt_berridge)-[:CREATED {created_at:1403005478}]->(commit_a27e82b)
CREATE (commit_a27e82b)-[:HAS_TOPIC ]->(js)
CREATE (commit_a27e82b)-[:HAS_TOPIC ]->(fix)
CREATE (commit_cd271e6:GitCommit {title:'Credit card form js tweaks', created_at:1403003812})
CREATE (person_matt_berridge)-[:CREATED {created_at:1403003812}]->(commit_cd271e6)
CREATE (commit_cd271e6)-[:HAS_TOPIC ]->(js)
CREATE (commit_ee2403a:GitCommit {title:'Add some global app.js classes', created_at:1403003278})
CREATE (person_matt_berridge)-[:CREATED {created_at:1403003278}]->(commit_ee2403a)
CREATE (commit_ee2403a)-[:HAS_TOPIC ]->(js)
CREATE (commit_de89458:GitCommit {title:'Add css animating out flash message', created_at:1402998013})
CREATE (person_matt_berridge)-[:CREATED {created_at:1402998013}]->(commit_de89458)
CREATE (commit_de89458)-[:HAS_TOPIC ]->(css)
CREATE (commit_36a49bd:GitCommit {title:'fix j().to_s problem in two js.erb files', created_at:1402919208})
CREATE (person_eugen_martin)-[:CREATED {created_at:1402919208}]->(commit_36a49bd)
CREATE (commit_36a49bd)-[:HAS_TOPIC ]->(js)
CREATE (commit_efe6345:GitCommit {title:'Add tabbed navigation JS', created_at:1402854408})
CREATE (person_matt_berridge)-[:CREATED {created_at:1402854408}]->(commit_efe6345)
CREATE (commit_efe6345)-[:HAS_TOPIC ]->(js)
CREATE (commit_8cfbecf:GitCommit {title:'Fix IE9 JS for modals', created_at:1402518263})
CREATE (person_matt_berridge)-[:CREATED {created_at:1402518263}]->(commit_8cfbecf)
CREATE (commit_8cfbecf)-[:HAS_TOPIC ]->(js)
CREATE (commit_c48c4f7:GitCommit {title:'Fix some IE9 js issues', created_at:1402514367})
CREATE (person_matt_berridge)-[:CREATED {created_at:1402514367}]->(commit_c48c4f7)
CREATE (commit_c48c4f7)-[:HAS_TOPIC ]->(js)
CREATE (commit_d1bbe91:GitCommit {title:'No-js fallbacks', created_at:1402055676})
CREATE (person_matt_berridge)-[:CREATED {created_at:1402055676}]->(commit_d1bbe91)
CREATE (commit_d1bbe91)-[:HAS_TOPIC ]->(js)
CREATE (commit_046ac29:GitCommit {title:'Remove all selectors for body and html in JS', created_at:1401964333})
CREATE (person_matt_berridge)-[:CREATED {created_at:1401964333}]->(commit_046ac29)
CREATE (commit_046ac29)-[:HAS_TOPIC ]->(js)
CREATE (commit_bb06a6e:GitCommit {title:'Refactor forms css slightly for clarity', created_at:1401784925})
CREATE (person_matt_berridge)-[:CREATED {created_at:1401784925}]->(commit_bb06a6e)
CREATE (commit_bb06a6e)-[:HAS_TOPIC ]->(css)
CREATE (commit_bf6c6d1:GitCommit {title:'Merge branch "build-homepage", remote-tracking branch "origin" into develop', created_at:1401697124})
CREATE (person_matt_berridge)-[:CREATED {created_at:1401697124}]->(commit_bf6c6d1)
CREATE (commit_bf6c6d1)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_6867a19:GitCommit {title:'Add JSON feed for hero and integrate', created_at:1401204418})
CREATE (person_matt_berridge)-[:CREATED {created_at:1401204418}]->(commit_6867a19)
CREATE (commit_6867a19)-[:HAS_TOPIC ]->(js)
CREATE (commit_6e61842:GitCommit {title:'Complete JS logic for freemium module/slider', created_at:1400600254})
CREATE (person_matt_berridge)-[:CREATED {created_at:1400600254}]->(commit_6e61842)
CREATE (commit_6e61842)-[:HAS_TOPIC ]->(js)
CREATE (commit_c3d7f00:GitCommit {title:'Get popup functionally working with JS and CSS transitions', created_at:1400248849})
CREATE (person_matt_berridge)-[:CREATED {created_at:1400248849}]->(commit_c3d7f00)
CREATE (commit_c3d7f00)-[:HAS_TOPIC ]->(js)
CREATE (commit_c3d7f00)-[:HAS_TOPIC ]->(css)
CREATE (commit_3ba1e65:GitCommit {title:'activate tracking for holding and all other sites', created_at:1396897642})
CREATE (person_eugen_martin)-[:CREATED {created_at:1396897642}]->(commit_3ba1e65)
CREATE (commit_3ba1e65)-[:HAS_TOPIC ]->(tracking)
CREATE (commit_956ddad:GitCommit {title:'Add resize JS for width / height test', created_at:1396601759})
CREATE (person_matt_berridge)-[:CREATED {created_at:1396601759}]->(commit_956ddad)
CREATE (commit_956ddad)-[:HAS_TOPIC ]->(js)
CREATE (commit_a038063:GitCommit {title:'Fix JS when nav doesn"t exists', created_at:1395674035})
CREATE (person_matt_berridge)-[:CREATED {created_at:1395674035}]->(commit_a038063)
CREATE (commit_a038063)-[:HAS_TOPIC ]->(js)
CREATE (commit_dfe2eb8:GitCommit {title:'Add navigation script and UA parsing via app.js', created_at:1394632476})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394632476}]->(commit_dfe2eb8)
CREATE (commit_dfe2eb8)-[:HAS_TOPIC ]->(js)
CREATE (commit_54f2016:GitCommit {title:'Update Json', created_at:1394443566})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394443566}]->(commit_54f2016)
CREATE (commit_54f2016)-[:HAS_TOPIC ]->(js)
CREATE (commit_b07292a:GitCommit {title:'Add js linting and clean up JS', created_at:1394204059})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394204059}]->(commit_b07292a)
CREATE (commit_b07292a)-[:HAS_TOPIC ]->(js)
CREATE (commit_7790979:GitCommit {title:'Remove RequireJS', created_at:1394040779})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394040779}]->(commit_7790979)
CREATE (commit_7790979)-[:HAS_TOPIC ]->(js)
CREATE (commit_fc9b0ff:GitCommit {title:'Edit application js config', created_at:1394027745})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394027745}]->(commit_fc9b0ff)
CREATE (commit_fc9b0ff)-[:HAS_TOPIC ]->(js)
CREATE (commit_8057808:GitCommit {title:'Require JS include working with precompilation', created_at:1394015106})
CREATE (person_matt_berridge)-[:CREATED {created_at:1394015106}]->(commit_8057808)
CREATE (commit_8057808)-[:HAS_TOPIC ]->(js)
CREATE (commit_8d9e0bb:GitCommit {title:'Add Require JS to project', created_at:1393844495})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393844495}]->(commit_8d9e0bb)
CREATE (commit_8d9e0bb)-[:HAS_TOPIC ]->(js)
CREATE (commit_1b9d9a2:GitCommit {title:'Add Grunt and use for Modernizr JS', created_at:1393513901})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393513901}]->(commit_1b9d9a2)
CREATE (commit_1b9d9a2)-[:HAS_TOPIC ]->(js)
CREATE (commit_ea562aa:GitCommit {title:'Add guardfile and basic sass/js scaffold', created_at:1393505718})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393505718}]->(commit_ea562aa)
CREATE (commit_ea562aa)-[:HAS_TOPIC ]->(js)
CREATE (commit_f1fce32:GitCommit {title:'Add guardfile and basic sass/js scaffold', created_at:1393505710})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393505710}]->(commit_f1fce32)
CREATE (commit_f1fce32)-[:HAS_TOPIC ]->(js)
CREATE (commit_9dd0a13:GitCommit {title:'Change to ruby gemset and version files', created_at:1393493324})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393493324}]->(commit_9dd0a13)
CREATE (commit_9dd0a13)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_315bdd5:GitCommit {title:'Change to ruby gemset and version files', created_at:1393493214})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393493214}]->(commit_315bdd5)
CREATE (commit_315bdd5)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_444fdfb:GitCommit {title:'Switch to ruby version and gemset over rvmrc', created_at:1393428742})
CREATE (person_matt_berridge)-[:CREATED {created_at:1393428742}]->(commit_444fdfb)
CREATE (commit_444fdfb)-[:HAS_TOPIC ]->(ruby)
CREATE (commit_9bc3c7c:GitCommit {title:'upgrade ruby to 2.1.1', created_at:1393428355})
CREATE (person_eugen_martin)-[:CREATED {created_at:1393428355}]->(commit_9bc3c7c)
CREATE (commit_9bc3c7c)-[:HAS_TOPIC ]->(ruby)
RETURN *
----
//graph
'''
== Example Problems & Solutions
==== (a) "Who's an expert on JS?"
Who worked the most with JavaScript?
The query traverses the Knowledge Graph to find connections between People and Topics.
This query doesn't need to know what a *thing* is - it could be any working contribution, which has a topic.
[source,cypher]
----
MATCH (person:Person)-->(thing)-[:HAS_TOPIC]->(topic:Topic)
WHERE topic.title= 'js'
RETURN person.name, topic.title, count(thing) as score
ORDER BY score DESC
----
//output
//table
==== (b) "What's happening?"
What topics have been worked on recently?
[source,cypher]
----
MATCH (thing)-[:HAS_TOPIC]->(topic:Topic)
WHERE thing.created_at > 1420147328 AND thing.created_at < 1438009750
RETURN topic.title, count(thing) as score
ORDER BY score DESC
----
//output
//table
==== (c) "Where are we having most bugs?"
What topics have the highest correlation with 'fix'?
[source,cypher]
----
MATCH (topic:Topic)<-[:HAS_TOPIC]-(thing)-[:HAS_TOPIC]->(other_topic:Topic)
WHERE topic.title = 'fix'
RETURN other_topic.title, count(thing) as score
ORDER BY score DESC
LIMIT 10
----
//output
//table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment