October 2017
Beginner to intermediate
316 pages
8h
English
In the next version of our recommendation queries, we will be using the relationships--in this particular dataset, based on family ties between parents and/or siblings--between our users to come up with some useful recommendations for their next purchase.
Let's look at the following query:
match (p:Person)-[b:BOUGHT]->(prod:Product),p<-[r1]-(parent:Person)-[r2]->(sibling:Person) where type(r1) in ["MOTHER_OF","FATHER_OF"] and type(r2) in ["MOTHER_OF","FATHER_OF"] and not(sibling-[:BOUGHT]->prod) return p.name as Person, prod.name as RecommendedProduct, collect(sibling.name) as ForSiblings;
This would give us the products bought by a specific person, and looks for siblings (who have the same mother or ...
Read now
Unlock full access