Guides
Visit our websiteDeveloper Docs
  • Getting Started with Databrain
    • What is Databrain?
  • ❄️Onboarding & Configuration
    • 📝Sign-Up
    • ✍️Sign-In
    • ✏️Google Sign In Setup for Self-hosted app
    • 🤔Forgot password? Recover your Databrain Account
    • 🌟Onboarding
    • 💾Add a Data Source
    • 🧑Configure Tenants
    • 🆕Create a Workspace
    • 🔓Create a Private Workspace
    • 🆕Create a Dashboard
    • 💠Create a Metric
      • Create Custom Columns
      • Create a Metric using Chat Mode
      • Create a Metric using Custom SQL
    • Workspace Settings
      • General Settings
      • Access Control Settings
      • Cache Settings
      • Download Settings
    • 🗄️Explore Data
  • 🛢️Datasources
    • Connecting Data Sources to Databrain
      • Amazon Redshift
      • Snowflake
      • BigQuery
      • MySQL
      • Postgres
      • MongoDB
      • ElasticSearch
      • DataBricks
      • ClickHouse
      • MSSQL
      • Amazon S3
      • CSV
      • Firebolt
      • SingleStore
      • Athena
    • Allow Access to our IP
    • Add a Data Source
    • Configure Tenants
    • How to Sync a Data Source
    • Edit Tenancy
    • Create a Datamart
    • Semantic Layer
    • Create a Data App
    • Creating a Custom Dataset/View in a Multi-Datasource Environment
  • Workspace
    • Multi Datasource Workspace
  • 🔍DASHBOARDS
    • Edit a Dashboard
    • Share Dashboard
    • Dashboard Settings
    • Create/Modify Dashboard Filter
      • Dashboard Filter - Variable Apply On
      • Add LHS and RHS custom sql support for dashboard filter
    • Customize Layout
    • Adding Elements to Dashboard
    • Import/Export Dashboard
    • Report Scheduler
  • 📉METRIC
    • Edit a Metric
    • Joins , Filter, Sort, Group By
    • Complex Filter
    • Apply Metric Filter
      • Metric Filter - Variable
      • Metric Filter - Custom
    • Switch X axis and Switch Y axis
    • Group By
    • Footnote and Long Description
    • Dynamic Property
    • Archive/Unarchive Metric Card
    • Download Metric Card
    • Download Underlying Data
    • Metric Summary
    • Metric Expression for Single Value Card
    • AI Summary
    • Merge Metrics
    • Section Filters
    • View Unpublished Metrics
  • 📊VISUALIZATIONS - ACTIONS & APPEARANCE
    • Chart Actions
      • Chart Click Action
      • Chart Click Action with Metric
      • Card Click Action
      • Drill Down
      • Cross Dashboard Drill Down
    • Chart Appearance
      • Chart-Specific Appearance Options
  • 🛢️PREVIEW OF DASHBOARDS
    • Email Settings for Scheduled Reports
    • Scheduled Reports for End User
  • 🔍FILTERS
    • Dashboard Filter
    • Metric Filter
    • App filter
  • 💡Features
    • Python Editor Console
    • Custom SQL Console
    • Custom SQL Query Guidelines
  • 🏢Integrating Plugin
    • ✳️Get an auth token
    • 🙏Get a guest token
  • 🛃THEMEING & CUSTOMIZATION
    • 🎨Creating a theme
    • 🖼️View the theme in action
    • ⚙️Reset a saved theme
  • 📊Metric Component (upto version v0.11.15)
    • ✨Quick start
  • 🕸️Web Components
    • ✨Quick start
    • ⚛️Framework Specific Guide
  • 🚀Product Changelog
  • 🤳Self Hosted Changelog
Powered by GitBook
On this page
  1. Datasources

Semantic Layer

This guide provides a comprehensive step-by-step process for building and managing a semantic layer in Databrain's Data Studio, making it essential for data professionals.

PreviousCreate a DatamartNextCreate a Data App

