Re: Phantom vertices


Robert Dale <rob...@...>
 

You probably want to count the edges:

g.V().hasLabel('person').group().by('name').by(outE().count()).order(local).by(values,decr).limit(local,5)

Robert Dale

On Tue, Aug 15, 2017 at 9:53 PM, Rohit Jain <rohit.j...@...> wrote:
I found my phantom person Vertex.

So, I was doing this query to find the top 5 actors who had acted in the most movies.  I don't think the query is correct for what I am trying to do since the result does not seem to be right.  However, when I first ran this query:

g.V().hasLabel("person").groupCount().by("personid").order(local).by(values,decr).select(keys).limit(local, 5)

I got an error saying that it could not find "personid" for this specific vertex id.  I did the following for the vertex id:

gremlin> g.V(5578792).valueMap()
==>[]

This told me that I had a vertex that did not have a personid for some reason.  That was my phantom vertex.  I dropped it and then the above query ran.  The result of the above query is ==>[1,2,3,4,5], which I know is not right.  From my SQL query using our product EsgynDB running on Apache Trafodion, I get:

PERSON_ID  NAME                                 NUM                 
---------  -----------------------------------  --------------------

     6830  Robert De Niro                                         53
     5828  Morgan Freeman                                         43
     1053  Bruce Willis                                           38
     5363  Matt Damon                                             37
     4057  Johnny Depp                                            36


Rohit

--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.