

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 Gremlin 存取 Neptune 圖形
<a name="access-graph-gremlin"></a>

Amazon Neptune 與 Apache TinkerPop 和 Gremlin 相容。這表示您可以連線至 Neptune 資料庫執行個體，並使用 Gremlin 周遊語言來查詢圖形 （請參閱 Apache TinkerPop 文件中的[圖形](https://tinkerpop.apache.org/docs/current/reference/#graph))。如需 Neptune 實作 Gremlin 時的差異，請參閱 [Gremlin 標準合規](access-graph-gremlin-differences.md)。

 Gremlin 中的「周遊」**是一系列的鏈結步驟。它從頂點 (或邊緣) 開始。它先沿著每個頂點的外緣，再沿著這些頂點的外緣導出圖形。每個步驟皆是周遊的操作。如需詳細資訊，請參閱 TinkerPop 文件中的[周遊](https://tinkerpop.apache.org/docs/current/reference/#traversal)。

不同的 Neptune 引擎版本支援不同的 Gremlin 版本。檢查您正在執行的 Neptune 版本的[引擎版本頁面](engine-releases.md)，以判斷其支援的 Gremlin 版本，或參閱下表，其中列出不同 Neptune 引擎版本支援的最早和最新版本 TinkerPop：


| Neptune 引擎版本 | 最低 TinkerPop 版本 | 最高 TinkerPop 版本 | 
| --- | --- | --- | 
| `1.3.2.0 and newer` | `3.7.1` | `3.7.3` | 
| `1.3.1.0` | `3.6.2` | `3.6.5` | 
| `1.3.0.0` | `3.6.2` | `3.6.4` | 
| `1.2.1.0 <= 1.2.1.2` | `3.6.2` | `3.6.2` | 
| `1.1.1.0 <= 1.2.0.2` | `3.5.5` | `3.5.6` | 
| `1.1.0.0 and older` | `(deprecated)` | `(deprecated)` | 

TinkerPop 用戶端通常在序列 （例如`3.6.x`， 或 `3.7.x`) 中向後相容，雖然它們通常可以跨這些邊界運作，但上表建議使用版本組合，以獲得最佳體驗和相容性。除非另有建議，否則通常最好遵守這些準則並升級用戶端應用程式，以符合您正在使用的 TinkerPop 版本。

升級 TinkerPop 版本時，請務必參考 [TinkerPop 的升級文件](http://tinkerpop.apache.org/docs/current/upgrade/)，這將協助您識別可以利用的新功能，但在您接近升級時可能需要注意的問題。您通常應該預期現有的查詢和功能會在升級後運作，除非有特定事項被呼叫為要考慮的問題。最後，請務必注意，如果您升級為具有新功能的版本，如果版本高於 Neptune 支援的版本，則可能無法使用該版本。

有 Gremlin 語言變體和各種程式設計語言中的 Gremlin 存取支援。如需詳細資訊，請參閱 TinkerPop 文件中的 [Gremlin 語言變體](https://tinkerpop.apache.org/docs/current/reference/#gremlin-drivers-variants)。

本文件說明如何使用下列變體和程式設計語言存取 Neptune：
+ [設定 Gremlin 主控台來連線至 Neptune 資料庫執行個體](access-graph-gremlin-console.md)
+ [使用 HTTP REST 端點連線至 Neptune 資料庫執行個體](access-graph-gremlin-rest.md)
+ [要與 Amazon Neptune 搭配使用的 Java 型 Gremlin 用戶端](access-graph-gremlin-client.md)
+ [使用 Python 連線至 Neptune 資料庫執行個體](access-graph-gremlin-python.md)
+ [使用 .NET 連線至 Neptune 資料庫執行個體](access-graph-gremlin-dotnet.md)
+ [使用 Node.js 連線至 Neptune 資料庫執行個體](access-graph-gremlin-node-js.md)
+ [使用 Go 連線至 Neptune 資料庫執行個體](access-graph-gremlin-go.md)

如 [使用 SSL/HTTPS 加密 Amazon Neptune 資料庫的連線](security-ssl.md) 中所述，當連線至 Neptune 時，您必須在所有的 AWS 區域中使用 Transport Layer Security/Secure Sockets Layer (TLS/SSL)。

開始之前，您必須準備好以下事項：
+ Neptune 資料庫執行個體。如需建立 Neptune 資料庫執行個體的相關資訊，請參閱 [建立 Amazon Neptune 叢集](get-started-create-cluster.md)。
+ 與您的 Neptune 資料庫執行個體位於同一虛擬私有雲端 (VPC) 的 Amazon EC2 執行個體。

如需有關將資料載入至 Neptune 的詳細資訊，包括先決條件、載入格式及載入參數，請參閱 [將資料載入至 Amazon Neptune](load-data.md)。

**Topics**
+ [設定 Gremlin 主控台來連線至 Neptune 資料庫執行個體](access-graph-gremlin-console.md)
+ [使用 HTTP REST 端點連線至 Neptune 資料庫執行個體](access-graph-gremlin-rest.md)
+ [要與 Amazon Neptune 搭配使用的 Java 型 Gremlin 用戶端](access-graph-gremlin-client.md)
+ [使用 Python 連線至 Neptune 資料庫執行個體](access-graph-gremlin-python.md)
+ [使用 .NET 連線至 Neptune 資料庫執行個體](access-graph-gremlin-dotnet.md)
+ [使用 Node.js 連線至 Neptune 資料庫執行個體](access-graph-gremlin-node-js.md)
+ [使用 Go 連線至 Neptune 資料庫執行個體](access-graph-gremlin-go.md)
+ [使用 AWS SDK 執行 Gremlin 查詢](access-graph-gremlin-sdk.md)
+ [Gremlin 查詢提示](gremlin-query-hints.md)
+ [Gremlin 查詢狀態 API](gremlin-api-status.md)
+ [Gremlin 查詢取消](gremlin-api-status-cancel.md)
+ [支援 Gremlin 指令碼型工作階段](access-graph-gremlin-sessions.md)
+ [Neptune 中的 Gremlin 交易](access-graph-gremlin-transactions.md)
+ [搭配 Amazon Neptune 使用 Gremlin API](gremlin-api-reference.md)
+ [在 Amazon Neptune Gremlin 中快取查詢結果](gremlin-results-cache.md)
+ [使用 Gremlin `mergeV()` 和 `mergeE()` 步驟進行有效的 upsert](gremlin-efficient-upserts.md)
+ [使用 `fold()/coalesce()/unfold()` 進行有效的 Gremlin upsert](gremlin-efficient-upserts-pre-3.6.md)
+ [使用 Gremlin `explain` 分析 Neptune 查詢執行](gremlin-explain.md)
+ [搭配 Neptune DFE 查詢引擎使用 Gremlin](gremlin-with-dfe.md)