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.

I am trying to query all vertices which have an outgoing edge of a 
particular type but no outgoing edge of another type.

As an example in a simple relationship of Person ---- Friend ---> Person 
Person ---- Owns ---> Car

I am trying to find all the persons who have friends but do not own a car.

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)

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)

In my efforts I realized that the NOT query is not supported yet by 
OrientDb in the WHERE clause as per this page: 
https://github.com/orientechnologies/orientdb/wiki/SQL-Where Can someone 
please verify if this is indeed true.

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:

select from Person where (out('Owns').size() = 0)
select from Person where (out('Owns') is null)

Not sure what I am missing, but any help is as always greatly appreciated. 
I am using 1.7Rc-1 of orient.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to