Skip to main content

Business Domain

Creating a New Business Domain

  • Navigate to Data > Business Domain, and click the "New Business Domain" button in the upper right corner of the page.
  • In the creation form, fill in the following information:
    • Name: The name of the business domain, used for identification (within 50 characters).
    • Referenced Data Source: Select a connected data source from the dropdown list as the data foundation for this business domain.
    • Description (Optional): Briefly describe the purpose of this business domain (within 200 characters).
    • Prompt (Optional): You can enter prompts for the business domain (within 2000 characters).
  • After creation is complete, you can enter the business domain management interface. You can start adding data tables, defining relationships, creating parameterized templates, and reference templates.

Adding Data Tables and Relationship Modeling

  • Add multiple business-related data tables as "Business Domain Nodes";
  • Each node represents a table; multiple nodes can be added.
  • Click the "Relationship List" for each table node to add associations:
    • Set the From Field (field in the current table);
    • Set the To Table and its Field (target table and target field);
    • Select the relationship type: One-to-One, One-to-Many, Many-to-One, Many-to-Many;
    • Submit to complete the relationship binding between the two tables.

Through this method, users can build a complete data relationship network within the business domain, facilitating subsequent intelligent queries and chart generation.

Relationship Overview

Presents all tables in the business domain and their structural relationships, facilitating global understanding and management.

Parameterized Templates

Supports creating SQL templates with parameterized variables to flexibly meet data query needs in different scenarios.

Creating a Template

  • Click the Parameterized Template button in the upper right corner of the page to enter the management page.
    • Here, you can view the Problem Description, SQL Statement, and Status of all templates.
    • Supports editing, enabling/disabling, and import/export operations for existing templates.
  • Click Add Parameterized Template to enter the creation page:
    • Problem Template: Describes the scenario or problem this template solves. The AI will determine whether to reference it based on the problem template description.
    • SQL Statement: You can define parameters (such as date, department, region, etc.) in the template, inserted into the SQL statement in the form of placeholders.
    • Enabled: Controls whether the template is available.

Configuring Parameters

  • Click Generate Parameter List in the top right corner of the SQL statement input box. The system automatically extracts placeholders from the SQL and configures properties for each parameter:
  • Fill in the parameter name, character type, whether it's required, and whether it supports multiple selection.
  • You can preset options for parameters (including display name and corresponding parameter value).

Features

  • When invoked, users can input different parameter values, and the system will automatically generate the corresponding SQL query;
  • Suitable for common query scenarios requiring frequent condition adjustments, significantly improving reusability and query efficiency;
  • Supports setting default values and input restrictions for parameters to ensure query result accuracy and security.

SQL Statement Example:

SELECT * FROM Sales where t1.c1 = "{value1}"
SELECT * FROM Sales where t1.c1 in ({value1})
SELECT * FROM Sales where t1.c1 like "%{value1}%"

Importing and Exporting Parameterized Templates

To facilitate migration or batch deployment of query templates between different environments (e.g., development, testing, production), the system supports importing and exporting parameterized templates.

  • Implementation or delivery personnel can export multiple templates at once and quickly import them into the target system, significantly reducing repetitive configuration work;
  • Supports version management and batch updates of templates, facilitating team collaboration and unified template maintenance.

Reference Templates

Reference templates are created based on parameterized templates, replacing dynamic parameters with fixed values to form predefined queries that can be executed directly.

Core Advantages and Features:

  • The creation process is similar to parameterized templates, with the difference being that fixed query condition values need to be directly filled in.
  • Users can refer to the logic and field settings of the template to customize query models that meet business needs.
  • Facilitates unified data query standards within teams, improves query consistency, and reduces errors caused by non-standard condition input.