Howdy,
I'm going to try asking this question a different way...
Using strictly a cypher query or apoc procedure, I want to output a json file to be readable for a D3 Sankey display. My json file must contain zero-base numbering. I cannot use the existing node IDs, as those do not follow the required zero-base convention.
The output of this query should look like this...
{
"nodes":[
{"node":0,"name":"Fremont Brewing"},
{"node":1,"name":"Holy Mountain Brewing"},
{"node":2,"name":"Bourbon"},
{"node":3,"name":"Cognac"},
{"node":4,"name":"Altbier"},
{"node":5,"name":"Barleywine - American"},
{"node":6,"name":"Stout - American Imperial / Double"}
],
"links":[
{"source":0,"target":2,"value":1},
{"source":2,"target":4,"value":1},
{"source":0,"target":3,"value":1},
{"source":3,"target":5,"value":1},
{"source":1,"target":3,"value":1},
{"source":3,"target":6,"value":1}
]}
I want to add the zero-based number through the query/procedure, not have it pre-existing as a property.
What would I need to add to my query to 'inject' this kind of zero-based numbering? Or is there an APOC procedure which would 'inject' a zero-based number per node & source/target as seen in the example above?