Hi,
I am trying to use Node Similarity algorithm on a projection of my database. I want it to provide data based on a source node and according to the nominated weight. But the source node and weight cannot work together. Could anyone offer help? Many thanks!
my projection: (the projection works)
CALL gds.graph.project.cypher(
'projection',
'MATCH (n) WHERE n:AscdcProvidedCHO OR n:Resource
AND NOT n.uri ="http://dbpedia.org/resource/Bird"
RETURN id(n) AS id',
'MATCH (n:AscdcProvidedCHO)-[r:subject | keywords]->(m:Resource)
RETURN id(n) AS source, id(m) AS target, r.weight AS weight',
{validateRelationships: false})
The algorithm operation:
MATCH (a{uri:"OB1"})
WITH id(a) AS viewedNode
CALL gds.alpha.nodeSimilarity.filtered.stream(
'projection',
{relationshipWeightProperty: 'weight',
sourceNodeFilter: viewedNode, topK:100})
YIELD node2, similarity
RETURN gds.util.asNode(node2).uri AS recommendations, similarity
ORDER BY similarity DESC
The outcome shows "no changes, no records."
I tried to use only <relationshipWeightProperty: 'weight', topK:100> and <sourceNodeFilter: viewedNode, topK:100>, both of the two work. But when weight property and source node filter show together, it does not work.
To be honest, these are codes I wrote last year and at that time they worked well. I am using Neo4j 4.4.8, GDSL 2.1.6 and Neosemantics 4.4.0.1.
Thanks a lot in advance!