【发布时间】:2016-03-09 13:32:44
【问题描述】:
技术栈:
- Tinkerpop Stack 2.4(Rexster HTTP REST 服务器)
- 泰坦 0.5.4
- DynamoDB (AWS)
- NodeJS
目标:
我想利用基于 Rexster RESTful 的 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://localhost:8182/graphs/mygraph/vertices
{
"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://localhost:8182/graphs/privvy/vertices/25600768/both?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?properties=[[name,=,(s,John Doe)]]
回应:
{
"version": "2.5.0",
"results": [],
"totalSize": 0,
"queryTime": 22.641152
}
其他信息:
如果我只是将 =(等于运算符)切换到 (不等于)运算符,则以下 URI 会返回一组相邻顶点的结果:
请求:
_http://localhost:8182/graphs/privvy/vertices/25600768/both?properties=[[name,,"John Doe"]]
回应:
{
"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
感谢朋友们!
汤姆
【问题讨论】:
标签: rest titan gremlin tinkerpop tinkerpop-blueprint