3

Given a list of (let say 4) MicroRNA and a list of relationships (pictar, rna22,…), returns the list of target TargetGenes common to all MicroRNA in all relationships.

I am trying to do by this way but it does not work...

MATCH (n:microRNA)-[r]->(n:Target) 
WHERE r.name='RNA22v2' 
OR r.name='PicTar' 
RETURN n 

But it does not give me any results.

Dave Bennett
  • 10,996
  • 3
  • 30
  • 41
Giorgi
  • 31
  • 4
  • Your Cypher code has legal syntax, and should work if your actual data agrees with it. Check that you did not make any typos (spelling and capitalization are significant) and your data model agrees with your code. For example, your question mentioned "TargetGenes", but your code uses the label "Target"... – cybersam Jul 15 '17 at 00:00
  • Actually nodes are -microRNA and Target but the codes still does not work. I think everything is okay in query but I have a result as - (no records). Any ideas ? – Giorgi Jul 15 '17 at 00:36
  • Can you add a few lines of sample data to your question? – Dave Bennett Jul 15 '17 at 02:47

1 Answers1

3

This may or may not be the actual problem, but instead of

MATCH (n:microRNA)-[r]->(n:Target) 
WHERE r.name='RNA22v2' 
OR r.name='PicTar' 
RETURN n 

shouldn't you have

MATCH (m:microRNA)-[r]->(t:Target) 
WHERE r.name='RNA22v2' 
OR r.name='PicTar' 
RETURN m,t

Using the same variable n for two different nodes may confuse things.

Hope this helps, Tom

Tom Geudens
  • 2,638
  • 9
  • 15