Database Reference
In-Depth Information
Listing 11-61. The friendsPurchaseTagSimilarityAndProximityToLocation Method
@Query("START n = node:geom({lq}) " +
" WITH n " +
" MATCH (u:User { userId : {userId} } )-[:USES]->(t)<-[:HAS]-p " +
" WITH n,u,p,t " +
" MATCH u-[:FOLLOWS]->(f)-[:HAS]->(n) " +
" WITH p,f,t " +
" MATCH f-[:MADE]->()-[:CONTAINS]->(p) " +
" RETURN p.productId as productId, " +
" p.title as title, " +
" collect(f.firstname + ' ' + f.lastname) as fullname, " +
" t.wordPhrase as wordPhrase, " +
" count(f) as cfriends " +
" ORDER BY cfriends desc, p.title ")
List<MappedProductUserPurchase> friendsPurchaseTagSimilarityAndProximityToLocation (@Param("userId")
String userId, @Param("lq") String lq);
Figure 11-21. Products Purchased by Friends Nearby and Matches User's Tags
Summary
This chapter presented the setup for a development environment for Spring Data and Neo4j and sample code using
the Spring Data Neo4j driver. It proceeded to look at sample code for setting up a social network and examining
interest within the network. It then looked at the sample code for capturing and viewing consumption—in this case,
product views—and the queries for understanding the relationship between consumption and a user's interest.
Finally, it looked at using geospatial matching for locations and examples of methods for understanding user intent
within the context of user location, social network, and interests.
The next chapter will review using Java and Neo4j, covering the same concepts presented in this chapter but in
the context of a Java driver for Neo4j.
 
Search WWH ::




Custom Search