Ontology CLI
MicrosoftOfficialPublished by Microsoft
- Skill
- Tool integration
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The ontology-cli skill provides a specialized interface for interacting with Microsoft Fabric Ontology items. It operates in two distinct, non-convertible modes: an authoring mode for managing legacy V1 entity and relationship definitions, and a consumption mode for querying new-experience (V2) Ontologies. The skill acts as a mode dispatcher, requiring users to read specific reference documentation before executing commands to ensure correct payload generation and state management. It does not support V1-to-V2 upgrades or V2 authoring.
What it does
- Creates and updates legacy V1 Ontology entity and relationship definitions.
- Answers natural-language questions about existing new-experience (V2) Ontologies.
- Generates grounded code or data insights from V2 Ontologies via the Ontology Agent.
- Manages data bindings for V1 Ontology entity types.
- Provides a structured workflow for resolving workspace and item identifiers.
When to use it
- When you need to define or modify the structure of a legacy V1 Ontology.
- When you need to query data or metadata from a new-experience (V2) Ontology.
- When you need to generate runnable code based on V2 Ontology rules.
- When you are working within the Microsoft Fabric ecosystem and require specific Ontology item operations.
Advantages
- Ensures grounded, validated responses by using the Ontology Agent for V2 queries.
- Provides a clear separation between legacy authoring and modern consumption workflows.
- Reduces errors by enforcing mandatory reference reading before command execution.
- Maintains consistency in Fabric item management through standardized CLI patterns.
Usage examples
- “Using the ClinicOperations ontology, how many clinics are there?”
- The agent enters consumption mode, verifies the ontology, and queries the data to return the clinic count.
- “Create a legacy V1 ontology item with Customer and Order entity types bound to the lakehouse.”
- The agent enters authoring mode, prepares the required JSON definition tree, and executes the creation call.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/microsoft/ontology-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip ontology-cli.zip -d .agents/skills
Documentation by Microsoft
Telemetry — MANDATORY. Every
api.fabric.microsoft.comcall must carryx-ms-fabric-skill: ontology-cli(az rest:--headers "x-ms-fabric-skill=ontology-cli"), including every LRO poll,fabric_lroand retry. Snippets omit it — add it anyway.
CRITICAL NOTES
To find the workspace details (including its ID) from workspace name: list all workspaces and, then, use JMESPath filtering
To find the item details (including its ID) from workspace ID, item type, and item name: list all items of that type in that workspace and, then, use JMESPath filtering
Skill disambiguation: use
ontology-clifor operations on an Ontology item and questions grounded in that Ontology. Natural-language data questions over existing Power BI reports/models arefabriciq; report creation, editing, publishing, or rebinding ispowerbi-report-cli; semantic-model or DAX authoring issemantic-model-authoring. Naming an Ontology as a report's data source does not move report authoring into this skill.Consumption runs through the Ontology Agent MCP server, never around it. Do not decode an ontology definition to hand-compose KQL / T-SQL / Spark SQL, and do not delegate ontology data questions to
eventhouse-cli/sqldw-cli/spark-cli. That path loses the agent's grounding and validation and is not metered.Natural-language consumption supports only new-experience (V2) Ontologies. Call
tools/listfirst. Ifask_ontologyis absent, stop and tell the user that V1 natural-language queries are unsupported and the Ontology must be upgraded or recreated in the new experience outside this skill's authoring flow. Never fall back tosearch_ontology.Authoring is legacy V1-only. The JSON
EntityTypes/.../definition.jsonitem-definition flow below cannot create, convert, or upgrade a new-experience (V2) Ontology. Do not route a V2 upgrade/recreation request intoauthoring.Kusto bindings use the parent Eventhouse item ID, never the KQL database ID. Validate the staged binding against discovered source metadata before presenting an authoring preview; unresolved or mismatched source identities block the write.
Ontology CLI Skill
This skill owns two explicit, non-convertible surfaces: legacy V1 JSON-definition authoring, and read-only questions over existing new-experience (V2) Ontologies through the Ontology Agent MCP endpoint. It does not upgrade V1 items to V2 or author V2 items.
It is a mode dispatcher and contains NO procedures. Pick the mode that matches the request from the table below, then read the matching references/<mode>.md file end to end with your file-reading tool BEFORE issuing a single command. That file holds the endpoints, payload shapes, templates and gotchas; acting without it produces wrong payloads and wrong results.
Mode selection
| Mode | Use when the request ... | Example triggers | Read this first |
|---|---|---|---|
authoring | creates or updates a legacy V1 Ontology's JSON entity/relationship definitions or data bindings; V2 creation/upgrade is out of scope | create legacy ontology item, bind V1 entity type, add V1 relationship type, update legacy ontology definition | references/authoring.md |
consumption | asks a question about an existing new-experience (V2) Ontology -- its data, entities, or rules -- or wants grounded runnable code generated from it | how many clinics are there, which treatment rooms are busiest, what entities exist, list the ontology rules, generate KQL from this ontology | references/consumption.md |
Consumption sub-references (read directly, not through chained links):
references/consumption/examples.md: verified calls, worked examples and troubleshooting.
references/consumption/request-files.md: read before preparing a PowerShell MCP request; absolute payload paths and local JSON validation.
Mode boundary rule
consumption is read-only. Any definition write goes through the authoring mode's preview-and-confirm flow -- never call updateDefinition from a consumption request.
If a request genuinely spans modes, handle them one at a time and read each reference before you start that part. If the mode is ambiguous after reading this table, ask one short clarifying question instead of guessing.
Terminal write -- the step you must not skip
Reading the reference and planning the change is NOT completing the task. Each mutating mode ends with one state-changing call. If you did not issue it, nothing was persisted -- say so explicitly rather than reporting success.
| Mode | Terminal write |
|---|---|
authoring | createItem (POST /v1/workspaces/{ws}/items) to create a legacy V1 Ontology, then POST .../updateDefinition to persist entity types, relationships and bindings. This cannot create or upgrade V2. |
consumption | none -- this mode is read-only |
Before you report the task done, confirm the terminal call returned success and, where the reference documents a readback, read the artefact back to prove the change landed.
Shared essentials (all modes)
Resolve the workspace and item first; every mode depends on it.
| Task | Reference | Notes |
|---|---|---|
| Finding Workspaces and Items in Fabric | COMMON-CLI.md | Mandatory -- read before resolving any workspace or item id |
| Catalog Search | COMMON-CORE.md | Request/response shape, Catalog.Read.All scope, 24 h indexing delay |
| Pagination Pattern | COMMON-CLI.md | Catalog Search and item listings both page via continuationToken |
| Fabric Topology & Key Concepts | COMMON-CORE.md | Item types, workspaces, capacities |
| Environment URLs | COMMON-CORE.md | Sovereign / non-public cloud hosts |
| Authentication & Token Acquisition | COMMON-CORE.md | Wrong audience = 401; read before any auth issue |
| Authentication Recipes | COMMON-CLI.md | az login flows and token acquisition |
| Core Control-Plane REST APIs | COMMON-CORE.md | Pagination, LRO polling, rate limiting |
| Gotchas & Troubleshooting | COMMON-CLI.md | az rest audience, shell escaping, token expiry |
Rules
MUST
Select exactly one mode from the table above before doing anything else.
Read
references/<mode>.mdend to end, as your FIRST tool call, before the first command of that mode. Read it ONCE, in a single full read: do not re-open it, do not grep it again, and do not page through it. You already have it.Apply the same read-once discipline to every other file you load, including nested
references/<mode>/*.mdsub-references and sharedcommon/*.mdfiles: open only the ones you actually need, read each ONCE end to end, and never grep or re-open one you already loaded.Resolve workspace and item ids by listing and filtering, never by guessing a GUID.
In
consumption, calltools/listbefore the firsttools/call. Continue only whenask_ontologyis present; otherwise report that V1 natural-language consumption is unsupported and stop without calling another ontology tool.Announce a mode switch explicitly when the request crosses a boundary.
Treat the reference as instructions, never as the deliverable. After reading it, RUN the documented commands against the live workspace and report the real results. Quoting what the reference says instead of executing it does not answer the request.
PREFER
The narrowest mode that satisfies the request.
Reading exactly ONE mode reference. Load a second only when the request genuinely spans modes, and say so before you do.
Reporting the mode you chose in your first response so the user can correct you.
AVOID
Acting from this dispatcher alone -- it intentionally omits the operational detail.
Answering with a summary of the reference instead of executing it.
Re-reading or re-grepping a reference you already loaded; it costs turns and tokens.
Mutating anything while in a read-only mode.
Answering an ontology data question with a hand-composed source query instead of the Ontology Agent MCP (see CRITICAL NOTE 4).
Loading a different skill for work this family already owns (see CRITICAL NOTES 3).
Examples
| User request | Mode | Reference to read |
|---|---|---|
| "Using the ClinicOperations ontology, how many clinics are there?" | consumption | references/consumption.md |
| "Create a legacy V1 ontology item with Customer and Order entity types bound to the lakehouse." | authoring | references/authoring.md |
| "Upgrade this V1 ontology to the new V2 experience." | out of scope | Explain that V2 upgrade/recreation is unavailable through this skill's authoring flow |
| "What entity types exist in the Sales ontology and how are they bound?" | consumption | references/consumption.md |
| "Generate Eventhouse-runnable KQL for appointments per practitioner from this ontology." | consumption | references/consumption.md |
Files
- ATTRIBUTION.mdAdded by AutoGineer869 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md9.9 KiB
- apm.yml393 B
- references/authoring.md47.3 KiB
- references/authoring/ONTOLOGY-AUTHORING-CORE.md17.7 KiB
- references/authoring/authoring-mechanics.md17.9 KiB
- references/authoring/definition-script-templates.md12.5 KiB
- references/authoring/examples.md9.8 KiB
- references/authoring/preview-and-confirm.md14.0 KiB
- references/consumption.md18.9 KiB
- references/consumption/examples.md18.6 KiB
- references/consumption/request-files.md1.3 KiB
references/authoring/preview-and-confirm.md
Preview & Confirm — Author-Time Design Review
Before invoking
createItemorupdateDefinition(the LRO write), the agent must render a preview of what's about to be authored and obtain explicit user confirmation. This prevents schema drift, accidental property type changes, and unintended drops of bindings/relationships.
Two modes:
Greenfield — creating a new ontology, or composing one from scratch → render a proposal.
Brownfield — updating an existing ontology → render a change set vs. the
getDefinitionsnapshot.
Both modes use the same emoji scheme and the same three layout tiers. ASCII boxes + emojis (no Mermaid, no ANSI) so the preview renders identically in any terminal, chat surface, or notebook.
1. Emoji legend (use these consistently)
| Emoji | Meaning | Emoji | Meaning |
|---|---|---|---|
| 🏢 | entity type | ➕ | ADD (new) |
| 🔑 | key / PK | 🔧 | MOD (changed) |
| 📈 | timeseries property | ➖ | DEL (removed) |
| 🔗 | relationship | ✅ | KEEP (unchanged) |
| 🏬 | lakehouse source | ⚠️ | risky change |
| ⚡ | eventhouse source | 📁 | group / folder |
2. Tier selection (auto)
Pick the tier by post-update entity count (so a brownfield update with 4 existing + 26 new → Tier 3):
| Entities | Tier | Layout |
|---|---|---|
| ≤ 5 | Tier 1 | ASCII boxes per entity + relationships rendered between boxes |
| 6–15 | Tier 2 | Entity inventory table + adjacency-list relationships |
| 16+ | Tier 3 | Group summary + paginated inventory + adjacency list; details on demand |
3. Tier 1 — ≤ 5 entities (boxes)
📁 Workspace : <ws-name> Folder : <folder-name>
📊 Entities : 2 🔗 Relations : 1 📌 Bindings : 3 (1 📈)
┌───────────────────────────┐ ┌─────────────────────────────────┐
│ 🏢 HUB │ │ 🏢 AIRCRAFT │
├───────────────────────────┤ ├─────────────────────────────────┤
│ 🔑 HubId string │ 🔗 operates │ 🔑 TailNumber string │
│ HubName string │ 1 ───────────► * │ Manufacturer string │
│ City string │ │ 📈 ObservedAt datetime │
│ │ │ 📈 AltitudeFt double │
│ │ │ 📈 GroundSpeedKts double │
└───────────────────────────┘ └─────────────────────────────────┘
🏬 LH dbo.hubs 🏬 LH dbo.aircrafts (static)
⚡ EH AircraftReadings (TS, ts=ObservedAt)
🔗 operates ➜ 🏬 LH dbo.zava_hub_aircraft_link
hub_id → Hub.HubId
tail_number → Aircraft.TailNumberBox conventions:
One box per entity. Title =
🏢 <NAME>in caps.Properties listed inside, one per line:
<emoji> <name> <type>aligned in two columns.🔑only on key properties (entityIdParts);📈only on timeseries properties.Below the box:
🏬 LH …static binding line, then⚡ EH …timeseries binding line if present.Relationships: render between the two boxes when space permits. Otherwise list below all boxes:
🔗 <name> ➜ 🏬 LH <link-table>then 2-space-indented key mappings.
4. Tier 2 — 6–15 entities (inventory + adjacency)
🏢 ENTITY INVENTORY (8 of 8)
# Entity Key Props TS Static binding Timeseries binding
─ ───────────── ───────────────── ───── ── ───────────────────── ────────────────────────
1 Hub 🔑 HubId 4 — 🏬 dbo.hubs —
2 Aircraft 🔑 TailNumber 6 📈 🏬 dbo.aircrafts ⚡ AircraftReadings
3 Gate 🔑 GateId 3 — 🏬 dbo.gates —
4 Flight 🔑 FlightId 9 📈 🏬 dbo.flights ⚡ FlightTelemetry
5 Crew 🔑 CrewId 5 — 🏬 dbo.crew —
6 Passenger 🔑 PassengerId 7 — 🏬 dbo.passengers —
7 Booking 🔑 BookingId 6 — 🏬 dbo.bookings —
8 Maintenance 🔑 WorkOrderId 5 📈 🏬 dbo.maint_orders ⚡ MaintEvents
🔗 RELATIONSHIPS (6)
Hub ─[ operates ]─► Aircraft 🏬 dbo.zava_hub_aircraft_link
Aircraft ─[ flies ]─► Flight 🏬 dbo.aircraft_flight_link
Flight ─[ departsFrom ]─► Gate 🏬 dbo.flight_gate_link
Flight ─[ staffedBy ]─► Crew 🏬 dbo.flight_crew_link
Passenger ─[ bookedOn ]─► Booking 🏬 dbo.passenger_booking_link
Maint ─[ scheduledFor]─► Aircraft 🏬 dbo.maint_aircraft_linkConventions: prompt user with show <name> for full per-entity property list when they want it. Don't print property dumps for every entity at this tier — keeps the preview readable.
5. Tier 3 — 16+ entities (grouped, paginated, status-coded)
📁 GROUPS
Operations (8) Customer (6) Crew (5) Maintenance (7) Finance (4) → 30 entities
🏢 INVENTORY (showing 1–6 of 30 — "next" / "show <name>")
S # Entity Group Key Props TS Bindings
── ─ ──────────── ─────────── ───────────────── ───── ── ───────────────────────────────────
➕ 9 Gate Operations 🔑 GateId 3 — 🏬 dbo.gates (new)
🔧 2 Aircraft Operations 🔑 TailNumber 6 📈 🏬 dbo.aircrafts | ⚡ AircraftReadings (+1 📈 prop)
✅ 1 Hub Operations 🔑 HubId 4 — 🏬 dbo.hubs (unchanged)
➖ 4 Sector Operations 🔑 SectorId 5 — 🏬 dbo.sectors (REMOVED)
➕ 11 Part Maintenance 🔑 PartNumber 4 — 🏬 dbo.parts (new)
➕ 12 PartUsage Maintenance 🔑 UsageId 5 📈 🏬 dbo.part_usage | ⚡ PartEvents (new)Conventions:
The
S(status) column is mandatory in brownfield previews and optional in greenfield (everything is➕so the column degenerates). For consistency, keep it in greenfield Tier 3 too.Group label comes from a user-supplied
group:annotation in the spec, or from the entity'snamespace. If neither is present, default group is_ungrouped.Pagination accepts
next,prev,page <n>,show <name>,all.allmay produce a very long output — warn the user before printing ifcount > 50.
6. Brownfield change-set (any tier)
The same diagram is rendered from the proposed tree, but every row carries a status emoji from the diff vs. getDefinition:
| Status | Meaning |
|---|---|
| ➕ | added (new in this update) |
| 🔧 | modified (existing element with changed definition) |
| ✅ | kept (unchanged, but still in the envelope — see warning) |
| ➖ | removed (will be deleted by this update) |
✅ rows are mandatory. updateDefinition replaces the entire parts[] — anything not re-included in the envelope is dropped. Rendering ✅ rows reassures the user nothing is being silently removed.
Per-property change rendering (Tier 1 box mode)
Inside an entity box, annotate the changed line directly:
│ 🔑 TailNumber string │
│ Manufacturer string │
│ 📈 ObservedAt datetime │
│ 📈 AltitudeFt double 🔧 was String │
│ 📈 GroundSpeedKts double ➕ added │Risky-change callouts
Print the ⚠️ RISKY CHANGES block before the affected-parts table, regardless of tier:
⚠️ RISKY CHANGES
🔧 valueType change Aircraft.AltitudeFt String → Double (existing rows may fail to parse)
🔧 key change Aircraft.entityIdParts TailNumber → AircraftId (break-change for downstream)
🔧 source change Hub binding dbo.hubs → dbo.hubs_v2 (verify intent)
➖ removal Sector entity + 1 binding + 1 relationship (confirm explicitly)If no risky changes are detected, omit the section entirely (don't print "⚠️ RISKY CHANGES — none").
7. Affected parts list (always print)
After the diagram(s) and risky callouts, print a flat action list. One row per definition file, prefixed with status emoji:
➕ .platform # displayName=ZavaAirlines_PreviewDemo
➕ definition.json
➕ EntityTypes/<HUB_ET>/definition.json
➕ EntityTypes/<HUB_ET>/DataBindings/<guid>.json # 🏬 LH dbo.hubs
🔧 EntityTypes/<AIRCRAFT_ET>/DataBindings/<existing-eh-guid>.json # ⚡ EH AircraftReadings +propertyBindings[GroundSpeedKts]
✅ EntityTypes/<HUB_ET>/DataBindings/<existing-guid>.json # 🏬 LH dbo.hubs (carried forward)
➖ EntityTypes/<SECTOR_ET>/... # entire entity treeIn greenfield mode this collapses to all ➕. In brownfield mode every part in the proposed envelope shows up here with its diff status.
8. Confirmation prompt (mandatory)
The final assistant message must contain the complete preview at the selected tier: the diagram or inventory, change details, risky-change callouts when present, and the affected-parts list including every KEEP row. For Tier 1, retain the unchanged entities and their properties, bindings, and relationships, not just the new property. Reuse the generated preview text; a diagram printed by a tool or an earlier message is not a substitute for the final preview.
Put explanations such as "no write was applied" before any user-requested delegation or proposed-property lines. Repeat those lines together immediately before the confirmation, with no intervening paragraph.
End the preview with exactly one of these single-line prompts:
Greenfield:
Confirm and proceed with createItem? (yes / edit / cancel)Brownfield:
Confirm and apply this change set with updateDefinition? (yes / edit / cancel)
The selected prompt must be the final non-empty line, in plain text without Markdown emphasis or backticks.
Do not auto-continue. Treat anything other than literal yes as edit (loop back to intent gathering) or cancel (discard envelope).
9. How to compute the diff
# Step A — fetch current state (after Step 3 of the workflow)
az rest --method POST \
--url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/items/${ONTO_ID}/getDefinition" \
--resource "https://api.fabric.microsoft.com" -o json > /tmp/onto.current.json
# (poll Location, then GET .../result — see COMMON-CLI.md § LRO)
# Step B — decode parts to a directory tree
mkdir -p /tmp/onto.current.tree
jq -r '.definition.parts[] | "\(.path)\t\(.payload)"' /tmp/onto.current.json |
while IFS=$'\t' read -r path b64; do
mkdir -p "/tmp/onto.current.tree/$(dirname "$path")"
printf '%s' "$b64" | base64 -d > "/tmp/onto.current.tree/$path"
done
# Step C — do the same for the proposed envelope (the agent already has it in memory)
# dump it under /tmp/onto.proposed.tree
# Step D — diff
diff -ruN /tmp/onto.current.tree /tmp/onto.proposed.treeThe agent parses this diff (or the in-memory equivalent) into the ➕ / 🔧 / ✅ / ➖ rows. Tier-3 status detection is at the part-level granularity (one entity's definition.json → one 🔧 if any field changed; bindings are tracked per-binding).
10. Agent contract
A skill consumer agent must:
Validate staged Kusto binding
itemIdvalues against the discovered parent Eventhouse IDs, then render the preview before any LRO write. Unresolved or mismatched IDs block confirmation. Greenfield → §3/§4/§5; brownfield → same tiers + §6 + §7.Wait for explicit
yesfrom the user.On
edit, regenerate the proposal from the user's revised intent — do not apply a partial update.On
cancel, leave the existing ontology untouched and discard the proposed envelope.Persist the post-write snapshot alongside the spec so the next run's diff is reliable.
A skill consumer agent must not:
Skip the preview because the change "looks small".
Replace the final preview with a summary or a reference to earlier tool output.
Compress
✅rows out of the affected-parts list — replace-the-whole-tree semantics make every retained part user-visible.Auto-confirm in non-interactive mode without an explicit
--yesflag from the caller.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills-for-fabric · skills/ontology-cli · commit f8fac11
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
- Also distributed in
- microsoft/skills-for-fabric
AutoGineer is not affiliated with or endorsed by Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download ontology-cli.zip