0

我正在使用原始 curl/php 向 REST API 发出几个请求,api 返回一堆 url...我只想要数据!有没有办法禁用这种行为?

服务器为每个请求返回大约 2.8MB。

例如:$请求

{"query" : "START user = node(1) MATCH (user)<-[:TEST_PYRAMID_15x15x15_NOT_UNIQUE_II]-(friend)  return distinct friend limit 1","params" : { }}

PHP

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Accept:  application/json; charset=UTF-8","Content-length: ".strlen($request)));
curl_setopt($ch,CURLOPT_POSTFIELDS, $request);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);

回复:

 {
  "columns" : [ "friend" ],
  "data" : [ [ {
    "paged_traverse" : "http://localhost:7474/db/data/node/366/paged/traverse/{returnType}{?pageSize,leaseTime}",
    "outgoing_relationships" : "http://localhost:7474/db/data/node/366/relationships/out",
    "data" : {
      "fbfullname" : "NAME",
      "fbid" : "6969696969696969"
    },
    "all_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/all/{-list|&|types}",
    "traverse" : "http://localhost:7474/db/data/node/366/traverse/{returnType}",
    "self" : "http://localhost:7474/db/data/node/366",
    "all_relationships" : "http://localhost:7474/db/data/node/366/relationships/all",
    "property" : "http://localhost:7474/db/data/node/366/properties/{key}",
    "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/out/{-list|&|types}",
    "properties" : "http://localhost:7474/db/data/node/366/properties",
    "incoming_relationships" : "http://localhost:7474/db/data/node/366/relationships/in",
    "incoming_typed_relationships" : "http://localhost:7474/db/data/node/366/relationships/in/{-list|&|types}",
    "extensions" : {
    },
    "create_relationship" : "http://localhost:7474/db/data/node/366/relationships"
  } ] ]
}

我知道如果我要求一个特定的属性,neo4j 将只返回那部分,但我事先不知道这些属性。“前回朋友.fbid”

4

1 回答 1

0

如果您返回节点/rels/paths,REST API 将返回完整的表示。我们正在考虑 Cypher 中的一个函数来返回节点/rel 上的属性。

于 2013-07-25T08:12:47.310 回答