DenisGallo / Neo4j-ParticleFiltering

A user-defined procedure based on Markov-chains to approximate the Personalized PageRank algorithm in Neo4j
GNU General Public License v3.0
8 stars 6 forks source link

Output method to return directly nodes #5

Open kuzeko opened 3 years ago

kuzeko commented 3 years ago

Currently the method outputs nodeIds. Can we have the method output nodes directly?

kuzeko commented 3 years ago

Currently I need to run this query:

MATCH (r:MyNodeType)
   WHERE r.name IN [ name1, name2, name3  ] 
   WITH collect(r) as nodeList
CALL particlefiltering.unlabelled(nodeList, 0, 1000) YIELD nodeId, score 
 WITH nodeId, score MATCH (r:MyNodeType) WHERE ID(r) = nodeId  
 RETURN r, score 
ORDER BY score DESC 
LIMIT 100

Ideally we should be able to run directly

MATCH (r:MyNodeType)
   WHERE r.name IN [ name1, name2, name3  ] 
   WITH collect(r) as nodeList
CALL particlefiltering.unlabelled(nodeList, 0, 1000) YIELD r, score 
 RETURN r, score 
ORDER BY score DESC 
LIMIT 100

so that for instance I can directly return something more meaningful, e.g.,

...
 RETURN r.name, r.price, score 
ORDER BY score DESC 
LIMIT 100