【发布时间】:2014-06-18 09:18:21
【问题描述】:
有没有办法在 neo4j 中获得不那么冗长的 rest api 响应, 也许只有节点数据?在每个请求上发送所有额外的数据似乎有点浪费带宽。
为什么所有的元数据都包含在响应中?例如,基本 api url 在整个过程中重复,一旦你 拥有节点 ID,可以可靠地预测所有属性的 url 比如自我、属性、关系等等……它们看起来不像是非常不稳定的 url。
{
"extensions" : {
},
"paged_traverse" : "http://localhost:7474/db/data/node/183/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships" : "http://localhost:7474/db/data/node/183/relationships/out",
"traverse" : "http://localhost:7474/db/data/node/183/traverse/{returnType}",
"all_typed_relationships" : "http://localhost:7474/db/data/node/183/relationships/all/{-list|&|types}",
"all_relationships" : "http://localhost:7474/db/data/node/183/relationships/all",
"property" : "http://localhost:7474/db/data/node/183/properties/{key}",
"self" : "http://localhost:7474/db/data/node/183",
"outgoing_typed_relationships" : "http://localhost:7474/db/data/node/183/relationships/out/{-list|&|types}",
"properties" : "http://localhost:7474/db/data/node/183/properties",
"incoming_relationships" : "http://localhost:7474/db/data/node/183/relationships/in",
"incoming_typed_relationships" : "http://localhost:7474/db/data/node/183/relationships/in/{-list|&|types}",
"create_relationship" : "http://localhost:7474/db/data/node/183/relationships",
"data" : {
}
}
【问题讨论】:
-
是的,我认为它过于冗长。出于这个原因,我尽量避免返回节点和关系本身。
标签: neo4j