23.7.1 非同期PGQL問合せの実行
POST https://localhost:7007/v2/runQueryAsync
プロパティ・グラフでPGQL問合せを非同期で実行します。
バージョン: v2
リクエスト
リクエスト・ヘッダー
- Accept:
application/json; charset=UTF-8 - Header:
Authorization: Bearer <token> - Content-Type:
application/json
リクエスト問合せのパラメータ: 詳細は、表23-3を参照してください。
サンプル・リクエスト本文
{
"statements": [
"CREATE PROPERTY GRAPH test_graph VERTEX TABLES (regions KEY (region_id), countries KEY (country_id))EDGE TABLES (countries AS countries_regions SOURCE KEY ( country_id ) REFERENCES
countries(country_id) DESTINATION KEY (region_id) REFERENCES regions(region_id) NO PROPERTIES ) OPTIONS (pg_pgql)",
"SELECT v FROM MATCH (v) ON test_graph LIMIT 1"
],
"driver": "PGQL_IN_DATABASE",
"parameters": {
"dynamicSampling": 2,
"parallel": 8,
"start": 0,
"size": 100
},
"visualize": true
レスポンス
- 202 OK
- Content-Type:
application/json
サンプル・レスポンス本文
{
"message": "Query execution started.",
"result_id": 0
}
cURLの例
curl --location --request POST 'https://localhost:7007/v2/runQueryAsync' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"statements": [
"CREATE PROPERTY GRAPH test_graph VERTEX TABLES (regions KEY (region_id), countries KEY (country_id))EDGE TABLES (countries AS countries_regions SOURCE KEY ( country_id ) REFERENCES
countries(country_id) DESTINATION KEY (region_id) REFERENCES regions(region_id) NO PROPERTIES ) OPTIONS ( pg_pgql)",
"SELECT v FROM MATCH (v) ON test_graph LIMIT 1"
],
"driver": "PGQL_IN_DATABASE",
"parameters": {
"dynamicSampling": 2,
"parallel": 8,
"start": 0,
"size": 100
},
"visualize": true
}'
親トピック: 非同期RESTエンドポイント