I am using the Cypher ReST API. It returns 1 object with two name value pairs “columns” and “data”. Is there a way to ditch the columns and have the nodes returned as objects instead of an array of arrays? More in line with this: http://bl.ocks.org/4062045#miserables.json
Here is what I get now:
curl -d @query --header "Content-Type:application/json" http://localhost:7474/db/data/cypher
{
"columns" : [ "source", "r_type", "target" ],
"data" : [ [ "Corn", "LIKES", "Parsley" ], [ "Corn", "LIKES", "Sunflowers" ],
[ "Corn", "LIKES", "Pumpkin" ], [ "Corn", "LIKES", "Peas" ], [ "Corn", "LIKES", "Beans" ],
[ "Corn", "HATES", "Tomato" ], [ null, null, null ], [ "Carrots", "LIKES", "Tomato" ],
[ "Carrots", "LIKES", "Peas" ], [ "Carrots", "LIKES", "Onions" ], ....
the query file:
{
"query" : "start n = node(*) match n -[r?]-> m return n.name? as source, type(r) as r_type, m.name? as target",
"params" : {
}
}
You could write a server plugin to achieve this. It would then be available via the REST API.