claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

📊aidp-semantic-model

説明

AIDP のセマンティックグラウンディングレイヤー(`.aidp/semantic.md`)を管理します。 対象となる内容は、論理エンティティ名、SQL で定義されたメトリクス、カーディナリティを含むジョイン定義、シノニム(同義語)、および値ディクショナリです。 次のような場合に使用: - メトリクスやビジネス用語を定義したいとき - 自然言語から SQL への変換精度を向上させたいとき - 「revenue / customers」などの用語を標準化したいとき - セマンティックモデルをセットアップしたいとき このファイルは `analyzing-data`、`verified-queries`、`profiling`、`data-quality` の各コンポーネントから参照されます。

原文を表示

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.

ユースケース

  • メトリクスやビジネス用語を定義する
  • 自然言語からSQL変換精度を向上させる
  • 用語を標準化するとき
  • セマンティックモデルをセットアップするとき

本文(日本語訳)

aidp-semantic-model — セマンティック・グラウンディング層

.aidp/semantic.md の作成・管理を行います。 これは NL-to-SQL(自然言語からSQLへの変換)を意味的に裏付けるビジネス意味層です。 Snowflake セマンティックモデルや Databricks Genie のメトリクス・ジョイン定義といった キュレーション型システムが依存する核となる仕組みであり、 これが存在しない場合、実運用における NL-to-SQL の精度は低くなります。


次のような場合に使用:

  • メトリクス(revenue、active_customers、gross_margin など)、論理名、ジョイン、シノニム、値セットを定義したい場合
  • 複数の質問にわたって一貫性のある再利用可能なビジネスセマンティクスをユーザーが必要としている場合

指示の優先階層(信頼性: 高 → 低)

  1. SQL 式 によるメトリクス・フィルターの定義(推奨)
  2. SQL 例 による曖昧なプロンプトへの対応(aidp-verified-queries を通じて保存)
  3. フリーテキスト は最終手段としてのみ使用

ワークフロー

  1. .aidp/catalog.md が存在することを確認する(aidp-catalog-init を使用) — セマンティックモデルは実在するテーブル・カラムを参照するため、カタログが前提となります。

  2. references/semantic-model.md に定めたフォーマットに従い .aidp/semantic.md を編集する: 論理エンティティ、メトリクス(SQL式として記述)、ジョイン(カーディナリティを含む)、 シノニム、値ディクショナリを記載します。

  3. カラムや値は 絶対に創作しない こと — カタログから読み取るか、ユーザーに確認して下さい。

  4. 必要に応じて、小さなサンプルデータに対して SQL を実行しメトリクスを検証する — aidp-analyzing-data に処理を委譲すると、 python "$PLUGIN_DIR/scripts/aidp_sql.py" 経由で Spark SQL が実行されます(MCP 不要)。

  5. ドメインごとの作業セットは小さく、焦点を絞った状態に保つ。


AIDP ネイティブ Ontologies(関連機能 — UI 操作)

AIDP にはネイティブの Ontologies 機能が搭載されています (RDF/OWL ベースのビジネスグロッサリー: 用語、シノニム、定義、グラフビュー、 および av:isSensitive / av:requiresRole などオントロジー駆動のガバナンス機能)。

この機能は本セマンティック層と重複する部分がありますが、UI 操作前提であり、 プログラマティックな REST API は確認されていませんGET …/ontologies および …/workspaces/<ws>/ontologies はいずれも 404 を返すことを 2026-06-10 に確認済み)。

そのため:

  • Agent から利用可能なプログラマティックなセマンティック・グロッサリー層が必要な場合は、 .aidp/semantic.md(本スキル)を使用してください。 これは API を必要とせず、agent が読み書きして SQL のグラウンディングに利用できるものです。

  • ユーザーがネイティブ Ontologies(グラフビュー、TTL/R2RML エクスポート、 センシティビティガバナンス)を特に必要としている場合は、 AIDP コンソール UI で作成するものであり、REST エンドポイントが存在するかのように案内しないでください。 そこで設定されたセンシティビティタグはマスキングガバナンスに反映されます (aidp-roles-access → マスキングセクション)。


補足

  • .aidp/semantic.md はユーザーが直接編集可能で、.gitignore 対象です(プロジェクト単位)。
  • aidp-verified-queries(例示・検証済み SQL)および aidp-analyzing-data(両者を参照して実行)と組み合わせて使用します。

参考資料

原文(English)を表示

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-drivenno 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

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。