跳转至

Create or select a time series object type(创建或选择时序对象类型)

To add time series properties to an existing object type, follow the Choose existing object type path in the setup assistant. Proceed to the section on how to set up time series properties for next steps.

To create a new object type, you must first have a time series object type backing dataset. If you do not already have a dataset matching this desired schema, then you will need to create one in Pipeline Builder.

While it is possible to create a new object type as an ontology output in Pipeline Builder, we recommend creating the time series object type backing dataset in Pipeline Builder and then following the setup assistant to create the new object type. Follow the steps below to prepare the dataset in Pipeline Builder.

Prepare time series object type backing dataset

Before creating a new time series object type, you must first have a time series object type backing dataset. The following instructions describe how to create a time series object type backing dataset in Pipeline Builder.

Time series object type backing dataset example

  1. First, focus on creating a dataset where each row represents a single object for the new object type. This dataset needs a primary key column that can be used to uniquely identify an object and a column for each non-time-series property on an object.
  2. Next, allow this object type backing dataset to support time series by adding a series ID for each time series property. You will likely add this through one of the following transformations in Pipeline Builder, depending on the shape of your data:

  3. Your time series data for different measurement/sensor types are stored in different datasets and you want to manually create new series ID columns.

  4. You have a single dataset for all measurements and/or a large number of series.
  5. You have multiple datasets for a single measurement/sensor type.

Multiple datasets (manual creation of new series ID columns)

Start with the dataset containing information about the objects (for example, the Machine information in the image below):

Multiple datasets example

  1. Add a Concatenate strings transformation in Pipeline Builder.
  2. Pick a common separator, such as an underscore (_).
  3. Configure your expressions:
    1. Enter a Value type input, and set this value to be the name of your series (for example, temperature).
    2. Enter a Column type input, and set this to be your primary/object key.
  4. Name this new column to easily identify it as the series ID for this specific series (for example, temperature or temperature_series_id).

    Concatenate strings example 1

Single dataset or large number of series

Avoid manually creating each new series ID column by creating a dataset that has each series name as a column name via a join. Once you have this single dataset, follow these instructions:

Single dataset example

  1. Add an Unpivot transformation.
  2. Set Output unpivoted column name as series_name.
  3. Set Unpivoted values output column name as series_value.
  4. In the Columns to unpivot field, pick all columns with a series name.

    Unpivot example 1

  5. Add a concatenate strings transformation to generate the series ID.

  6. Pick a common separator, such as an underscore (_).
  7. Configure your expressions:

    1. Enter series_name as the first input.
    2. Enter the object key as the second input (machine_id in the screenshot below).
  8. Name this new output series_id.

    Add series ID example

  9. Join the series ID columns back to your object type backing dataset on the object key (machine_id in the screenshot below). The backing dataset of your new time series object type now has the series_id you created in addition to other object type metadata.

    Join with backing dataset example

Multiple datasets for a single measurement type

:::callout{theme="warning"} Your object type must be in Object Storage V2 to back a time series property with multiple time series syncs. :::

Since sensor data is often powered by multiple data sources, it can be challenging to normalize and transform all sensor data within one dataset. Sometimes, it is not possible to do this because some sensors hold categorical data and others contain numerical data; different data types cannot exist within one time series sync. To avoid the need to transform and unify all sensor data into one time series dataset, you can link a time series property to multiple time series syncs. To do this, you must have a column of qualified series IDs on your object type backing dataset. Create a qualified series ID by following the steps below. Note that you will need to create your time series sync before following these steps.

  1. Add the backing data for each of the time series syncs that back your time series property to your pipeline by selecting Add data in Pipeline Builder.

  2. For each of your time series sync datasets, select only the series ID column and deduplicate the resulting single-column dataset.

  3. Add a Create time series reference values transformation. Use the series ID column as the Series identifier and select the appropriate time series sync as the Time series sync RID. Name the new column qualified_time_series_id or similar.

    Create time series reference values

  4. Join the qualified series ID column back to your object type backing dataset. This step requires that the series IDs in your object type backing dataset are unique.

The resulting dataset should look like the example below. The seriesId corresponds to the series identifier in the sync dataset, and the syncRid corresponds to the RID of the sync that stores that series.

The time series multi-sync backing dataset.

Create a new time series object type

Once you have prepared your time series object type backing dataset, follow the path in the setup assistant to Create a new object type. This path will redirect you to the Ontology Manager object creation setup assistant where you will select the new dataset as your backing datasource. Upon completion of the assistant dialog, you will be ready to set up time series properties.

:::callout{theme="warning"} If you launch the object creation setup assistant directly from the Ontology Manager home page (that is, not from the time series setup assistant), the assistant will not redirect you to the new object type’s Capabilities tab upon completion. :::


中文翻译


创建或选择时序对象类型

要为现有对象类型添加时序属性,请按照设置助手(setup assistant)中的选择现有对象类型路径操作。后续步骤请参阅设置时序属性部分。

