1

Using g.V(<vertex_number>) you can get a single vertex object from a graph.

Using g.V() you can get all vertex objects from a graph.

Is there a way to iteratively chunk every vertex object from a graph?

For example, if I wanted to get every single vertex object, but in chunks of 100. Something like g.V(0:100), ... ,g.V(n-100, n).

Ian
  • 3,605
  • 4
  • 31
  • 66
  • 2
    I don't think there's any more recent approaches to pagination beyond that answer I referenced,though I just updated that question with a link to a relatively recent blog post on the topic that drills into greater detail. – stephen mallette Jul 19 '19 at 16:43
  • Thanks Stephen, this is the solution I was searching for (TIL the term is pagination). Do you know how I could replicate `t = g.V().hasLabel('person');[]` in gremlinpython? Namely, what does the `[]` syntax do, and how does it translate? – Ian Jul 19 '19 at 16:53
  • 1
    that particular approach can't be replicated with python unless you use scripts and a session (so that `t` will be preserved between requests) which isn't recommended as sessions may or may not be supported in the long term and certainly aren't evenly supported by all graph providers so you greatly reduce code portability. don't be confused by the `[]` - it's just a trick to hide results on the console http://tinkerpop.apache.org/docs/current/tutorials/the-gremlin-console/#result-iteration – stephen mallette Jul 19 '19 at 17:23

0 Answers0