PageRank returns no difference in Recipe graph

I have checked the dataset and found the error:

It seems that the query in part 3 should be fixed to:

CALL gds.graph.writeRelationship('ingredient', 'COMMONLY_USED_TOGETHER', 'score')

In the current setup, all relationship weights are null, because we don't export relationship properties from mutated relationships. Seems like when the relationship weights are null, PageRank algorithm dismisses the relationships as non-existent. I will report this to the GDS team. With the current setup, you would have to ignore relationship weights and it would work as well.

CALL gds.pageRank.stream({
nodeQuery:'MATCH (i:Ingredient) WHERE i.ingredient_community = 377
RETURN id(i) as id',
relationshipQuery:'MATCH (s:Ingredient)-[r:COMMONLY_USED_TOGETHER]->(t:Ingredient)
WHERE s.ingredient_community = 377 AND t.ingredient_community = 377
RETURN id(s) as source, id(t) as target,r.score as weight'})
YIELD nodeId,score
return nodeId, score
ORDER BY score DESC

Thanks for letting us know!

1 Like