cancel
Showing results for 
Search instead for 
Did you mean: 

GDS Algorithms to consider specific nodes

karim-mo
Node

hello, I'm tryna use cypher projections on algos like PageRank and FastRP but my issue is, they both alter properties on all projected nodes.

To explain it further, take for example a user having the ability to like a product/offer and also comment or even buy them, in order to achieve this using cypher projections I need to project nodes of type user, product and offer, and the relation projection would be user-bought/liked/commented_on->offer/product, which makes sense, but then these algos would add scores on users, offers and products when i want them to consider them in the relation and calculations, but not write properties to them (I tried using nodeLabels as part of the algo configs, but no luck).

Here's a sample of what I project (In this case, PageRank on the best categories per community):

 

 

CALL gds.graph.project.cypher('pagerank',
'MATCH(n) WHERE (n:User AND n.communityId = 14) OR n:Category RETURN id(n) AS id',
"MATCH (u:User)-[r:INTERESTED_IN]->(n:Category) WHERE u.communityId = 14 RETURN id(u) as source, id(n) as target"
)

 

 

In that case, both users and categories get a pagerank property when I run the algorithm in write mode, same for running FastRP or anything that has multiple node/relation projection.

Am I missing something drastic here? still a beginner to GDS in general, thanks in advance!

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.