October 2017
Beginner to intermediate
316 pages
8h
English
Let's build this thing from the ground up. The first query that we want to write is based on past purchasing behavior. We would like to find people that already share a couple of products that they have purchased in the past, but that also explicitly do not share a number of other products. In our data model, this Cypher query would go something as follows:
match (p1:Person)-[:BOUGHT]->(prod1:Product)<-[:BOUGHT]-(p2:Person)-[:BOUGHT]->(prod2:Product) where not(p1-[:BOUGHT]->prod2) return p1.name as FirstPerson, p2.name as SecondPerson, prod1.name as CommonProduct, prod2.name as RecommendedProduct;
In this query, the match clause gathers the pattern of users (p1 and p2) that have bought a common ...
Read now
Unlock full access