October 2017
Beginner to intermediate
316 pages
8h
English
Obviously, we all understand that if we already own a product of a particular brand, it is likely that we will be more interested in other products that are manufactured by that same brand. So let's find the people that already have more than one product of a certain brand and see if we can recommend other products by that brand. Here's the query example:
MATCH (p:Person)-[b:BOUGHT]->(prod1:Product)-[:MADE_BY]->(br:Brand)<-[MADE_BY]-(prod2:Product) WITH p, br, prod2, count(prod1) as NrOfBrandProducts WHERE not(p-[:BOUGHT]->prod2) and NrOfBrandProducts > 1 RETURN p.name as Person, br.name as Brand, collect(prod2.name) as RecommendedProducts ORDER BY Person ASC;
The pattern should be fairly similar, but ...
Read now
Unlock full access