Can GraphBinary be used to save a graph to file?
Can GraphBinary be used to save graph in a file. Any example is welcome.
Solution:Jump to solution
I think you would have to use GraphSON the way @danielcraig23 described. Or if using Java, Gryo. We simply never created
GraphBinaryGraphWriter
implementations because GraphBinary was built for network serialization. I suppose it could be used that way, but no one has ever really made a request to do that.5 Replies
I use something like this to save a subgraph to file:
The resulting json is quite large but it looks something like this
If you truly want to save your whole graph, you can do a query like the following:
instead of the g.V().hasLabel("person").bothE() query
For creating a tinkerGraph from the file, I do the following:
This is how I write Junit test cases with graph snapshots as test resources
The vertexIdManager config is needed to allow Tinkergraph to mimic the rules that Neptune has for vertex ID's but maybe that part's not interesting to you
Solution
I think you would have to use GraphSON the way @danielcraig23 described. Or if using Java, Gryo. We simply never created
GraphBinaryGraphWriter
implementations because GraphBinary was built for network serialization. I suppose it could be used that way, but no one has ever really made a request to do that.Thanks for the answer. Meanwhile tried using Janusgraph and saving graph locally using barkley db.