Adding and Configuring Data Federation Data Sources


EnOS Digital Twin Visualization supports the display of data from external data sources in the EnOS Data Federation. The Data Federation service provides application developers and data analysts with data query and file writing services for heterogeneous data storage systems from multiple sources. Users can query and write data to heterogeneous data sources in a uniform SQL syntax standard.

Prerequisites


The corresponding channel must be configured in the Data Federation service and the channel status must be running. For more information about how to create a new Data Federation channel, see Channel Management.


../../_images/data_federation1.png

Adding Data Federation Data Sources


Add this type of external data source by following the steps

  1. Select Dashboards > Data Sources from the left navigation pane.

  2. Select the External Data Sources tab.

  3. Select New Data Source and provide the required information.

    • Type: Select DATA Federation

    • Name: Specify the name of the data source

    • Visibility: Specify the scope of the data source

      • Internal: For this OU only

      • Public: Available for other OUs

    • ChannelIdEnter the channel ID in the data federation.


      ../../_images/data_federation2.png


    • In the Metadata Cache input box, you can specify when the DTV will clear the metadata cache.

    • In the Data Cache input box, you can specify the time when the DTV will clear the data cache.

  4. Select OK.

Creating Datasets for Data Federation


You can write an SQL query to define the set of data that you want to acquire from Data Federation.


You can create a dataset for Data Federation by following these steps:

  1. Select Dashboards > Data Sources from the left navigation pane.

  2. Locate your data source from the table in the External Data Sources tab.

  3. Select Dataset dataset_icon. The Manage Datasets window appears.

  4. Select New Dataset to open the dataset creation dialog.

  5. In the Name box, specify the name of your new dataset.

  6. In the SQL box, write the SQL query that will retrieve your data.

  7. In the Custom Variable section, you can define custom variables for your SQL query. For more information about how to define and use custom variables, see the next sections.

  8. Select OK

Defining Custom Variables


You can pass self-defined variables to the SQL query specified for a Data Federation dataset. This enables you to perform similar queries without the need to create repeating datasets and SQL queries.


You can define custom variables by following these steps:

  1. Make sure you have specified a Data Federation data source and are currently creating a new dataset for the data source.

  2. At the New Dataset dialog window, select Add Variable. The New Variable dialog appears.

  3. In the Name box, specify a name for the variable.

  4. From the Type list, select the type of the variable.

    • If List is selected, specify the pre-defined values in the Value box, separating each value with a comma.

    • If Time is selected, select the format of the time value from the Format list.

  5. In the Default box, specify the default value of the variable.

  6. Select OK.


After defining the variables, you can use them in the SQL query with the syntax ${var_name}.


For example, if you have a variable called name, you can write the following SQL query:

SELECT *
FROM data_table
WHERE name = ${name};

Using Custom Variables


If a custom variable was used in an SQL query, its value can be specified in the following locations:


Location

Description

Chart Settings

Dashboard designers need to specify its value on the Data tab.

Global and Widget Filter

Appears as a data field option, prefixed with [P]. This enables dashboard users to specify a value for the variable through the use of filters.