建立及使用組織詞彙

Knowledge Catalog 可讓您建立組織詞彙,為資料資產建立標準化詞彙、減少語意模糊,並提升整個組織的資料探索效率。在本快速入門導覽課程中,您將使用零售業情境,搭配 BigQuery 中的樣本資料,建立商品目錄管理的類別階層。接著,您會定義「安全庫存量」等業務術語,將這些術語附加至 BigQuery 資料欄,並使用業務情境搜尋資料。

事前準備

設定專案:

  1. 登入 Google Cloud 帳戶。如果您未曾使用過 Google Cloud,歡迎 建立帳戶,親自體驗實際使用我們產品的成效。新客戶還能獲得價值 $300 美元的免費抵免額,用於執行、測試及部署工作負載。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

  5. Enable the Dataplex and BigQuery APIs, if any are not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  8. Verify that billing is enabled for your Google Cloud project.

  9. Enable the Dataplex and BigQuery APIs, if any are not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

必要的角色

如要取得建立及管理組織詞彙所需的權限,請要求管理員授予您下列 IAM 角色:

如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。

您或許也能透過自訂角色或其他預先定義的角色,取得必要權限。

建立零售業營運詞彙表

  1. 在 Google Cloud 控制台,依序前往「Knowledge Catalog」>「Glossaries」(詞彙表) 頁面。

    前往詞彙表

  2. 按一下「Create business glossary」(建立組織詞彙)。

  3. 在「Display name」(顯示名稱) 欄位中,輸入 Global Retail Operations Glossary。

  4. 在「Location」(位置) 清單中,選取「us (multiple regions in United States)」(us (多個美國區域))。

    多區域提供更高的可用性和韌性,單一區域則有助於滿足嚴格的資料落地規定。詳情請參閱「Knowledge Catalog 位置」。

  5. 點選「建立」。

建立類別階層

將字詞整理成階層結構,協助使用者瀏覽業務領域。最多可建立 3 個類別階層的巢狀結構。在本快速入門導覽課程中,請考慮下列類別:

  • 供應鏈與物流:代表整體供應鏈營運的父類別。

  • 庫存量:這個子類別用於將與庫存管理相關的特定指標和參數分組。

建立父類別

在這個部分,請建立 Supply Chain & Logistics 類別。

  1. 在 Global Retail Operations Glossary 的「Glossary details」(詞彙表詳細資料) 頁面中,按一下「Create category」(建立類別)。
  2. 在「Display name」(顯示名稱) 欄位中,輸入 Supply Chain & Logistics。
  3. 點選「建立」。

建立子類別

在本節中,請建立類別 Inventory Levels 做為 Supply Chain & Logistics 的子集。

  1. 在左側窗格的「Global Retail Operations Glossary」下方,選取「Supply Chain & Logistics」(供應鏈與物流) 類別。

  2. 在主窗格中,按一下「建立類別」。

  3. 在「Display name」(顯示名稱) 欄位中,輸入 Inventory Levels。

  4. 點選「建立」。

定義企業字詞

在零售業,一致的術語對於管理庫存、銷售和物流至關重要。定義字詞來擷取商業邏輯,並透過同義詞或相關字詞建立關聯。在本快速入門導覽課程中,請留意下列詞彙:

  • 安全庫存量:手邊保留的最低庫存量,避免因無法預測的需求或供應鏈中斷而缺貨。在本快速入門導覽課程中,這也稱為 Buffer Stock。

  • 前置時間:從向供應商下單到收到商品所需的時間。

將「安全庫存量」定義為業務術語

  1. 在左側窗格中選取「Inventory Levels」(廣告空間層級) 類別,然後按一下「Add term」(新增字詞)。
  2. 在「Display name」(顯示名稱) 欄位中輸入 Safety Stock Level,然後點選「Create」(建立)。
  3. 在「Terms details」(字詞詳細資料) 頁面中,按一下「Description」(說明) 的 「Add」(新增),然後輸入 Minimum inventory maintained to mitigate risk of stockouts during supply chain volatility.
  4. 按一下「儲存」。

新增「Buffer Stock」為同義詞

  1. 選取左側窗格中的「Inventory Levels」(廣告空間層級) 類別,然後按一下「Add term」(新增字詞)。
  2. 在「Display name」(顯示名稱) 欄位中輸入 Buffer Stock,然後點選「Create」(建立)。
  3. 在「Synonym terms」部分,按一下「Edit synonyms」。
  4. 搜尋 Safety Stock Level,選取該項目,然後按一下「Close」(關閉)。

