Table of Contents

Class SemanticBridgeService

Inheritance
SemanticBridgeService
Inherited Members
Namespace
TabularEditor.SemanticBridge
Assembly
SemanticBridge.dll

Main entry point for cross-platform semantic model operations.

public class SemanticBridgeService
Extension Methods

Examples

Load and validate a MetricView in a C# script:

SemanticBridge.MetricView.Load(@"C:\path\to\metricview.yaml");
var diagnostics = SemanticBridge.MetricView.Validate();
foreach (var diag in diagnostics)
{
    Output($"{diag.Severity}: {diag.Message}");
}

Import a MetricView into the current Tabular model:

SemanticBridge.MetricView.Load(@"C:\path\to\metricview.yaml");
var success = SemanticBridge.MetricView.ImportToTabular(
    Model,
    "databricks-host.cloud.databricks.com",
    "/sql/1.0/warehouses/abc123",
    out var diagnostics);
if (!success)
{
    foreach (var error in diagnostics)
        Error($"Import failed: {error.Message}");
}

Remarks

Access Pattern: This service is accessed via ScriptHost.SemanticBridge in C# scripts. It is initialized once during application startup in the main routine and remains constant for the application lifetime.

Lifecycle: Unlike ScriptHost.Model and ScriptHost.Selected, which are set per script execution, SemanticBridge is an application-level singleton service. This allows service state (such as the currently loaded MetricView) to persist across multiple script executions.

Feature Flag: Requires the SemanticBridge feature flag to be enabled for the current license tier. Construction will fail with InvalidOperationException if the feature is not enabled.

Properties

MetricView

Gets the Databricks MetricView operations and state management service.

public DatabricksMetricViewService MetricView { get; }

Property Value

Type Description
DatabricksMetricViewService

Remarks

This service manages a single MetricView instance at a time. Loading a new MetricView replaces the current view. The view state persists across multiple script executions.

See Also

ServiceInitializationResult