There is no universal way

this is a quite generic approach but it will be super slow

MATCH path = (a)-[]-(b)-[]-(c)
WHERE ANY(r in rels(path) WHERE id(r) = 5)
RETURN path

it is better if you can do:

match path = (a)-[r]-(b)-[]-(c)
where id(r) = 5
return path
union
match path = (a)-[]-(b)-[r]-(c)
where id(r) = 5
return path

Michael

> Am 10.03.2015 um 11:24 schrieb Martin Troup <[email protected]>:
> 
> Hello everyone,
> 
> 
> 
> lets say I have a graph pattern (for example (a)-[]-(b)-[]-(c), but it can be 
> any graph pattern). I want to find this graph pattern with Cypher query. I 
> know partial information about the exact pattern I am looking for, for 
> example some of node IDs, or relationship IDs.
> 
> Here I will show an example. I am looking for a pattern (a)-[]-(b)-[]-(c) and 
> I know there is a relationship with ID 5 in it, but I don’t know its 
> position. So it can be the one between nodes a and b or between b and c.
> 
> I am wondering if there is an universal way to express this with Cypher 
> query, something like 
> 
> 
> 
> MATCH any_graph_pattern
> 
> WHERE relationship_id(5)
> 
> 
> 
> where I can say which exact relationships or nodes are part of the graph 
> pattern I am looking for even though I don’t know their position within it.
> 
> 
> 
> Thanks a lot for a reply!
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to