K.M.J
K.M.J

Reputation: 145

Is there a way i can return all the nodes their relationship and it's properties for the following query

I want to get all the list of distinct nodes and relationship that I am getting through this query.

MATCH (a:Protein{name:'9606.ENSP00000005995'})-[r:ON_INTERACTION_WITH]-(b:Protein)-[d:ON_INTERACTION_WITH]-(c:Protein)
Return a,b,c,d,r 
limit 10

Upvotes: 0

Views: 36

Answers (1)

cybersam
cybersam

Reputation: 66967

This should work:

MATCH (a:Protein{name:'9606.ENSP00000005995'})-[r:ON_INTERACTION_WITH]-(b:Protein)-[d:ON_INTERACTION_WITH]-(c:Protein)
WITH * LIMIT 10
RETURN
  COLLECT(DISTINCT a) AS aList,
  COLLECT(DISTINCT b) AS bList,
  COLLECT(DISTINCT c) AS cList,
  COLLECT(DISTINCT r) AS rList,
  COLLECT(DISTINCT d) AS dList

Upvotes: 1

Related Questions