技術スタック:
- Tinkerpop スタック 2.4 (Rexster HTTP REST サーバー)
- タイタン 0.5.4
- ダイナモ DB (AWS)
- NodeJS
目標:
グラフ データベースのクエリとトラバーサルに Rexster RESTful ベースの API を利用したいと考えています。Vertex Query 構文に基づいて結果をフィルタリングするための _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 (データ型 Vertex クエリの文字列使用の例は示していません。)
- https://github.com/tinkerpop/blueprints/wiki/Vertex-Query
友よありがとう!
トム