gpt4 book ai didi

rest - 将节点作为 json 对象返回的密码选项?

转载 作者:行者123 更新时间:2023-12-04 05:13:38 25 4
gpt4 key购买 nike

我正在使用 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" : {
}
}

最佳答案

你可以写一个 server plugin实现这一目标。然后可以通过 REST API 使用它。

关于rest - 将节点作为 json 对象返回的密码选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14568116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com