Let’s graph Github. We will graph the relationships between organizations and their members, between users and their locations, between users and the projects they have starred, and between organizations and their projects. We can use this data to find out interesting things like, where do users cluster, what starred projects do they have in common, or what memberships do they have in common.
This | To | That |
---|---|---|
USER |
STARRED |
PROJECT |
USER |
BELONGS_TO |
ORGANIZATION |
USER |
LOCATED_IN |
LOCATION |
ORGANIZATION |
MAINTAINS |
PROJECT |
CREATE
(o:ORGANIZATION {Login: 'demoorg', Id: 10001, Name: 'Demo Organization', Location: 'Tucson' }),
(m1:USER {Id:20001, Login:'userlogin1', Name:'User 1' }),
(m2:USER {Id:20002, Login:'userlogin2', Name:'User 2' }),
(l:LOCATION {Name: 'Tucson'}),
(p1:PROJECT {Id: 30001, Login:'projectlogin1', Name: 'Project 1' }),
(p2:PROJECT {Id: 30002, Login:'projectlogin2', Name:'Project 2' }),
(m1)-[:MEMBER_OF]->(o),
(m2)-[:MEMBER_OF]->(o),
(m1)-[:LOCATED_IN]->(l),
(m2)-[:LOCATED_IN]->(l),
(m1)-[:STARRED]->(p1),
(m2)-[:STARRED]->(p2),
(o)-[:MAINTAINS]->(p1),
(o)-[:MAINTAINS]->(p2)
Neo4j is easy to get started with. It makes graph analsysis simpler and more powerful at the same time.
Download Neo4j here
Use arrows to whiteboard your graphs and write queries to create the model
Use Neo4j online with GrapheneDB: