Aidp Semantic Model

作者 oracle-samples90b42d6c24d4無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Maintain a semantic grounding layer (.aidp/semantic.md) for AIDP — logical entity names, SQL-defined metrics, joins with cardinality, synonyms, and value dictionaries. Use when the user wants to define metrics/business terms, improve NL-to-SQL accuracy, standardize "revenue/customers/etc.", or set up a semantic model. Read by analyzing-data, verified-queries, profiling, and data-quality.

AI 產生的概覽

維護 .aidp/semantic.md 業務語意層,定義指標、連接、同義詞與值字典,為自然語言轉 SQL 提供依據。

功能
建立並維護語意基礎檔案 .aidp/semantic.md,記錄邏輯實體名稱、以 SQL 定義的指標、帶基數的連接、同義詞與值字典。它遵循既定格式,優先使用 SQL 表達式,其次才是範例 SQL 與自由文字。它不會憑空捏造欄位或值,而是從目錄讀取或與使用者確認,並可將指標驗證交由資料分析技能處理。
適用情境
適用於使用者想要定義指標或業務術語、統一「營收」「客戶」等術語、提升自然語言轉 SQL 的準確率,或建立語意模型的情境。適合需要在不同問題間維持一致、可重用業務語意的團隊。
執行需求
僅為說明文件,不附帶指令碼。需要已存在的 .aidp/catalog.md,並引用外部參考文件。可選的指標驗證會交由另一項技能,透過 Python 指令碼執行 Spark SQL。

aidp-semantic-model — the semantic grounding layer

Create and maintain .aidp/semantic.md: the business-meaning layer that grounds NL-to-SQL. This is the lever curated systems (Snowflake semantic model, Databricks Genie metrics/joins) rely on — without it, real-world NL-to-SQL accuracy is low.

When to use

  • Define metrics (revenue, active_customers, gross_margin…), logical names, joins, synonyms, or value sets.
  • The user wants consistent, reusable business semantics across questions.

Instruction hierarchy (most → least reliable)

  1. SQL expressions for metrics/filters (preferred).
  2. Example SQL for ambiguous prompts (store these via aidp-verified-queries).
  3. Free text only as a last resort.

Workflow

  1. Ensure .aidp/catalog.md exists (aidp-catalog-init) — the semantic model references real tables/columns.
  2. Edit .aidp/semantic.md per the format in references/semantic-model.md: logical entities, metrics (as SQL expressions), joins (with cardinality), synonyms, value dictionaries.
  3. Never invent columns/values — read them from the catalog or confirm with the user.
  4. Optionally validate a metric by running its SQL on a small sample — hand off to aidp-analyzing-data, which executes Spark SQL via python "$PLUGIN_DIR/scripts/aidp_sql.py" (no MCP required).
  5. Keep the per-domain working set small and focused.

AIDP native Ontologies (related feature — UI-driven)

AIDP ships a native Ontologies feature (RDF/OWL business glossary: terms, synonyms, definitions, a graph view, and ontology-driven governance like av:isSensitive / av:requiresRole). It overlaps this semantic layer but is UI-driven — no programmatic REST API was found (GET …/ontologies and …/workspaces/<ws>/ontologies both returned 404, probed 2026-06-10). So:

  • For an agent-usable, programmatic semantic/glossary layer today, use .aidp/semantic.md (this skill) — it's the API-free analog the agent can read/write and ground SQL with.
  • If the user specifically needs the native Ontologies (graph view, TTL/R2RML export, sensitivity governance), that is authored in the AIDP console UI; don't claim a REST endpoint for it. Sensitivity tags there feed masking governance (aidp-roles-access → masking section).

Notes

  • .aidp/semantic.md is user-editable and git-ignored (per-project).
  • Pairs with aidp-verified-queries (example/verified SQL) and aidp-analyzing-data (consumes both).

References

  • references/semantic-model.md · references/verified-queries.md

來源與署名

來源:oracle-samples/oracle-aidp-samples位於ai/claude-code-plugins/oracle-ai-data-platform-workbench-engineer-agent/skills/aidp-semantic-model提交90b42d6

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 oracle-samples/oracle-aidp-samples 的技能