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 的技能