title: Presence / absence of an outgoing edge from a vertex in OrientDb
body: <p>I have seen some similar questions on SO but none of the answers have worked for me yet, so I am hoping to get a new answer with the new features that have been added to recent versions of OrientDb since the other questions were asked.</p>
  
  <p>I am trying to query all vertices which have an outgoing edge of a particular type but no outgoing edge of another type. </p>
  
  <p>As an example in a simple relationship of </p>
  
  <p>Person ---- Friend ---> Person</p>
  
  <p>Person ---- Owns   ---> Car</p>
  
  <p>I am trying to find all the persons who have friends but do not own a car. </p>
  
  <p>I have already tried the following query with no luck (It returns all the persons irrespective of whether or not those vertices have an outgoing edge of a particular kind)</p>
  
  <pre><code>select from Person where (out('Friend') not null and out('Owns').size() = 0)
  select from Person where (out('Friend') is not null and out('Owns') is null)
  </code></pre>
  
  <p>In my efforts I realized that the NOT query is not supported yet by OrientDb in the WHERE clause as per this page: <a href="https://github.com/orientechnologies/orientdb/wiki/SQL-Where" rel="nofollow">https://github.com/orientechnologies/orientdb/wiki/SQL-Where</a> 
  Can someone please verify if this is indeed true.</p>
  
  <p>Anyways, I moved on and tried to simplify my query and tried to find only vertices that do not have the outgoing edge of 'Owns'. Even that did not work in that it seemed to return all the Person vertices in my graph:</p>
  
  <pre><code>select from Person where (out('Owns').size() = 0)
  select from Person where (out('Owns') is null)
  </code></pre>
  
  <p>Not sure what I am missing, but any help is as always greatly appreciated. </p>