cypher query

12 views
Skip to first unread message

Alessio Battistutta

unread,
Apr 30, 2012, 10:40:11 AM4/30/12
to Neo4j

Hi,

i have to make a query in cypher to retrieve 2-nodes relation

node a and node b, this nodes have many relation, but i need only a ->
b and b -> a
and typically are a mix of in/out relations
for example 2 outgoing relation from a to b and 1 incoming relation
from b to a

a-[following,friendOf]-b
b-[followedBy]-a


so i have to check if this list o 3 relation node by node is complete
and need names
of relations in return too

START a=node(3), b=node(6)
MATCH a-[?]-b
RETURN ?

probably not :)

can anyone help me ?
Thanks

Alessio Battistutta

unread,
Apr 30, 2012, 11:32:04 AM4/30/12
to Neo4j
ok,
may is something like

START a=node(3), b=node(6)
MATCH a-[r]-b
RETURN a.name,r,b.name



On 30 Apr, 16:40, Alessio Battistutta

Andres Taylor

unread,
May 1, 2012, 7:10:24 AM5/1/12
to ne...@googlegroups.com
On Mon, Apr 30, 2012 at 5:32 PM, Alessio Battistutta <alessio.b...@securtel.net> wrote:
ok,
may is something like

START a=node(3), b=node(6)
MATCH a-[r]-b
RETURN a.name,r,b.name

This will return all relationships between a and b. Is that what you are looking for?

Andrés 
Reply all
Reply to author
Forward
0 new messages