Hi,

When I combine a gremlin query within a OrientDB Sql Query I get a weird 
result. Here's an example query:

*select 
_id,gremlin('current.bothE('FriendRequest').as('e').bothV.filter{it._id=='52efd2bc2fd4d9b874204a79'}.back('e').inV')
 
as request from Users where n like 's%'*

*This query should return a list of vertices from the Users class, along 
with the direction of any FriendRequest (Edge) from another user.*

So if user '533f39ceb928b5bcee8b9021' has a FriendRequest from user 
'52efd2bc2fd4d9b874204a79' 
the request field will generate text 'incoming'. ex:

In the Graph we create a FRIENDREQUEST edge from 52efd2bc2fd4d9b874204a79 
To 533f39ceb928b5bcee8b9021
52efd2bc2fd4d9b874204a79 - (FriendRequest) -> 533f39ceb928b5bcee8b9021

The query will return the following result for user '
533f39ceb928b5bcee8b9021':
Result:
          "_id": "533f39ceb928b5bcee8b9021",
            "n": "Sebastian Price",
            "request": "incoming"

This much works.

*The weird part is, for some reason this query generates a 'request' field 
for every user, even if they are not attached to any FriendRequest edge.*

So in a graph with another 10 users I should get this:

"533f39afb928b5bcee8b8fc7","Sonia Delaney",""
"533f39b0b928b5bcee8b8fc9","Stewart Henderson",""
"533f39b8b928b5bcee8b8fe1","Selma Lindsay",""
"533f39c6b928b5bcee8b900b","Skyler Diaz",""
"533f39cbb928b5bcee8b901a","Stewart Whitehead",""
*"533f39ceb928b5bcee8b9021","Sebastian Price","incoming"*
"533f39cfb928b5bcee8b9024","Shaeleigh Williams",""
"533f39dab928b5bcee8b9041","Sara Fields",""
"533f39dbb928b5bcee8b9042","Signe Newton",""
"533f39e1b928b5bcee8b904f","Steven Trujillo",""

But instead I get a value "[outgoing, incoming]" for every user that does 
not have a FriendRequest edge.

"533f39afb928b5bcee8b8fc7","Sonia Delaney","[outgoing, incoming]"
"533f39b0b928b5bcee8b8fc9","Stewart Henderson","[outgoing, incoming]"
"533f39b8b928b5bcee8b8fe1","Selma Lindsay","[outgoing, incoming]"
"533f39c6b928b5bcee8b900b","Skyler Diaz","[outgoing, incoming]"
"533f39cbb928b5bcee8b901a","Stewart Whitehead","[outgoing, incoming]"
"533f39ceb928b5bcee8b9021","Sebastian Price","incoming"
"533f39cfb928b5bcee8b9024","Shaeleigh Williams","[outgoing, incoming]"
"533f39dab928b5bcee8b9041","Sara Fields","[outgoing, incoming]"
"533f39dbb928b5bcee8b9042","Signe Newton","[outgoing, incoming]"
"533f39e1b928b5bcee8b904f","Steven Trujillo","[outgoing, incoming]"

I get the sense that this is coming from the way the output is generated, 
and not so much the query itself. Maybe the "[outgoing, incoming]" is 
stored in memory and outputed repeatly erroneously...

Best
Yvan

-- 

--- 
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