技术堆栈:TinkerPop有关堆栈Rexster REST API _properties
- TinkerPop有关堆栈2.4(Rexster HTTP REST服务器)
- 泰坦0.5.4
- DynamoDB(AWS)
- 的NodeJS
目标:
我想利用基于Rexster REST的API来查询和遍历我的图形数据库。我想了解用于根据顶点查询语法过滤结果的_properties查询参数。顶点查询的
结果:
http://localhost:8182/graphs/mygraph/vertices { "version": "2.5.0", "results": [ { "name": "Frank Stein", "_id": 25600768, "_type": "vertex" }, { "name": "John Doe", "_id": 25600512, "_type": "vertex" } ], "totalSize": 2, "queryTime": 219.86688 }
边缘查询的结果:
HTTP://本地主机:8182 /图形/ mygraph /顶点
{ "version": "2.5.0", "results": [ { "_id": "f8q68-f8phc-4is5-f8pog", "_type": "edge", "_outV": 25600512, "_inV": 25600768, "_label": "friends" } ], "totalSize": 1, "queryTime": 164.384768 }
问题:
这些URI的不回什么,我假设我就会回来,总是返回一个空集:
请求:
_http://本地主机: 8182 /图表/ privvy /顶点/ 25600768 /两者兼而有之? properties = [[name,=,“John Doe”]] _http:// localhost:8182/graphs/privvy/vertices/25600768/both? properties = [[name,=,John Doe]] _http:// localhost:8182/graphs/privvy/vertices/25600768/both? properties = [[name,=,(s,“John Doe”)]] _http:// localhost:8182/graphs/privvy/vertices/25600768/both? 属性= [[名称,=,(S,John Doe的)]]
响应:
{ "version": "2.5.0", "results": [], "totalSize": 0, "queryTime": 22.641152 }
附加信息:
以下URI并返回一个如果我只是将=(等于运算符)切换到<>(不等于)运算符:
请求:
_http://本地主机:8182 /图表/ privvy /顶点/ 25600768 /两者兼而有之?性能= [[名,<>, “李四”]]
响应:
{ "version": "2.5.0", "results": [ { "name": "John Doe", "_id": 25600512, "_type": "vertex" } ], "totalSize": 1, "queryTime": 17.451008 }
任何人有,我可能是想错了什么线索?
参考:
- https://github.com/tinkerpop/rexster/wiki/Basic-REST-API
- https://github.com/tinkerpop/rexster/wiki/Property-Data-Types(显示字符串使用没有例子的数据类型的顶点查询。)
- https://github.com/tinkerpop/blueprints/wiki/Vertex-Query
感谢朋友们!
汤姆
感谢这个信息。从你指出的情况来看,Vertex Query的用例可能是基于边缘遍历和过滤的,但是我发现很难相信我需要将顶点的属性去标准化为边缘来完成我正在努力做的目标。彻底击败DB/Graph系统的目的。我需要找到一种方法来过滤顶点属性上的查询,也许我需要查看此技术栈的顶点键。 –
除非您的图形有一些标准,每个顶点有数百万条边,否则非规范化可能不是需要考虑的事情。您可以使用Gremlin轻松过滤您在问题中描述的方式(即通过顶点属性),但您无法使用Rexster公开的标准REST API执行此操作。所以,如果你需要这样做,我只需要使用Rexster的Gremlin Extension。顺便说一句,注意Rexter不再是正在开发的 - 见小鬼服务器的TinkerPop有关3,如果你是刚刚起步:http://tinkerpop.apache.org/docs/3.1.0-incubating/#gremlin-server –
而现在,您可以将TP3和Titan 1.0.0用于DynamoDB:https://github.com/awslabs/dynamodb-titan-storage-backend –