エッジとグラフ
Show:
バケットエッジは、supersedes、references、part_ofなど、バケット内のノード間の関係を表します。これらのエッジを直接読み書きするv1ルートは、もはや公開コンシューマーAPIではありません。
注: 新しい統合ではこれらのルートを使用しないでください。Schiftは検索中に内部で関係シグナルを使用することがありますが、生のグラフエッジはサポートされている公開インターフェースではありません。v2バケット検索を使用してユーザー向けの取得を行ってください。
APIバージョン
Section titled “APIバージョン”| Version | Status | Notes |
|---|---|---|
v1 | Deprecated | 直接エッジ変更ルート。既存の内部呼び出しのみで保持。 |
v2 | Current | バケット検索を介して関連コンテンツを取得。 |
POST /v1/buckets/{bucket_id}/edges
Section titled “POST /v1/buckets/{bucket_id}/edges”バケットにエッジを追加します。
注: このエンドポイントは非推奨であり、公開OpenAPIスキーマには含まれていません。
パスパラメータ
Section titled “パスパラメータ”| Name | Type | Description |
|---|---|---|
bucket_id | string | バケットのUUID。 |
リクエストボディ
Section titled “リクエストボディ”| Name | Type | Required | Description |
|---|---|---|---|
edges | array | Yes | 最大10,000のエッジオブジェクト。 |
edges[].source | string | Yes | ソースノードID。 |
edges[].target | string | Yes | ターゲットノードID。 |
edges[].relation | string | No | contradicts、supersedes、caused_by、is_a、related_to(デフォルト)、has_child、follows、references、summarizes、alias_of、part_ofのいずれか。 |
edges[].weight | number | No | 0.0から1.0の信頼度。デフォルトは1.0。 |
リクエスト例
Section titled “リクエスト例”curl -X POST ${API_BASE_URL:-https://api.schift.io}/v1/buckets/550e8400-e29b-41d4-a716-446655440000/edges \ -H "Authorization: Bearer $SCHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "edges": [ { "source": "node-1", "target": "node-2", "relation": "supersedes", "weight": 0.95 } ] }'レスポンス例
Section titled “レスポンス例”{ "count": 1}// 400 invalid_relation_type{ "error": "invalid_relation_type", "unknown_relation_types": ["supersedes"]}// 402 Payment Required{ "allowed": false, "reason": "quota_exceeded"}// 403 Forbidden{ "detail": "Ingest quota unavailable. Upgrade your plan."}// 404 Not Found{ "detail": "Bucket not found"}GET /v1/buckets/{bucket_id}/edges/{node_id}
Section titled “GET /v1/buckets/{bucket_id}/edges/{node_id}”ノードに接続されたエッジを一覧表示します。
注: このエンドポイントは非推奨であり、公開OpenAPIスキーマには含まれていません。
パスパラメータ
Section titled “パスパラメータ”| Name | Type | Description |
|---|---|---|
bucket_id | string | バケットのUUID。 |
node_id | string | クエリ対象のノードID。 |
クエリパラメータ
Section titled “クエリパラメータ”| Name | Type | Required | Description |
|---|---|---|---|
direction | string | No | outgoing(デフォルト)、incoming、またはboth。 |
relation | string | No | 単一の関係タイプにフィルタリング。バケットのオントロジーで定義されている必要があります。 |
リクエスト例
Section titled “リクエスト例”curl -G ${API_BASE_URL:-https://api.schift.io}/v1/buckets/550e8400-e29b-41d4-a716-446655440000/edges/node-1 \ -H "Authorization: Bearer $SCHIFT_API_KEY" \ -d "direction=both" \ -d "relation=supersedes"レスポンス例
Section titled “レスポンス例”{ "node_id": "node-1", "direction": "both", "edges": [ { "source": "node-1", "target": "node-2", "relation": "supersedes", "weight": 0.95 } ]}// 400 invalid_relation_type{ "error": "invalid_relation_type", "unknown_relation_types": ["supersedes"]}// 404 Not Found{ "detail": "Bucket not found"}DELETE /v1/buckets/{bucket_id}/edges
Section titled “DELETE /v1/buckets/{bucket_id}/edges”特定のエッジを削除します。
注: このエンドポイントは非推奨であり、公開OpenAPIスキーマには含まれていません。
パスパラメータ
Section titled “パスパラメータ”| Name | Type | Description |
|---|---|---|
bucket_id | string | バケットのUUID。 |
リクエストボディ
Section titled “リクエストボディ”| Name | Type | Required | Description |
|---|---|---|---|
source | string | Yes | ソースノードID。 |
target | string | Yes | ターゲットノードID。 |
relation | string | No | 関係タイプ。デフォルトはrelated_to。バケットのオントロジーで定義されている必要があります。 |
リクエスト例
Section titled “リクエスト例”curl -X DELETE ${API_BASE_URL:-https://api.schift.io}/v1/buckets/550e8400-e29b-41d4-a716-446655440000/edges \ -H "Authorization: Bearer $SCHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "source": "node-1", "target": "node-2", "relation": "supersedes" }'レスポンス例
Section titled “レスポンス例”成功時には204 No Content。
// 400 invalid_relation_type{ "error": "invalid_relation_type", "unknown_relation_types": ["supersedes"]}// 404 Not Found{ "detail": "Bucket not found"}v2バケット検索で置き換え
Section titled “v2バケット検索で置き換え”生のエッジを読む代わりに、自然言語クエリをv2検索エンドポイントに送信します。
curl -X POST ${API_BASE_URL:-https://api.schift.io}/v2/buckets/550e8400-e29b-41d4-a716-446655440000/search \ -H "Authorization: Bearer $SCHIFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "Which policy supersedes the old refund rule?", "top_k": 8, "options": { "rerank": {"enabled": true} } }'