Question

I am having trouble evaluating when to use which Neo4j query-mechanism (Gremlin, Cypher, traversals, build-in algorithms). For instance, I would like to select the single node in the entire graph

  • with the highest number of edges;
  • within a certain path-lenght from one of 4 starting nodes;
  • having a certain value for a property.

I am using the Python neo4jrestclient, and can execute basic Gremlin/Cypher scripts & traversals for some of the requirements individually (e.g. calculating In/OutDegree with Gremlin), but am missing the bigger picture on how to combine them.

Any suggestions?

Was it helpful?

Solution

In Cypher it would look like this:

start n=node:index(indicator="startnode-value")
match n-[:REL*..10]->target
where target.prop = "value"
return target
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top