GraphGist: Skills Management

by Michael Hunger

Using the Design for Queryability modeling approach by Ian Robinson

1. Application/End-User Goals

As an employee

I want to know who in the company has similar skills to me

So that we can exchange knowledge

2. Questions To Ask of the Domain

Which people, who work for the same company as me, have similar skills to me?

3. Identify Entities

Which people, who work for the same company as me, have similar skills to me?

  • Person

  • Company

  • Skill

4. Identify Relationships Between Entities

Which people, who work for the same company as me, have similar skills to me?

  • Person WORKS_FOR Company

  • Person HAS_SKILL Skill

5. Convert to Cypher Paths

  • Person WORKS_FOR Company →

(:Person) - [:WORKS_FOR] -> (:Company)
  • Person HAS_SKILL Skill →

(:Person) - [:HAS_SKILL] -> (:Skill)

Consolidate Paths

(:Person) - [:WORKS_FOR] -> (:Company)
(:Person) - [:HAS_SKILL] -> (:Skill)

(:Company) < - [:WORKS_FOR] - (:Person) - [:HAS_SKILL] - > (:Skill)

Candidate Data Model

CREATE
       (acme:Company {name:'ACME'}),
       (ian:Person {name:'Ian'})-[:WORKS_FOR]->(acme),
       (ian) -[:HAS_SKILL]->(java:Skill {name:'Java'}),
       (ian) -[:HAS_SKILL]->(csharp:Skill {name:'C#'}),
       (ian) -[:HAS_SKILL]->(neo:Skill {name:'Neo4j'}),
       (lucy:Person {name:'Lucy'})-[:WORKS_FOR]->(acme),
       (lucy)-[:HAS_SKILL]->(java),
       (lucy)-[:HAS_SKILL]->(neo),
       (bill:Person {name:'Bill'})-[:WORKS_FOR]->(acme),
       (bill)-[:HAS_SKILL]->(neo),
       (bill)-[:HAS_SKILL]->(ruby:Skill {name:'Ruby'})
Loading graph...

Company Employees

MATCH (company {name:'ACME'})<-[:WORKS_FOR]-(p:Person)
RETURN p.name as name
ORDER by name
Loading table...

People Skills

MATCH (p:Person)-[:HAS_SKILL]->(s:Skill)
RETURN p.name, collect(s.name) as skills
ORDER by length(skills) DESC
Loading table...

6. Express Question as Graph Pattern

Which people, who work for the same company as me, have similar skills to me?

MATCH (company)<-[:WORKS_FOR]-(me:Person)-[:HAS_SKILL]->(skill),
      (company)<-[:WORKS_FOR]-(colleague)-[:HAS_SKILL]->(skill)
WHERE  me.name = 'Ian'
WITH colleague.name AS name,
       count(skill) AS score,
       collect(skill.name) AS skills
WHERE score > 1
RETURN name,score,skills
ORDER BY score DESC
Loading graph...
Loading table...

Running queries, preparing the console!

Run
Table
Graph
Table!
Graph!
Error!
Loading