Database Reference
In-Depth Information
The pattern should be fairly similar, but the difference is that we are now counting
the number of products of a certain brand and ensuring that the person in question
has not yet bought the other products of that same brand. The result looks like this:
The recommendations based on brand
Again,thisgivesussomeusefulrecommendations,basedonaverydifferentqualiier.
Let's then bring in another parameter: our social relationships, in this case, based on
the family ties that a particular user will have.
Recommendations based on social ties
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/orsiblings—betweenouruserstocomeupwithsomeusefulrecommendations
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;
Thiswouldgiveustheproductsboughtbyaspeciicperson,andlooksforsiblings
(whohavethesamemotherorfatherastheirstperson)whohavenotboughtthat
speciicproductandmaypotentiallybeneitfromit.Runningthequerygivesusthe
following result set:
 
Search WWH ::




Custom Search