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.
Adding Data Federation Data Sources¶
Add this type of external data source by following the steps
Select Dashboards > Data Sources from the left navigation pane.
Select the External Data Sources tab.
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
- ChannelId:Enter the channel ID in the data federation.
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.
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:
Select Dashboards > Data Sources from the left navigation pane.
Locate your data source from the table in the External Data Sources tab.
Select New Dataset to open the dataset creation dialog.
In the Name box, specify the name of your new dataset.
In the SQL box, write the SQL query that will retrieve your data.
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.
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:
Make sure you have specified a Data Federation data source and are currently creating a new dataset for the data source.
At the New Dataset dialog window, select Add Variable. The New Variable dialog appears.
In the Name box, specify a name for the variable.
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.
In the Default box, specify the default value of the variable.
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 Editor |
Dashboard designers need to specify its value in the Data Fields section. |
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. |