Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-28-2020 02:05 PM
Hi,
I'm trying create a sub graph for specific id and later calculate pagerank:
call gds.graph.create.cypher('teste','match (p)-[r]-(p2) return id(p) as id','match (p:Person{id:123456})-[r*3]-(p2) return id(p) as source, id(p2) as target')
A graph is created in memory with 8804 thousand nodes 728 relationships:
But the id: 123456 doesn't have all these nodes and relationships, what am I doing wrong???
08-03-2020 02:55 AM
This part of the query means that it will look for relationships 3 hops away from 123456 rather than just its immediate neighbours. If that isn't what you want to do, remove the *3
. Or are you saying that 123456 doesn't have those neighbours even at 3 hops?
Also on that first query you aren't doing any filtering of which nodes should be included. It's including all nodes that have a relationship, which likely is all nodes in the graph.
08-06-2020 05:49 AM
Thanks for your reply.
Id 123456 does have those neighbours. Should I invert the query??
call gds.graph.create.cypher('teste','match (p:Person{id:123456})-[r*3]-(p2) return id(p2) as id, match (p)-[r]-(p2) return id(p) as source, id(p2) as target)
It's correct ??
All the sessions of the conference are now available online