Semantic Link Labs
Semantic Link Labs is a Python library designed for use in Microsoft Fabric notebooks. It extends the capabilities of Semantic Link, offering additional functionalities to seamlessly integrate and work with semantic models, workspaces, lakehouses, reports, and capacities within Microsoft Fabric. The library is currently at version 0.14.2 and is actively developed.
Warnings
- gotcha Semantic Link Labs is not officially supported by Microsoft and is a community-driven extension. While it integrates with Microsoft Fabric, direct official support channels for this specific library are not available.
- gotcha The library is not installed by default in Microsoft Fabric notebook runtimes. Users must explicitly run `%pip install semantic-link-labs` in each notebook session or install it into a custom Fabric environment.
- gotcha Several prerequisites must be met in your Microsoft Fabric capacity and workspace for full functionality, including enabled XMLA Read/Write, an existing lakehouse, and the 'Users can edit data models in the Power BI service' setting enabled in Workspace Settings.
- gotcha The relationship between 'semantic-link', 'sempy', and 'semantic-link-labs' can be confusing. 'semantic-link' is the foundational feature, 'sempy' is a Python package within it, and 'semantic-link-labs' is an extension library built upon 'semantic-link-sempy' to provide additional, often experimental, functionalities.
Install
-
%pip install semantic-link-labs
Imports
- labs
import sempy_labs as labs
- migration
from sempy_labs import migration
- directlake
from sempy_labs import directlake
- lake
from sempy_labs import lakehouse as lake
- rep
from sempy_labs import report as rep
- connect_semantic_model
from sempy_labs.tom import connect_semantic_model
- ConnectWarehouse
from sempy_labs import ConnectWarehouse
Quickstart
import sempy_labs as labs
# Example: List available workspaces (requires appropriate permissions in Fabric)
# This is a placeholder; actual function calls require a Fabric context.
# For a real scenario, you would typically be running this inside a Fabric notebook.
# Example: List workspaces (assuming you have a Fabric connection/context)
# workspaces = labs.admin.list_workspaces()
# print(workspaces.head())
# A more generic example demonstrating an import and a hypothetical utility call
print("Semantic Link Labs imported successfully. Ready to use 'labs' functions.")
# Placeholder for an actual function call from the library that doesn't require specific Fabric resources to run without error
# As a generic example, we'll assume a 'hello' function exists for demonstration
# In reality, you'd call a function related to Fabric resources, e.g., labs.admin.list_workspaces()