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/authoring-mechanics.md
Ontology Authoring — Mechanics Reference
Deep reference for each authoring operation. SKILL.md keeps the high-level decision content (workflows, Must/Prefer/Avoid, troubleshooting). This file holds the full JSON shapes, field-by-field contracts, and verification recipes.
For base64 encode/decode across GNU vs BSD, and for the full fetch-mutate-send scripts, see definition-script-templates.md.
Definition Envelope for Ontology
The envelope is the same as any other Fabric item definition — a definition object with a parts[] array. Each part has path, payload (base64-encoded file contents), and payloadType (use InlineBase64).
Part paths must always use forward slashes (
EntityTypes/{id}/definition.json), never backslashes. On Windows, avoidJoin-Pathor\operators for building part paths — use string interpolation with/instead. Backslashes causeALMOperationBadRequest.
{
"displayName": "zava_airlines_ontology",
"type": "Ontology",
"definition": {
"parts": [
{ "path": ".platform", "payload": "<base64>", "payloadType": "InlineBase64" },
{ "path": "definition.json", "payload": "<base64>", "payloadType": "InlineBase64" }
]
}
}Shared base64 helpers (portable — the -w 0 flag is GNU-only, and -d is not on macOS's BSD base64):
# Encode — Linux / GNU coreutils
b64() { printf '%s' "$1" | base64 -w 0; }
# Encode — macOS (BSD base64 has no -w; strip trailing newlines manually)
# b64() { printf '%s' "$1" | base64 | tr -d '\n'; }
# Decode — Linux / GNU
b64d() { printf '%s' "$1" | base64 -d; }
# Decode — macOS (BSD base64 uses -D, not -d)
# b64d() { printf '%s' "$1" | base64 -D; }If you need one snippet that works on both:
base64 | tr -d '\n'for encode andbase64 -d(GNU) /base64 -D(BSD) for decode.
See ITEM-DEFINITIONS-CORE.md § Definition Envelope for the generic pattern.
ID Generation Pattern
Entity type, relationship type, and property IDs must be positive 64-bit integers that are unique across the ontology instance. Data binding and contextualization IDs are GUIDs.
Guide the LLM to generate:
Entity/relationship/property IDs: random positive 15–18 digit integers (safely inside 2^62). Persist the
name → idmap in source control so subsequent updates reuse the same IDs.Data binding / contextualization IDs: UUID v4 (
uuidgen/[guid]::NewGuid()).Avoid reusing an ID for a different concept — IDs are referenced by
displayNamePropertyId,entityIdParts,propertyBindings[].targetPropertyId, andsource/target.entityTypeId.
Preferred generators:
# Bash — 64-bit positive integer ID (requires $RANDOM or /dev/urandom)
ID=$(od -An -tu8 -N8 /dev/urandom | tr -d ' ' | head -c 18)
# Bash — GUID
GUID=$(uuidgen)# PowerShell — 64-bit positive integer ID
$ID = [string]([System.Math]::Abs([System.BitConverter]::ToInt64([System.Security.Cryptography.RandomNumberGenerator]::GetBytes(8), 0)))
# PowerShell — GUID
$GUID = [guid]::NewGuid().ToString()Avoid shell RANDOM — it is 15-bit on most shells and collides quickly across a handful of IDs.
Create the Ontology Item
An empty ontology is created with just .platform and an empty definition.json. Entity/relationship types are added via subsequent updateDefinition calls (preferred) or included in the initial createItem payload.
Guide the LLM to generate:
A
.platformJSON with{ "metadata": { "type": "Ontology", "displayName": "<name>" } }.An empty
definition.jsonof{}. The base64 encoding of{}is exactlye30=— do not add whitespace, newlines, or BOM.Base64-encode each, build the envelope,
POSTtohttps://api.fabric.microsoft.com/v1/workspaces/{WS_ID}/items.Poll
https://api.fabric.microsoft.com/v1/operations/{operationId}(from thex-ms-operation-idheader) untilSucceeded; capture the new ontology item ID.
createItemreturns 202 with no response body —az restexits with code 0 and prints nothing. This is expected. After the LRO completes, list Ontology items in the workspace to capture the new item's ID:ONTO_ID=$(az rest --method GET \ --url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/items?type=Ontology" \ --resource "https://api.fabric.microsoft.com" \ --query "value[?displayName=='${ONTO_NAME}'] | [0].id" --output tsv)To capture the LRO operation id from
az rest, use--verboseand parse thex-ms-operation-idheader from stderr, then pollhttps://api.fabric.microsoft.com/v1/operations/{operationId}— see authoring mode § LRO Header Capture. Do not poll the rawLocationheader (it redirects to ananalysis.windows.nethost and fails auth).
Minimal envelope shape:
{
"displayName": "zava_airlines_ontology",
"type": "Ontology",
"definition": {
"parts": [
{ "path": ".platform", "payload": "<base64 of platform json>", "payloadType": "InlineBase64" },
{ "path": "definition.json", "payload": "e30=", "payloadType": "InlineBase64" }
]
}
}Add an Entity Type
An entity type file declares:
id— the 64-bit ID you generatedname— regex^[a-zA-Z][a-zA-Z0-9_-]{0,127}$; the Fabric portal UI further caps custom names to 1–26 alphanumeric/hyphen/underscore characters that start and end alphanumerically, so prefer that stricter shape for portabilitynamespace—usertypes;namespaceType—Customvisibility—Visible(only value documented for authoring)entityIdParts— array of property IDs that form the key. Every referenced property must havevalueTypeofStringorBigInt(integer)displayNamePropertyId— property ID used as the instance labelproperties[]— non-timeseries properties (id, name, valueType)timeseriesProperties[]— timeseries properties (id, name, valueType; typically includes aDateTimetimestamp property)
See ONTOLOGY-AUTHORING-CORE.md § EntityType file for the complete schema and the source-column → valueType mapping table.
Example entity type file (placed at EntityTypes/{entityTypeId}/definition.json):
{
"id": "8813598896083",
"namespace": "usertypes",
"namespaceType": "Custom",
"name": "Aircraft",
"baseEntityTypeId": null,
"visibility": "Visible",
"entityIdParts": [ "3117068036374594013" ],
"displayNamePropertyId": "3117068036374594013",
"properties": [
{ "id": "3117068036374594013", "name": "TailNumber", "redefines": null, "baseTypeNamespaceType": null, "valueType": "String" },
{ "id": "3117068031950000331", "name": "Manufacturer", "redefines": null, "baseTypeNamespaceType": null, "valueType": "String" }
],
"timeseriesProperties": [
{ "id": "3114584981368796953", "name": "PreciseTimestamp", "redefines": null, "baseTypeNamespaceType": null, "valueType": "DateTime" },
{ "id": "3114584977562679672", "name": "AltitudeFt", "redefines": null, "baseTypeNamespaceType": null, "valueType": "Double" }
]
}Guide the LLM to generate:
One property with
valueType: Stringto act as both key and display name unless the user specifies otherwise.Distinct IDs for each property; never reuse an ID across properties or entity types.
A
DateTimePreciseTimestampproperty intimeseriesPropertieswhen the source is a timeseries table.When altering an existing entity type, read the current definition first, mutate the
properties[]/timeseriesProperties[], and resend — do not reuse the same property ID for a different field.
Bind an Entity Type to a Lakehouse or Eventhouse Table
Data binding files sit at EntityTypes/{entityTypeId}/DataBindings/{guid}.json. Two binding types:
NonTimeSeries(static attributes) — lakehouse only, at most one per entity type. Must be added before any time-series binding.TimeSeries(streaming / historical) — lakehouse or eventhouse. An entity type may have multiple time-series bindings, across both source kinds.
Binding constraint checklist (see ONTOLOGY-AUTHORING-CORE.md § Binding rules for the full list):
Each entity type has at most one
NonTimeSeriesbinding, sourced from OneLake (lakehouse only); this static binding is required before anyTimeSeriesbinding on the same entity type.Lakehouse source tables must be managed (not external), must not have OneLake security enabled, and must not have delta column mapping enabled.
Column mapping is auto-enabled when column names contain
,,;,{,},(,),\n,\t,=, or space — rename those columns upstream before binding.Entity type keys (
entityIdParts) must reference properties whosevalueTypeisStringorBigInt.
Non-timeseries binding (lakehouse):
{
"id": "66253a71-c26f-4c9d-877f-3af5632a4be2",
"dataBindingConfiguration": {
"dataBindingType": "NonTimeSeries",
"propertyBindings": [
{ "sourceColumnName": "TailNumber", "targetPropertyId": "3117068036374594013" },
{ "sourceColumnName": "Manufacturer", "targetPropertyId": "3117068031950000331" }
],
"sourceTableProperties": {
"sourceType": "LakehouseTable",
"workspaceId": "<WS_ID>",
"itemId": "<LH_ID>",
"sourceTableName": "aircraft_static",
"sourceSchema": "dbo"
}
}
}Timeseries binding (lakehouse):
{
"id": "39a3889b-77e4-4851-8960-e3b779a5d9ba",
"dataBindingConfiguration": {
"dataBindingType": "TimeSeries",
"timestampColumnName": "PreciseTimestamp",
"propertyBindings": [
{ "sourceColumnName": "PreciseTimestamp", "targetPropertyId": "3114584981368796953" },
{ "sourceColumnName": "AltitudeFt", "targetPropertyId": "3114584977562679672" },
{ "sourceColumnName": "TailNumber", "targetPropertyId": "3117068036374594013" }
],
"sourceTableProperties": {
"sourceType": "LakehouseTable",
"workspaceId": "<WS_ID>",
"itemId": "<LH_ID>",
"sourceTableName": "zava_aircraft_timeseries",
"sourceSchema": "dbo"
}
}
}Timeseries binding (eventhouse / Kusto):
{
"id": "d8b4e4f5-12aa-4db7-b5c3-0f8b1f2ad7c1",
"dataBindingConfiguration": {
"dataBindingType": "TimeSeries",
"timestampColumnName": "PreciseTimestamp",
"propertyBindings": [
{ "sourceColumnName": "PreciseTimestamp", "targetPropertyId": "3114584981368796953" },
{ "sourceColumnName": "AltitudeFt", "targetPropertyId": "3114584977562679672" },
{ "sourceColumnName": "TailNumber", "targetPropertyId": "3117068036374594013" }
],
"sourceTableProperties": {
"sourceType": "KustoTable",
"workspaceId": "<WS_ID>",
"itemId": "<EH_ID>",
"clusterUri": "<eventhouse-cluster-uri>",
"databaseName": "<kql-database-name>",
"sourceTableName": "zava_aircraft_timeseries"
}
}
}Guide the LLM to generate:
One
propertyBindingsentry per property the user wants populated, keyed on the correcttargetPropertyId.workspaceId/itemIdfilled from resolved variables — never hardcoded GUIDs.sourceSchema=dbofor lakehouse tables unless the user specifies a schema.A fresh GUID per binding — never reuse a GUID across bindings.
Eventhouse bindings: ask for the
clusterUrianddatabaseNamefrom the target KQL database item before composing; never infer these.
Add a Relationship Type
A relationship type connects two existing and distinct entity types. File path: RelationshipTypes/{relTypeId}/definition.json.
{
"id": "3110733855942077719",
"namespace": "usertypes",
"namespaceType": "Custom",
"name": "operates",
"source": { "entityTypeId": "<hub_entity_type_id>" },
"target": { "entityTypeId": "<aircraft_entity_type_id>" }
}Guide the LLM to generate:
namethat matches^[a-zA-Z][a-zA-Z0-9_-]{0,127}$.source.entityTypeIdandtarget.entityTypeIdthat reference entity types already present in the ontology parts list — and are distinct from each other.A new relationship type ID, unique across the ontology.
Bind a Relationship Contextualization
A contextualization tells the ontology how rows in a lakehouse table map to relationship instances. File path: RelationshipTypes/{relTypeId}/Contextualizations/{guid}.json.
{
"id": "62bbbf52-39a4-47ed-b7bf-651debaca6ab",
"dataBindingTable": {
"sourceType": "LakehouseTable",
"workspaceId": "<WS_ID>",
"itemId": "<LH_ID>",
"sourceTableName": "zava_hub_aircraft_link",
"sourceSchema": "dbo"
},
"sourceKeyRefBindings": [
{ "sourceColumnName": "HubId", "targetPropertyId": "<hub_key_property_id>" }
],
"targetKeyRefBindings": [
{ "sourceColumnName": "TailNumber", "targetPropertyId": "<aircraft_key_property_id>" }
]
}Guide the LLM to generate:
sourceKeyRefBindingswith eachtargetPropertyIdreferencing a property in the source entity type'sentityIdParts.targetKeyRefBindingswith eachtargetPropertyIdreferencing a property in the target entity type'sentityIdParts.A link table that actually contains both key columns (the user should confirm). Common mistake: pointing at a table that only contains one side's key.
Apply a Definition Update
updateDefinition replaces the included parts wholesale. The safe workflow is fetch → mutate → send.
getDefinitiontypically returns 202 (LRO), not 200 with inline data. You must:
Capture the
x-ms-operation-idheader from the 202 responsePoll
https://api.fabric.microsoft.com/v1/operations/{operationId}untilstatus: "Succeeded"
GET https://api.fabric.microsoft.com/v1/operations/{operationId}/resultto retrieve the actual definition envelopePoll the Fabric
operationsendpoint onapi.fabric.microsoft.comrather than following the rawLocationheader — the latter redirects to ananalysis.windows.nethost that failsaz rest --resource https://api.fabric.microsoft.comauth. This pattern applies to bothaz rest(capture via--verbose) andcurl(capture via-Dheaders file). See definition-script-templates.md for complete scripts that handle both 200 and 202.
# 1. Fetch current definition. getDefinition is LRO-capable: it MAY return 200
# with the envelope inline, OR 202 with a Location header (operation URL).
# The explicit '{}' body avoids HTTP 411 Length Required on empty POSTs.
# For the 202 path (poll Location → GET {Location}/result), use the complete
# script in definition-script-templates.md.
az rest --method POST \
--url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/items/${ONTO_ID}/getDefinition" \
--resource "https://api.fabric.microsoft.com" \
--headers "Content-Type=application/json" \
--body '{}' \
-o json > /tmp/onto_current.json
# 2. Mutate locally (script: decode base64 parts, patch JSON, re-encode)
# 3. Send the updated envelope (also LRO — poll the Location header)
az rest --method POST \
--url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/items/${ONTO_ID}/updateDefinition" \
--resource "https://api.fabric.microsoft.com" \
--headers "Content-Type=application/json" \
--body @/tmp/onto_new_envelope.jsonBoth createItem and updateDefinition return long-running operations. getDefinition is also LRO-capable — it may return the envelope directly (200 OK) or a 202 Accepted carrying an x-ms-operation-id header; in the 202 case, poll https://api.fabric.microsoft.com/v1/operations/{operationId} until Succeeded and then GET …/operations/{operationId}/result to retrieve the envelope. Poll the Fabric operations endpoint, not the raw Location header (which redirects to an analysis.windows.net host and fails auth). See COMMON-CLI.md § Long-Running Operations (LRO) Pattern and the fetch-mutate-send script in definition-script-templates.md, which handles both cases.
When renaming the ontology, add the updateMetadata=true query string to updateDefinition and include an updated .platform part. See ONTOLOGY-AUTHORING-CORE.md § Item-management contract.
Verify and Inspect
After any authoring operation, re-fetch the definition and decode the parts you changed.
# Use '{}' body (POST with empty body can return 411 Length Required). If this
# returns 202, fall back to the LRO-aware script in definition-script-templates.md.
az rest --method POST \
--url "https://api.fabric.microsoft.com/v1/workspaces/${WS_ID}/items/${ONTO_ID}/getDefinition" \
--resource "https://api.fabric.microsoft.com" \
--headers "Content-Type=application/json" \
--body '{}' \
| jq -r '.definition.parts[] | select(.path | test("EntityTypes/.+/definition.json$")) | .payload' \
| while read p; do echo "---"; echo "$p" | base64 -d | jq .; doneAdditional sanity checks the LLM should run:
Every
targetPropertyIdin any binding exists in the parent entity type'sproperties[]ortimeseriesProperties[].Every
entityIdParts[]anddisplayNamePropertyIdpoints at an existing property in the same entity type.Every relationship
source.entityTypeId/target.entityTypeIdreferences an entity type present in the parts list and the two are distinct.Every binding's
workspaceId/itemIdresolves to an existing source item: a lakehouse forLakehouseTablesources (static + timeseries), or an Eventhouse forKustoTablesources (timeseries only). ForKustoTable, also verifyclusterUrimatches the KQL database'sproperties.queryServiceUrianddatabaseNamematches itsdisplayName.
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