OSI import and export
Import Open Semantic Interchange (OSI) YAML into a Draft and export deployed Bobsled AI models as OSI YAML.
This page explains how to import semantic models in the Open Semantic Interchange (OSI) format into a Draft, and how to export deployed models as OSI YAML. You can import and export with Balto, MCP, or the API. The Apache Ossie project maintains the specification.
How OSI conversion works
Bobsled AI converts between OSI YAML and native Bobsled AI files. Bobsled AI uses the native files for editing, validation, compilation, and execution. API paths, MCP tool names, Skill names, and interchange.ossie keep ossie as a stable compatibility identifier.
Bobsled AI extensions are OSI vendor extensions with the vendor name DOGSLED. They store native settings that standard OSI doesn't contain. Bobsled AI supports two OSI versions:
Before you begin
- To import OSI YAML, you need the Maintainer role on the Project.
- To export OSI YAML, you need the Reader role or higher on the Project.
For more information, see Roles and permissions.
Import OSI YAML with Balto
To import OSI YAML in a Balto chat, do the following:
- Give Balto the complete OSI YAML documents.
- If the documents need a Project connection, tell Balto which one to use.
- Ask Balto to import the documents.
- Approve the
import_ossieoperation. - Review the returned diagnostics.
- Add any missing native settings.
- Validate the Draft before you publish it.
Balto uses the chat's Draft when the chat has one. Otherwise, Balto creates a Draft named OSI import. You can ask Balto to use a different title.
The import is atomic. If conversion succeeds, Bobsled AI applies all generated files. If conversion fails, Bobsled AI applies none of them, but a newly created Draft still exists.
The result has one of three states:
How Bobsled AI maps imported datasets
A dataset without a Bobsled AI extension imports as a source. Bobsled AI doesn't infer a Project connection from a warehouse address. If the source needs a connection, select an existing one.
OSI logical types don't contain every warehouse-specific detail. For example, Integer doesn't distinguish Snowflake NUMBER(38,0) from another warehouse's BIGINT. When possible, Bobsled AI uses the selected connection to inspect source columns. A diagnostic identifies each unresolved physical type.
An OSI 0.2.0.dev0 document with valid Bobsled AI extension metadata can import derived models. Standard OSI expressions describe semantic output, but they don't define how Bobsled AI builds a derived table. Bobsled AI reads build expressions and other native build settings from that metadata.
The following plain document imports as a source named raw_orders:
version: 0.2.0.dev0
name: sales
datasets:
- name: raw_orders
source: ANALYTICS.RAW.ORDERS
fields:
- name: order_id
datatype: Integer
expression:
dialects:
- dialect: ANSI_SQL
expression: order_idIf Bobsled AI can't inspect ANALYTICS.RAW.ORDERS, the generated source needs an exact native column type before validation succeeds.
Import with MCP
Call import_ossie with a Project reference and one or more complete YAML documents. The following request imports one document into a new Draft:
{
"project": {
"accountId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c61",
"projectId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c62"
},
"draftTitle": "Imported sales models",
"connectionId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c70",
"documents": [
{
"path": "sales.yml",
"content": "version: 0.2.0.dev0\nname: sales\ndatasets: []\n"
}
]
}To create a Draft, omit draftSessionId. To import into an existing Draft, supply a trusted draftSessionId. The tool reads the latest Draft fingerprint before it applies the import.
The MCP response includes draftCreated, draftSessionId, application, and conversion. Before you commit or publish the returned Draft, run project_check on it.
Import a large local file with MCP
Use an OSI artifact when the local YAML or ZIP file is too large to send inline. The MCP host uploads the file directly to private storage, so the content doesn't pass through the model context. To import a large file, do the following:
- Calculate the file size and the lowercase SHA-256 checksum.
- Call
prepare_ossie_uploadwith the filename, media type, size, checksum, and Project reference. - Upload the exact file bytes to the returned URL. Use the returned HTTP method and headers.
- Call
import_ossiewith the returnedartifactIdand the Project reference. - Review the conversion diagnostics.
- Call
project_checkfor the returned Draft.
The artifact upload accepts one YAML file with media type application/yaml or one ZIP file with media type application/zip. For a YAML artifact, request application/yaml. The upload grant returns text/yaml, so send the exact content-type header from the grant. For size and file-count limits, see Limitations.
import_ossie verifies the completed upload before conversion. It rejects a file when its byte count or checksum differs from the prepared upload.
Import with the API
The API imports into an existing Draft. It doesn't create a Draft, so create or select a Draft before you call it. The import endpoint is the following:
POST /api/v1/accounts/ACCOUNT_ID/projects/PROJECT_ID/blueprints/drafts/DRAFT_SESSION_ID/ossie/importThe request contains documents, expectedFingerprint, and the optional connectionId and strict fields. Get expectedFingerprint from the current Draft response. The following request body imports one document:
{
"connectionId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c70",
"documents": [
{
"path": "sales.yml",
"content": "version: 0.2.0.dev0\nname: sales\ndatasets: []\n"
}
],
"expectedFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}For a large import, do the following:
-
Prepare an upload with the following endpoint:
textPOST /api/v1/accounts/ACCOUNT_ID/projects/PROJECT_ID/blueprints/ossie/artifacts/uploads -
Upload the exact bytes with the returned grant.
-
Complete the upload with the following endpoint:
textPOST /api/v1/accounts/ACCOUNT_ID/projects/PROJECT_ID/blueprints/ossie/artifacts/ARTIFACT_ID/complete -
Send
artifactIdandexpectedFingerprintto the import endpoint.
An import request must contain exactly one of documents or artifactId.
In these endpoints, replace the following:
ACCOUNT_ID: the ID of your Account.PROJECT_ID: the ID of the Project.DRAFT_SESSION_ID: the ID of the Draft to import into.ARTIFACT_ID: the artifact ID that the upload preparation returns.
Edit imported files
Edit imported native files as ordinary Bobsled AI files. Imported object-level extensions stay under interchange.ossie on their native dataset, field, metric, or relationship. New imports don't create shared companion files.
Imported files store OSI data as follows:
- Imported sources, models, metrics, and relationships can store mapped OSI properties.
- Native
ai_contextobjects store standard OSI AI context without interpreting arbitrary keys. - Native fields use
semantic_expressionfor a standard OSI expression. - Bobsled AI imports its verified-query extension as native verified-query files.
Bobsled AI doesn't preserve other semantic-model-level custom extensions, and it doesn't map the standard OSI label and unique_keys properties. Import diagnostics report known omissions and defaults.
Unmapped dataset, field, metric, and relationship extensions stay in their native interchange data. Bobsled AI doesn't execute or enforce them.
The conversion isn't lossless. Native mapped edits and removals take precedence during export. Field renames and deletions can leave interchange data without a valid owner. Fix the export diagnostic instead of silently deleting that data.
Export deployed models
export_ossie reads the deployed Blueprint, not an unpublished Draft. To export models from a Balto chat, do the following:
- Publish the Draft that contains the models.
- Ask Balto to export all models, one or more data products, or an exact selection.
- If the default version isn't suitable, choose OSI
0.1.1or0.2.0.dev0. - Review the returned conversion diagnostics.
- On the OSI YAML export card, click Download YAML.
- Save the YAML outside the executable Blueprint.
Each download requests a fresh URL for the same exported file. If the card shows Expired, ask Balto to export the models again. If a download fails, click Download YAML again or ask Balto for a new export.
Chat diagnostics group repeated codes and can omit additional messages. To investigate omitted diagnostics, use a smaller selection. Keep the complete selection for your final export so that related objects stay included.
Export data products
A data product selection exports a whole data product without a list of its models. Use it when a product is too large to select model by model and all exports too much. To export a product from chat, select the product with @ or the Add menu, and then ask Balto to export it as OSI YAML.
Bobsled AI exports these datasets:
- Every source and model in each selected product folder
- Every upstream model and source that those models read, from any folder in the Project
- Any extra models and sources in
selectors
The result's productSelection lists the upstream dependencies that the export added from outside the product folders. includedDependencyCount gives the total, and includedDependencies lists at most 100 of them.
Several products in one request produce one OSI file with one semantic model. To keep a relationship, select every product that the relationship connects. If a relationship or metric uses a model outside the selection, Bobsled AI omits it and reports a warning. To include it, add that model's product or the model itself to the selection.
If a selected product has no deployed sources or models, the export fails with product_not_found. Publish the Draft that contains the product, and then export again.
Export with MCP
The following MCP request exports all supported datasets:
{
"project": {
"accountId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c61",
"projectId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c62"
},
"semanticModelName": "sales",
"selection": { "all": true },
"ossieVersion": "0.2.0.dev0"
}export_ossie returns a small export in files. A large export returns delivery: "artifact" with an artifactId and a short-lived download URL. Both results include bundleVersionId, the ID of the deployed Bundle Version that Bobsled AI exported.
Download the file before the URL expires. If the URL expires, call get_ossie_artifact with the Project reference and artifactId. This tool issues a fresh URL without running the export again.
Send one complete selection in each export request. Don't split one export into batches. Bobsled AI evaluates metrics and relationships against the complete selection, so separate batches can omit objects that connect models in different batches.
Use qualified selectors for sources, because source names are unique only inside a connection. The following MCP request exports two data products and one extra source:
{
"project": {
"accountId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c61",
"projectId": "0198f2c1-5b1a-7c31-8a3e-1d2f3a4b5c62"
},
"semanticModelName": "sales",
"selection": {
"products": ["products/orders", "products/customers"],
"selectors": [{ "kind": "source", "connection": "warehouse", "name": "fx_rates" }]
},
"ossieVersion": "0.2.0.dev0"
}Use the product folder path, such as products/orders or data_products/orders. A name without a folder, such as orders, means products/orders. One request accepts at most 50 products.
The following selection exports exact models and sources:
{
"semanticModelName": "sales",
"selection": {
"selectors": [
{ "kind": "source", "connection": "warehouse", "name": "orders" },
{ "kind": "model", "name": "clean_orders" }
]
}
}Export with the API
The API export endpoint is the following:
POST /api/v1/accounts/ACCOUNT_ID/projects/PROJECT_ID/blueprints/ossie/exportReplace the following:
ACCOUNT_ID: the ID of your Account.PROJECT_ID: the ID of the Project.
The endpoint accepts the same semanticModelName, selection, ossieVersion, and strict fields as the MCP tool. The following fields have API-specific options:
selection: Accepts{ "all": true },{ "selectors": [...] }, or{ "products": [...], "selectors": [...] }. In the product form,selectorsis optional.delivery: Optional. Acceptsinline,artifact, orauto.
An inline result contains files. For an artifact result, the artifact contains the exact exported YAML, and the response contains the artifact's details and download URL. A product export also returns productSelection in both forms.
Both forms return bundleVersionId. Bobsled AI reads the deployed version once and exports that version's files, even if another version deploys during the export. Store the ID with the YAML, because the artifact download endpoint doesn't return it.
Metrics and relationships in exports
An export includes a metric that belongs only to an exported model. Bobsled AI includes other metrics and relationships only when the selection contains every participating model. The export reports omitted objects.
For OSI relationships, the standard from side is the many side. OSI has no exact many-to-many form. Bobsled AI writes the standard projection, and for 0.2.0.dev0 it records the exact cardinality in Bobsled AI extension metadata. Consumers that ignore the extension can read this projection as many-to-one.
Include verified queries
To include verified queries in an export, ask Balto to use OSI 0.2.0.dev0. The Bobsled AI extension preserves each query's question, SQL, description, parameters, connection, and tags. Import restores the queries in the Draft without running them.
Bobsled AI selects verified queries for an export as follows:
- A query with
{model}or{connection.source}SQL references requires every referenced dataset in the export selection. If only some referenced datasets are selected, Bobsled AI omits the query and reports a warning. - A query without these references is included only when you export all models and sources. This rule includes queries that use real table names, because Bobsled AI doesn't match those table names to selected datasets.
- You can't select individual queries by name.
The default OSI 0.1.1 profile omits verified queries and reports a warning. A strict export marks that result as not ready.
Addresses and extensions
The standard dataset source identifies the finished table or view. Bobsled AI extension metadata stores parent inputs and build settings for derived models.
Ephemeral and unpublished live models use dogsled://models/<name>. API sources use dogsled://sources/<connection>/<name>. These values require Project context. They aren't SQL addresses or network endpoints.
An OSI 0.2.0.dev0 export writes vendor_name: DOGSLED and extension version 2. OSI stores extension data as a JSON string inside YAML.
Limitations
OSI import and export have the following limits:
- Inline imports accept YAML documents. Artifact imports accept one YAML file or one ZIP file of YAML files.
- An import accepts at most 100 datasets per request.
- An OSI import or export artifact can contain at most 10 MiB.
- A ZIP file can contain at most 100 YAML files and expand to at most 100 MiB.
- Exports have no separate dataset-count limit. The complete export must fit in one 10 MiB artifact.
- An inline conversion returns at most 500 files and 1 MB of file content.
- MCP responses have a 40 KiB bound. Bobsled AI returns a temporary artifact when an export doesn't fit this bound.
- Agentic and
flatten_jsonmodels export their finished tables as catalog-only datasets. Their execution details stay in native Bobsled AI files. - Export rejects wildcard columns, pivot, unpivot, recursion, hierarchy, and later derived columns. Keep native models that use these features out of an OSI export selection.
What's next
- To validate and publish imported files, see Drafts, versions, and deployments.
- To import and export ontologies, see Ontologies and mappings.
- To group models for export, see Data products.