要创建新的对象类型,首先需要拥有时序对象类型支持数据集。如果尚未拥有符合所需模式的数据集,则需要在Pipeline Builder中创建一个。

虽然可以在Pipeline Builder中通过本体输出创建新对象类型,但我们建议先在Pipeline Builder中创建时序对象类型支持数据集,然后通过设置助手创建新对象类型。请按照以下步骤在Pipeline Builder中准备数据集。

准备时序对象类型支持数据集

在创建新的时序对象类型之前,必须首先拥有一个时序对象类型支持数据集。以下说明描述了如何在Pipeline Builder中创建时序对象类型支持数据集。

时序对象类型支持数据集示例

  1. 首先,专注于创建一个数据集,其中每一行代表新对象类型的一个独立对象。该数据集需要包含一个主键列(primary key column),用于唯一标识对象,以及每个非时序属性对应的列。
  2. 接下来,通过为每个时序属性添加系列ID,使该对象类型支持数据集支持时序。根据数据形态,您可能需要在Pipeline Builder中通过以下转换之一来添加:

  3. 不同测量/传感器类型的时序数据存储在不同数据集中,需要手动创建新的系列ID列。

  4. 所有测量数据位于单个数据集和/或包含大量系列。
  5. 单个测量类型有多个数据集。

多个数据集(手动创建新的系列ID列)

从包含对象信息的数据集开始(例如下图中的机器信息):

多个数据集示例

  1. Pipeline Builder中添加一个连接字符串转换。
  2. 选择一个通用分隔符,如下划线(_)。
  3. 配置表达式:
    1. 输入一个类型输入,并将该值设置为系列名称(例如temperature)。
    2. 输入一个类型输入,并将其设置为主键/对象键。
  4. 命名此新列,以便轻松识别为特定系列的系列ID(例如temperaturetemperature_series_id)。

    连接字符串示例1

单个数据集或大量系列

通过创建一个数据集(其中每个系列名称作为列名)并执行连接,避免手动创建每个新的系列ID列。拥有此单个数据集后,请按照以下说明操作:

单个数据集示例

  1. 添加一个逆透视转换。
  2. 输出逆透视列名设置为series_name
  3. 逆透视值输出列名设置为series_value
  4. 要逆透视的列字段中,选择所有包含系列名称的列。

    逆透视示例1

  5. 添加一个连接字符串转换以生成系列ID。

  6. 选择一个通用分隔符,如下划线(_)。
  7. 配置表达式:

    1. 输入series_name作为第一个输入。
    2. 输入对象键作为第二个输入(下图中为machine_id)。
  8. 将此新输出命名为series_id

    添加系列ID示例

  9. 将系列ID列按对象键(下图中为machine_id)连接回对象类型支持数据集。新的时序对象类型的支持数据集现在除了其他对象类型元数据外,还包含您创建的series_id

    与支持数据集连接示例

单个测量类型的多个数据集

:::callout{theme="warning"} 您的对象类型必须位于对象存储V2中,才能通过多个时序同步(time series syncs)支持时序属性。 :::

由于传感器数据通常由多个数据源提供支持,因此将所有传感器数据标准化并转换到一个数据集中可能具有挑战性。有时,由于某些传感器包含分类数据而其他传感器包含数值数据,无法实现这一点;不同的数据类型不能共存于一个时序同步中。为避免将所有传感器数据转换并统一到一个时序数据集中的需求,您可以将一个时序属性链接到多个时序同步。为此,您的对象类型支持数据集必须包含一个限定系列ID列。请按照以下步骤创建限定系列ID。请注意,在遵循这些步骤之前,您需要先创建时序同步

  1. 在Pipeline Builder中选择添加数据,将支持时序属性的每个时序同步的支持数据添加到管道中。

  2. 对于每个时序同步数据集,仅选择系列ID列,并对生成的单列数据集进行去重。

  3. 添加一个创建时序引用值转换。使用系列ID列作为系列标识符,并选择相应的时序同步作为时序同步RID。将新列命名为qualified_time_series_id或类似名称。

    创建时序引用值

  4. 将限定系列ID列连接回对象类型支持数据集。此步骤要求对象类型支持数据集中的系列ID是唯一的。

生成的数据集应类似于以下示例。seriesId对应于同步数据集中的系列标识符,syncRid对应于存储该系列的同步的RID。

时序多同步支持数据集

创建新的时序对象类型

准备好时序对象类型支持数据集后,请按照设置助手中的创建新对象类型路径操作。此路径将重定向到Ontology Manager对象创建设置助手,您将在其中选择新数据集作为支持数据源。完成助手对话框后,即可设置时序属性

:::callout{theme="warning"} 如果您直接从Ontology Manager主页启动对象创建设置助手(即不是从时序设置助手启动),则助手完成后不会重定向到新对象类型的功能选项卡。 :::