title: Neo4j / Cypher: Matching "Triangles"
body: <p>I am new to Neo4j and Cypher and I can't get my head around this problem.
  Let's suppose I have a very large graph with 3 different node types: Doctor, Diagnosis and Product.
  I would like to do the following thing:</p>
  <p>For each Doctor-Diagnosis connected pair, count how many different products are linked to both the doctor and the diagnosis.</p>
  <p>A sample of my data would be:</p>
  <pre><code>Doctor_ID   Diagnosis   Product
     1           A          123
     1           B          527
     1           A          198
     2           K          471
     2           A          123
     3           J          024
     3           A          198
     3           A          123
     3           A          722
  </code></pre>
  <p>And I would like to get:</p>
  <pre><code>Doctor_ID    Diagnosis   COUNT 
     1            A          2
     1            B          1
     2            K          1
     2            A          1
     3            J          1
     3            A          3
  </code></pre>
  <p>Any help would be highly appreciated.
  Thanks!</p>