Neo4J cypher query to get nodes connected by paths with the same generic attribute -


i'm trying create cypher query returns me nodes connected given range of hops (i.e. 1..5), relationships between these hops share same attribute value, without specifying attribute.

so like

match (a {type: 'cin1'})-[rels:next*1.. {value: 1}]->(b {type: 'cancer'})  return (a), (b) 

but without specifying value on edges should one, need equal among edges in hopping process.

i add upper bound path. or use (all)shortestpath(s)

also make sure a , b indexed label + property combination.

and can use predicate on relationships-collection forms path.

match (a:label {type: 'cin1'}) match (b:label {type: 'cancer'}) match shortestpath((a)-[rels:next*1..20]->(b)) all(r in tail(rels) (head(rels)).value = r.value) return (a), (b) 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -