title: How to merge results of two queries in OrientDB
body: <p>Let's say I have 4 vertex classes: V1,V2,V3,V4
  And also 3 edge classes: E1,E2,E3</p>
  
  <p>Then instances of them are (possibly) connected like this:</p>
  
  <pre><code>V1 --E1--&gt; V2
  V2 --E2--&gt; V3
  V2 --E3--&gt; V4
  V3 --E3--&gt; V4
  </code></pre>
  
  <p>So, graph-wise something like:</p>
  
  <pre><code>V1---E1---V2
            |   \
            E2    E3
            |        \
            V3---E3---V4
  </code></pre>
  
  <p>With directions shown above.</p>
  
  <p>I'm now interested in paths over the exact edges shown from V1 to V4 (There might be other edges between them as well that we don't know about, so only the edge types already mentioned are ok.)</p>
  
  <p>To check if one of the paths from V1 to V4 exists (rather V4 will be returned if path exists):</p>
  
  <pre><code>SELECT EXPAND(out('E1').out('E3')) FROM V1 WHERE id = &lt;someIdThatV1Has&gt;
  </code></pre>
  
  <p>To check if the other path exists (rather V4 will be returned if path exists):</p>
  
  <pre><code>SELECT EXPAND(out('E1').out('E2').out('E3')) FROM V1 WHERE id = &lt;someIdThatV1Has&gt;
  </code></pre>
  
  <p>The only interest I have is to know if ONE of the two paths exists. I would like to do this with one query.</p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I merge these two queries to one query to find out if one of the two paths exists?</p>
  
  <p>(If possible, a general answer to how to merge different traversal queries in OrientDB along with an explicit answer would be highly appreciated.)</p>
  
  <p>Thanks!</p>