Neo4j: Cypher query returns duplicate results
<p>I have two graphs built like this :</p>

<pre><code>CREATE (level1a:Bug {name: 'a'})
CREATE (level1b:Bug {name: 'b'})
CREATE (level2c:Bug {name: 'c'})
CREATE (level2d:Bug {name: 'd'})
CREATE (level3e:Bug {name: 'e'})
CREATE (level3f:Bug {name: 'f'})
CREATE (level3g:Bug {name: 'g'})
CREATE (level3h:Bug {name: 'h'})

CREATE (level1a)-[:LINK]-&gt;(level2c)
CREATE (level1b)-[:LINK]-&gt;(level2d)
CREATE (level2c)-[:LINK]-&gt;(level3e)
CREATE (level2c)-[:LINK]-&gt;(level3f)
CREATE (level2d)-[:LINK]-&gt;(level3g)
CREATE (level2d)-[:LINK]-&gt;(level3h)
</code></pre>

<p>And also available here : <a href="http://console.neo4j.org/?id=duplicate_bug2" rel="nofollow">http://console.neo4j.org/?id=duplicate_bug2</a></p>

<p>When I execute the query : </p>

<pre><code>MATCH (a:Bug {name: 'a'})-[:LINK]-&gt;()-[:LINK]-&gt;(end) return end
</code></pre>

<p>I get the expected two nodes (f and e). But if I do two match queries like this :</p>

<pre><code>MATCH (a:Bug {name: 'a'})-[:LINK]-&gt;()-[:LINK]-&gt;(end)
MATCH (b:Bug {name: 'b'})-[:LINK]-&gt;()-[:LINK]-&gt;(end2)
return end, end2
</code></pre>

<p>I get duplicates nodes in end and end2. Why is this? The two graphs are not even connected!</p>

<p>BR,
S</p>