Last updated 17 hours ago

What is a Semantic Layer?

A semantic layer is a business representation of data and offers a unified and consolidated view of data across an organization.

Purpose of Semantic Layer

A semantic layer provides a user-friendly interface that translates complex data structures into understandable business terms, enabling non-technical users to easily access, analyze, and generate insights from data without needing deep technical expertise.

Key Feature of Databrain's Semantic Layer:

Example: Users can search for "Customer Name" instead of using technical identifiers like "customer_id." Context: It simplifies data access for everyone, making it easier to interpret and analyze.

  1. Initial Access:

  • In the "Data Studio" page of Databrain, navigate to the "Semantic Layer" section.

  • Click on datamart name for which you want to create the semantic layer.

  1. Table and Column Information Configuration:

Table Info Tab

  1. Navigate to "Table Info" tab

  2. Fill out the following:

    • Table Description: Provide comprehensive details about the table's purpose and contents

    • Table Synonyms: Add alternative names for the table

    • Miscellaneous Info: Include any additional relevant information or constraints

Column Info Tab

  1. Click on "Column Info" tab

  2. For each column:

    • Add relevant synonyms

    • Select appropriate data type

    • Include any column-specific notes or constraints

Synonyms in the Semantic Layer

  1. Table Synonyms

    Example: If your datamart has a table named "Customer Data," appropriate synonyms might include "Client Information," "Customer Records," or "User Profiles."

    Context: Synonyms help users find the table using different terminologies they may be familiar with, improving accessibility and usability.

  2. Column Synonyms

    Example: For a column labeled "Order Date," synonyms could be "Purchase Date," "Transaction Date," or "Sale Date."

    Context: By providing synonyms for columns, users can query data more intuitively, using terms that resonate with their understanding of the dataset.

  1. Define Relationships:

  • Navigate to "Define Relationships" tab and describe the relationships between the columns and cardinality between the tables.

  • Then, specify any other relevant information or important constraints.

Functionality: Users can define relationships between tables, including cardinality (one-to-one, one-to-many), directly within the semantic layer.

Context: This capability ensures that the data model accurately reflects real-world relationships, which is crucial for accurate reporting and analysis. By clearly defining how different datasets relate to each other, users can perform more meaningful analyses.

Example: In a sales database, a one-to-many relationship can be established between a "Customers" table and an "Orders" table, allowing analysts to easily understand that each customer can place multiple orders.

  1. Definitions

  • Access "Definitions" tab

  • Create analytical questions:

    • Click "+ Definitions" to add new questions

    • Use search functionality to find existing definitions

  • Create a definition by clicking on "+ Definitions" icon and then export the definitions using "Export" button.

Functionality: Users can create analytical questions and definitions that are easily searchable within the semantic layer.

Context: This feature streamlines the process of generating insights by allowing users to formulate queries based on predefined definitions rather than starting from scratch each time. It fosters consistency in reporting across the organization.

Example: An analyst might define a metric called "Total Revenue," which aggregates sales from various sources. Other users can then search for this definition when creating their reports, ensuring everyone uses the same calculation method.

  1. Actions on semantic layer:

After creating the semantic layer, you can perform 3 actions:

  • Lab

  • Playground

  • Sample Set

Lab

  • Synthetic Query - Generate and test queries, and validate query outcomes

  • Logs - Review chat mode questions and track query history

  • Evals -Add evaluation criteria and monitor performance

Playground

Access the search bar to test LLM responses and view the results.

Sample Set

Create sample datasets for the created datamart.

Functionality: The Lab feature provides an environment where users can generate synthetic queries and validate their results against expected outcomes.

Context: This integrated testing capability allows analysts to experiment with different queries safely without affecting live data or reports. It also helps ensure that the semantic layer functions correctly before deploying it for broader use.

Example: An analyst can create a synthetic query to calculate total sales for the last quarter and verify that the results match their expectations before using it in a dashboard or report.

🛢️