1

たとえば、 Neo4j経由でデータをリクエストする場合、

curl -i -XPOST -d'{ "query" : "start n=node(*) return n" }' 
  -H "accept:application/json;stream=true" 
  -H content-type:application/json 
  http://localhost:7474/db/data/cypher

文書化されているように、次のような応答が返されます。

{
  "columns" : [ "n" ],
  "data" : [ [ {
    "outgoing_relationships" : "http://localhost:7474/db/data/node/0/relationships/out",
    "data" : {
    },
    "traverse" : "http://localhost:7474/db/data/node/0/traverse/{returnType}",
    "all_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}",
    "property" : "http://localhost:7474/db/data/node/0/properties/{key}",
    "self" : "http://localhost:7474/db/data/node/0",
    "properties" : "http://localhost:7474/db/data/node/0/properties",
    "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}",
    "incoming_relationships" : "http://localhost:7474/db/data/node/0/relationships/in",
    "extensions" : {
    },
    "create_relationship" : "http://localhost:7474/db/data/node/0/relationships",
    "paged_traverse" : "http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}",
    "all_relationships" : "http://localhost:7474/db/data/node/0/relationships/all",
    "incoming_typed_relationships" : "http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}"
  } ], [ {
    "outgoing_relationships" : "http://localhost:7474/db/data/node/1/relationships/out",
    "data" : {
      "glyph" : "一",
      "~isa" : "glyph"
    },
    "traverse" : "http://localhost:7474/db/data/node/1/traverse/{returnType}",
    "all_typed_relationships" : "http://localhost:7474/db/data/node/1/relationships/all/{-list|&|types}",
    "property" : "http://localhost:7474/db/data/node/1/properties/{key}",
    "self" : "http://localhost:7474/db/data/node/1",
    "properties" : "http://localhost:7474/db/data/node/1/properties",
    "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/1/relationships/out/{-list|&|types}",
    "incoming_relationships" : "http://localhost:7474/db/data/node/1/relationships/in",
    "extensions" : {
    },
    "create_relationship" : "http://localhost:7474/db/data/node/1/relationships",
    "paged_traverse" : "http://localhost:7474/db/data/node/1/paged/traverse/{returnType}{?pageSize,leaseTime}",
    "all_relationships" : "http://localhost:7474/db/data/node/1/relationships/all",
    "incoming_typed_relationships" : "http://localhost:7474/db/data/node/1/relationships/in/{-list|&|types}"
  } ], [ {
    "outgoing_relationships" : "http://localhost:7474/db/data/node/2/relationships/out",
    "data" : {
      "~isa" : "LPG",
      "LPG" : "1"
    },
    "traverse" : "http://localhost:7474/db/data/node/2/traverse/{returnType}",
    "all_typed_relationships" : "http://localhost:7474/db/data/node/2/relationships/all/{-list|&|types}",
    "property" : "http://localhost:7474/db/data/node/2/properties/{key}",
    "self" : "http://localhost:7474/db/data/node/2",
    "properties" : "http://localhost:7474/db/data/node/2/properties",
    "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/2/relationships/out/{-list|&|types}",
    "incoming_relationships" : "http://localhost:7474/db/data/node/2/relationships/in",
    "extensions" : {
    },
    "create_relationship" : "http://localhost:7474/db/data/node/2/relationships",
    "paged_traverse" : "http://localhost:7474/db/data/node/2/paged/traverse/{returnType}{?pageSize,leaseTime}",
    "all_relationships" : "http://localhost:7474/db/data/node/2/relationships/all",
    "incoming_typed_relationships" : "http://localhost:7474/db/data/node/2/relationships/in/{-list|&|types}"
  } ], [ {

などなど。各ノードで配信される URL は確かに適切ですが、送信されるデータの大部分を占めています。それらは非常に冗長であり、私のクエリの後ではありません。その 、、、、、、、、、、、、、 ジャズ traverseを すべてドロップ all_typed_relationshipsする 方法 propertyselfあり ます か ?propertiesoutgoing_typed_relationshipsincoming_relationshipsextensionscreate_relationshippaged_traverseall_relationshipsincoming_typed_relationships

4

1 に答える 1

2

唯一の方法は、returnステートメントで返すプロパティを指定することです。好き:

return id(n), n.glyph;
于 2013-02-06T04:18:03.807 に答える