Databases Reference
In-Depth Information
The sample graph shown here has just two companies, each with several employees. An
employee is connected to his employer by a WORKS_FOR relationship. Each employee is
INTERESTED_IN one or more topics, and has WORKED_ON one or more projects. Occa‐
sionally, employees from different companies work on the same project.
This structure addresses two important use cases:
• Given a user, inferring social relations—that is, identifying their professional social
network—based on shared interests and skills.
• Given a user, recommend someone that they have worked with, or who has worked
with people they have worked with, who has a particular skill.
The first use case helps build communities around shared interests; the second helps
identify people to fill specific project roles.
Inferring social relations
Talent.net's graph allows it to infer a user's professional social network by following the
relationships that connect an individual's interests to other people. The strength of the
recommendation depends on the number of shared interests. If Sarah is interested in
Java, graphs, and REST, Ben in graphs and REST, and Charlie in graphs, cars, and med‐
icine, then there is a likely tie between Sarah and Ben based on their mutual interest in
graphs and REST, and another tie between Sarah and Charlie based on their mutual
interest in graphs, with the tie between Sarah and Ben stronger than the one between
Sarah and Charlie (two shared interests versus one).
Figure 5-2 shows the pattern representing colleagues who share a user's interests. The
subject node refers to the subject of the query (in the preceding example, this is Sarah).
This node can be looked up in an index. The remaining nodes will be discovered once
the pattern is anchored to the subject node and then flexed around the graph.
The Cypher to implement this query is shown here:
START subject= node :user(name= {name} )
MATCH (subject)-[:WORKS_FOR]->(company)<-[:WORKS_FOR]-(person),
(subject)-[:INTERESTED_IN]->(interest)<-[:INTERESTED_IN]-(person)
RETURN person.name AS name,
count (interest) AS score,
collect (interest.name) AS interests
ORDER BY score DESC
Search WWH ::




Custom Search