I'm writing Gremlin python queries on a Neptune database
I want to find all the paths between a node A and a node B.
Then I would like to write the data into a JSON format that looks like this:
{ "nodes": [
{ "id": 1, "name": "A", "color":"red"},
{ "id": 2, "name": "B", "color":"green"},
{ "id": 3, "name": "C", "color":"green"}
],
"links": [
{ "source": 1, "target": 2, "color":"blue" }
{ "source": 1, "target": 3, "color":"purple" }
{ "source": 3, "target": 2, "color":"blue" }
]}
So that it's compatible with d3.js graph library and I could load the result into the d3 graphing library.
(In this case between A and B there would be the paths A->B and A->C->B)
I think I could use GraphSONWriter for this? Is that right?