How can I use the .io("filename.json").write() pattern to append to an existing graphson file?
I have read about defining a custom GraphWriter using the builder, but wanted to ask first before spending more time
Here is my example code:
, which gets results as follows:
Solution:Jump to solution
The subgraph is stored as a side-effect, so you could use
withSideEffect()
to give it your own graph instance and then reuse that across multiple traversals to subgraph:
```gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> sub = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]...3 Replies
I'd like to see the result set include firstSource and firstSink, in addition to secondSource and secondSink. For context, I am attempting to break up a query that is used to sample real data from our database with the goal of using it as a test resource. I need to sample a bit of data from here and there, and as it happens the query times out before finishing.
Or could I somehow aggregate multiple Graph objects into one?
Solution
The subgraph is stored as a side-effect, so you could use
withSideEffect()
to give it your own graph instance and then reuse that across multiple traversals to subgraph:
I assume this will work on Neptune with Java, but I'm not completely sure. If it doesn't work I guess there's ways to merge the two subgraphs to one and then write that out, but I think this is the canonical answer for TinkerPop. Please let us know if it works for you.I will try this and let you know