

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

# 開放程式碼圖形總管
<a name="visualization-graph-explorer"></a>

[圖形總管](https://github.com/aws/graph-explorer)是一種用於圖形資料的開放原始碼低程式碼視覺化探索工具，可在 Apache-2.0 授權下使用。它可讓您瀏覽圖形資料庫中的標記屬性圖 (LPG) 或資源描述架構 (RDF) 資料，而不必撰寫圖形查詢。圖形總管旨在協助資料科學家、商務分析師，以及組織中的其他角色，以互動方式探索圖形資料，而不必學習圖形查詢語言。

圖形總管提供了一個反應型 Web 應用程式，可以部署為容器來視覺化圖形資料。您可以連線到 Amazon Neptune 或其他圖形資料庫，而這些資料庫會提供 Apache TinkerPop Gremlin 或 SPARQL 1.1 端點。
+ 您可以使用分面篩選條件快速查看資料的摘要，或透過將文字輸入至搜尋列來搜尋資料。
+ 您也可以透過互動方式探索節點和邊緣連線。您可以檢視節點鄰近項目以查看物件彼此之間的關聯性，然後向下鑽研以視覺方式檢查邊緣和屬性。
+ 您也可以自訂圖形配置、顏色、圖示，以及要針對節點和邊緣顯示的預設屬性。對於 RDF 圖形，您也可以自訂資源 URI 的命名空間。
+ 對於涉及圖形資料的報告和簡報，您可以設定並儲存您以高解析度 PNG 格式所建立的檢視。您也可以將相關聯的資料下載至 CSV 或 JSON 檔案，以便進一步處理。

## 在 Neptune 圖形筆記本中使用圖形總管
<a name="graph-explorer-notebook"></a>

與 Neptune 一起使用圖形總管的最簡單方法是在 [Neptune 圖形筆記本中](graph-notebooks.md)使用。

如果您[使用 Neptune 工作台託管 Neptune 筆記本](graph-notebooks.md#graph-notebooks-workbench)，圖形總管會自動與筆記本一起部署，並連接到 Neptune。

建立筆記本之後，移至 Neptune 主控台以啟動圖形總管：

1. 移至 **Neptune**。

1. 在**筆記本**下，選擇您的筆記本。

1. 在「動作」下選擇**開啟圖形總管**

## 如何在 上的 Amazon ECS 中執行圖形探索程式 AWS Fargate 並連線至 Neptune
<a name="graph-explorer-on-fargate"></a>

您也可以建置圖形總管 Docker 映像檔，然後在本機電腦或託管服務 (例如 [Amazon Elastic Compute Cloud (Amazon EC2)](https://aws.amazon.com/ec2/) 或 [Amazon Elastic Container Service (Amazon ECS)](https://aws.amazon.com/ecs/)) 上執行，如[圖形總管 GitHub 專案](https://github.com/aws/graph-explorer)中 read-me 的[入門](https://github.com/aws/graph-explorer#getting-started)一節所述。

如範例所示，本節提供在 AWS Fargate上的 Amazon ECS 中執行圖形總管的逐步指示：

1. 建立新的 IAM 角色，並將這些政策附加到該角色。
   + [AmazonECSTaskExecutionRolePolicy](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy)
   + [CloudWatchLogsFullAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLogsFullAccess)

   讓角色名稱方便立即使用。

1. [建立 Amazon ECS 叢集](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-cluster-console-v2.html)，其中基礎設施設定為 FARGATE 並具有下列聯網選項：
   + `VPC`：設定為 Neptune 資料庫所在的 VPC。
   + `Subnets`：設定為該 VPC 的公有子網路 (移除所有其他子網路)。

1. 建立新的 JSON 任務定義，如下所示：

   ```
   {
     "family": "explorer-test",
     "containerDefinitions": [
       {
         "name": "graph-explorer",
         "image": "public.ecr.aws/neptune/graph-explorer:latest",
         "cpu": 0,
         "portMappings": [
           {
             "name": "graph-explorer-80-tcp",
             "containerPort": 80,
             "hostPort": 80,
             "protocol": "tcp",
             "appProtocol": "http"
           },
           {
             "name": "graph-explorer-443-tcp",
             "containerPort": 443,
             "hostPort": 443,
             "protocol": "tcp",
             "appProtocol": "http"
           }
         ],
         "essential": true,
         "environment": [
           {
             "name": "HOST",
             "value": "localhost"
           }
         ],
         "mountPoints": [],
         "volumesFrom": [],
         "logConfiguration": {
           "logDriver": "awslogs",
           "options": {
             "awslogs-create-group": "true",
             "awslogs-group": "/ecs/graph-explorer",
             "awslogs-region": "{region}",
             "awslogs-stream-prefix": "ecs"
           }
         }
       }
     ],
     "taskRoleArn": "arn:aws:iam::{account_no}:role/{role_name_from_step_1}",
     "executionRoleArn": "arn:aws:iam::{account_no}:role/{role_name_from_step_1}",
     "networkMode": "awsvpc",
     "requiresCompatibilities": [
       "FARGATE"
     ],
     "cpu": "1024",
     "memory": "3072",
     "runtimePlatform": {
       "cpuArchitecture": "X86_64",
       "operatingSystemFamily": "LINUX"
     }
   }
   ```

1. 使用預設設定啟動新任務，但下列欄位除外：
   + **Environment (環境)** 
     + 運算選項 => **啟動類型**
   + **Deployment configuration (部署組態)**
     + 應用程式類型 => **任務**
     + 系列 => *您的新 JSON 任務定義)*
     + 修訂版 => *(最新)*
   + **聯網**
     + VPC => *(您要連線至其中 Neptune VPC)*
     + 子網路 => *(僅限 VPC 的公有子網路 - 移除所有其他子網路)*
     + 安全群組 => **建立新的安全群組**
     + 安全群組名稱 => 圖形總管
     + 安全群組描述 => 用於存取圖形總管的安全群組
     + 安全群組的傳入規則 =>

       1. 80 Anywhere

       1. 443 Anywhere

1. 選取**建立**。

1. 任務開始後，複製執行中任務的公有 IP，然後導覽至：`https://(your public IP)/explorer`。

1. 接受使用已產生但無法辨識之憑證的風險，或將其新增至您的金鑰鏈。

1. 現在您可以將連線新增至 Neptune。為屬性圖 (LPG) 或 RDF 建立新連線，並設定下列欄位：

   ```
   Using proxy server => true
   Public or Proxy Endpoint => https://(your public IP address)
   Graph connection URL => https://(your Neptune endpoint):8182
   ```

您現在應該已連線。

## 圖形總管示範
<a name="graph-explorer-demo"></a>

這個短片讓您了解如何使用圖形總管輕鬆地將圖形資料視覺化：

![\[圖形總管僅文字示範影片\]](http://docs.aws.amazon.com/zh_tw/neptune/latest/userguide/images/graph-explorer.gif)
