Import from Semantic Layer

The Import from Semantic Layer task allows importing data directly inside a flow by converting a natural language query into the corresponding SQL query, using an optimized agentic semantic layer, and applying it to a chosen database.

The semantic layer, i.e. the ontology describing the structure and the meaning of the data contained in the target database, must be provided along with the query: it is used by the agent to correctly understand the database structure, so that the natural language query can be reliably resolved into a valid SQL statement.

Once opened, the task interface has a single Options tab, divided into two areas:

  • The Database and query options, where the AI provider connection, the database to query, and the natural language query are configured.

  • The Ontology, where the file describing the semantic layer is selected.

Warning

Always remember to save and compute the task.


The Options tab

The Options tab follows the structure described in the Natural Language tasks family page, for the Model controller and its common connection parameters.

Database connection

Once the AI provider connection has been configured, the database against which the generated SQL query will be executed must be selected.

The connection to the database can be configured in two ways, following the same Saved/ Custom logic used for the AI Model connection:

  • Saved: an existing Database resource, already configured and saved before, is selected.

  • Custom: all the connection parameters are entered manually, directly in the task.

See also

For further information about the supported databases and about configuring a connection, refer to the Database resource page.

Query

  • Query: the natural language question to be translated into a SQL query and to be executed against the selected database.


The Ontology section

In the Ontology section, users select the file containing the semantic layer describing the target database, so that the agent behind the task can correctly interpret the natural language query and translate it into a valid SQL query.

The ontology file can be selected from a filesystem connection, following the same Saved/ Custom logic described for the Filesystem resource, and it must be written using the Apache Ossie format, with either a .yaml or .yml extension.

See also

For further information about configuring a filesystem connection, refer to the Filesystem resource page.


Outputs

Once the task has finished running, it produces a dataset output, containing the result of the SQL query generated from the natural language query and executed against the selected database.


Example

  • Configure the Options tab by choosing an AI provider and filling in its connection parameters.

  • Select the database containing the data to be queried, either by choosing a saved Database resource or by entering a custom connection.

  • Write a natural language query, for example: “Show me the total amount of orders placed by customers from Italy in 2025”.

  • In the Ontology section, select the file describing the semantic layer of the selected database, written in the Apache Ossie format.

  • Save and compute the task.

Once computed, the task translates the natural language query into the corresponding SQL query, based on the information contained in the ontology, executes it on the selected database, and returns the result as a dataset.