定義「前置時間」並說明其與「緩衝庫存」的關係

  1. 選取左側窗格中的「Inventory Levels」(廣告空間層級) 類別,然後按一下「Add term」(新增字詞)。
  2. 在「Display name」(顯示名稱) 欄位中輸入 Lead Time,然後點選「Create」(建立)。
  3. 按一下「說明」旁邊的「新增」圖示 ,然後輸入 The time it takes from placing an order with a supplier to receiving the inventory.
  4. 按一下「儲存」。
  5. 在「相關字詞」部分,按一下「編輯相關字詞」。
  6. 搜尋 Buffer Stock,選取該項目,然後按一下「Close」(關閉)。

在 BigQuery 建立範例資料表

如要將建立的業務術語附加至實際資料資產,請先建立含有相關資料欄的資產。

  1. 前往 Google Cloud 控制台的「BigQuery」頁面。

    前往 BigQuery

  2. 如果是第一次使用 BigQuery,請按一下「Done」(完成) 關閉歡迎視窗。

  3. 在查詢編輯器中貼上以下查詢,建立範例資料集和資料表:

    CREATE SCHEMA omnichannel_prod OPTIONS(location="us");
    CREATE TABLE omnichannel_prod.daily_stock_summary (
      sku STRING,
      buffer_qty INT64,
      order_lead_time INT64
    );
    INSERT INTO omnichannel_prod.daily_stock_summary (sku, buffer_qty, order_lead_time)
    VALUES
      ('SH001', 50, 7),
      ('BT002', 20, 14),
      ('SH003', 60, 5),
      ('BT004', 30, 10),
      ('SH005', 70, 7),
      ('BT006', 40, 12),
      ('SH007', 80, 6);
    
  4. 按一下「 執行」。查詢成功後,omnichannel_prod 資料集會新增名為 daily_stock_summary 的資料表。

將字詞附加至資料表資料欄

  1. 在 Google Cloud 控制台,返回「Knowledge Catalog」>「Search」(搜尋) 頁面。

    前往搜尋

  2. 視需要重新整理頁面。

  3. 在「搜尋」列中輸入 omnichannel_prod.daily_stock_summary,然後按下「試用自然語言搜尋」。

  4. 在搜尋結果中,點選「daily_stock_summary」daily_stock_summary資料表,查看詳細資料。

  5. 按一下「結構定義」分頁標籤。

  6. 找到「buffer_qty」,並勾選該列中的核取方塊,然後按一下 「Add business term」(新增業務條款)。

  7. 在「Add business terms」(新增業務字詞) 窗格中,搜尋並選取 Safety Stock Level。

  8. 選取 order_lead_time 的資料列,然後按一下 「Add business term」(新增業務字詞)。

  9. 在「Add business terms」(新增業務術語) 窗格中,搜尋並選取 Lead Time。

使用業務情境搜尋資料

使用者現在可以使用商業語言尋找技術資產。

  1. 在 Google Cloud 控制台,依序前往「Knowledge Catalog」>「Search」(搜尋) 頁面。

    前往搜尋

  2. 嘗試下列搜尋,傳回 daily_stock_summary 資料表:

  3. 在搜尋列中輸入 term: "Safety Stock Level"。

  4. 按一下「試用自然語言搜尋」。

    daily_stock_summary 資料表隨即顯示。

  5. 在搜尋列中輸入 term: "Lead Time",然後按下 Enter 鍵。

    daily_stock_summary 資料表隨即顯示。

  6. 如要尋找使用同義詞關係連結的資產,請前往「Glossary」(詞彙) 頁面。

    前往詞彙表

  7. 按一下「Global Retail Operations Glossary」。

  8. 在左側導覽窗格中,依序點選「供應鏈與物流」>「庫存量」>「安全庫存量」。

    「Related entries」(相關項目) 會列出所有連結的資料資產。

如要建立大型詞彙表,請使用Knowledge Catalog 大量匯入功能,透過 JSON 或 CSV 檔案以程式輔助方式管理字詞。

清除所用資源

為了避免系統向您的 Google Cloud 帳戶收取本頁面所用資源的費用,請按照下列步驟操作。

刪除專案資源

如要避免系統向您的 Google Cloud 帳戶收取本快速入門導覽課程所用資源的費用,請刪除您建立的詞彙和資料集。

刪除詞彙表

  1. 在 Google Cloud 控制台,依序前往「Knowledge Catalog」>「Glossaries」(詞彙表) 頁面。

  2. 按一下「Global Retail Operations Glossary」。

  3. 請先刪除「供應鏈與物流」類別。

  4. 刪除「Inventory Levels」類別。

  5. 刪除所有企業字詞。

  6. 按一下「刪除」,即可刪除詞彙表。

  7. 確認刪除動作。

刪除 BigQuery 資料集

  1. 前往 Google Cloud 控制台的「BigQuery」頁面。

    前往 BigQuery

  2. 在「Explorer」面板中展開專案,然後找出 omnichannel_prod 資料集。

  3. 按一下 omnichannel_prod 資料集旁的「 查看動作」,然後選取「刪除」。

  4. 在對話方塊中輸入 delete 確認刪除,然後按一下「刪除」。

後續步驟