cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to find similarity based on count of connected nodes in Neo4j?

I have a node that is Person, which has properties like: (age, address, school, pet's name). The node has a relationship with another node Vacation. I want to find similar nodes to a Person based on only 3 properties: person's age, address and count(Vacation). I am looking for finding similarity based on the count of vacation as well, I have written the query to search based on the properties like this:

 

CALL gds.graph.project(
'myGraph',
{
Person: {
properties: ['age','address ']
}
},
'*'
);


CALL gds.knn.stream('myGraph', {
topK: 1,
nodeProperties: ['age', 'address ']
})
YIELD node1, node2, similarity
RETURN gds.util.asNode(node1).personName AS p1, gds.util.asNode(node2).personName AS p2, similarity

 

 

HasAngi_0-1665919941107.png

 

0 REPLIES 0