2

我正在使用 Cypher ReST API。它返回 1 个具有两个名称值对“列”和“数据”的对象。有没有办法抛弃列并将节点作为对象而不是数组返回?更符合这一点: http: //bl.ocks.org/4062045#miserables.json

这是我现在得到的:

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" ], ....

查询文件:

{
  "query" : "start n  = node(*) match n -[r?]-> m return n.name? as source, type(r) as r_type, m.name? as target",
  "params" : {
  }
}
4

1 回答 1

3

您可以编写一个服务器插件来实现这一点。然后它将通过 REST API 可用。

于 2013-01-28T18:23:45.290 回答