Date
1 - 3 of 3
Java usage of V() in updates on inmemory graph
bremc...@...
Hello,
Can someone kindly explain why the below example works without the red .V()? If that is included, the call to next() returns a NoSuchElementException.
static void example() throws Exception {
|
|
Stephen Mallette <spmal...@...>
On an empty graph I would expect g.V().addV() to return NoSuchElementException and aside from rare cases I don't think you would typically write such a traversal. That traversal is basically saying "for ever vertex in the graph call add a new vertex". If the graph is empty then addV() will never be called. If on the other hand you use addV() as your start step rather than V(), the traversal stream is started with a newly added vertex and your code should work. Also note that you do not need to keep instantiating "g". Create it once and re-use it.
On Tue, May 26, 2020 at 7:00 PM bremccarthy via JanusGraph users <janusgra...@...> wrote:
|
|
bre...@...
Perfect. Thanks for your explanation!
On Wednesday, May 27, 2020 at 3:06:43 AM UTC-7, Stephen Mallette wrote:
|
|