Introducing myself using a Graph
I was looking for an easy way to explain what a Graph Database is, using simple language and an example data-set that fits the way I present. Perhaps this will show the inner geek in me a bit too much but I thought, why not? :)
Normally my meetings start with introductions and I said to myself: ‘Why not create a graph database with my introduction?’ This would show how easy it is to ‘read’ a graph-based data model.
I was inspired by this article which shows how a Graph DB can be helpful in gaining insights from the diverse skills and projects of the workforce at a large company:
So I started by using the Arrows tool to create my Model:
After that, I just copied the code automatically generated by Arrows:
CREATE
(`0` :Person {name:'Frederico Braga'}) ,
(`3` :Country {name:'Switzerland'}) ,
(`4` :Company {name:'HighPoint'}) ,
(`5` :Company {name:'Medidata'}) ,
(`6` :Skill {name:'graph databases'}) ,
(`7` :GraphDB {name:'My CV'}) ,
(`8` :Country {name:'Portugal'}) ,
(`0`)-[:`lives_in` {from:'01.05.2011',to:'today'}]->(`3`),
(`0`)-[:`works_for` {from:'01.02.2018',to:'today'}]->(`4`),
(`0`)-[:`worked_for` {from:'01.04.2017',to:'31.01.2018'}]->(`5`),
(`0`)-[:`has` ]->(`6`),
(`7`)-[:`requires` ]->(`6`),
(`0`)-[:`developed` ]->(`7`),
(`0`)-[:`born` {year:'1977'}]->(`8`),
(`7`)-[:`used` ]->(`6`)
Next, I created my Neo4j database using Neo4j desktop and pasted it into the Neo4j browser. That’s it.
After creating the model I decided I wanted to add another Label and a node for an Application I built. Now I can see my DB schema running the command
call db.schema()
Nice, I have my intro ready, now back to the slides and to write some queries.
Who do I work for?
match (p:Person)-[w:works_for]-(c:Company)
where p.name='Frederico Braga'
return p, w, c
Who have I worked for?
match (p:Person)-[:works_for]->(c:Company),
(p:Person)-[:worked_for]->(oc:Company)
where p.name='Frederico Braga'
return p, c, oc
Which skills have I used?
match (p:Person)--(s:Skill)--(a)
where p.name='Frederico Braga' AND (a:Application OR a:GraphDB)
return p, s, a
The more traditional way…
Not sure anyone had this idea before but I think its an easy, intuitive and time-saving way to explain some of the characteristics of graph property models while introducing yourself. It will likely be much more interesting once I start combining it with other colleagues data which is why Daimler decided to use this technology.
One of the great benefits of graph technology is that it can help discover ‘hidden’ relationships in data, certainly useful when it comes to understanding people’s skills, right? What do you think?