About Entities

An entity is a database table, which you can use to store data.

You can create queries to retrieve and manage data stored in entities. You can create events to trigger actions when data in an entity is changed. The following list provides a few examples on using entities:

  • Enhance data that is used in an asset monitoring application
  • Create applications related to customer relationship management
  • Manage the workflow of an event-handling or a parts-ordering application
  • Sort data retrieved from a maintenance or an issue-reporting application
  • Store contact details of employees

Operations Hub provides a few baseline entities that you can use to manage your assets or collect machine data. You cannot modify or delete these entities; you can use them in your application directly. For baseline entities, the LAST UPDATED column is blank in the ENTITIES workspace.

When you create an entity, you must perform the following steps:
  1. Define the entity structure. To do so, add fields and specify their data types (for example, Boolean, Number, String, and so on).
  2. Add rows, and specify field values. To do so, enter values manually or import data from a Microsoft Excel workbook.

Pivot Entity

A pivot entity is used to automatically collect data from multiple sensors that belong to selected devices and groups of devices. You can use a pivot entity in a query, and plot it as a trend graph in your application.

For a pivot entity, one of the following icons appears in the ENTITIES workspace:
  • : Indicates that the pivot entity is receiving data. If you want to stop collecting data in the pivot entity, you must deactivate the pivot entity. To do so, access the pivot entity, and then select .
  • : Indicates that the pivot entity is not receiving data. If you want to start collecting data in the pivot entity, you must activate the pivot entity. To do so, access the pivot entity, and then select .
Important: If you add or remove a device from a device type or group that is used in a pivot entity, you must deactivate the pivot entity, and then reactivate it for the changes to be applied.
Suppose 50 sensors are connected to a device type and 100 devices of that type send data to your application. Suppose you want to monitor the data from only five of the sensors and only 10 of the devices, which belong to a device group named EV group. You can create a pivot entity to collect data from only the selected sensors and the selected devices that belong to the EV group. This makes it easier to plot trend graphs or create tables with multiple sensor values in your application and improves performance when retrieving the data.

Relationship Between Entities

If you want to retrieve data from two or more entities in a single query, you must create a relationship (or a join) between them. When you create a relationship between entities, the two entities are joined by an inner join in SQL. The entity from which you create a relationship is called the source entity. The entity to which you create a relationship is called the target entity.

A single entity can be used both as a source entity and a target entity. A single entity can be used as a source entity in multiple relationships. A relationship can be bidirectional (that is, if there is a relationship from entity 1 to entity 2, you can also create a relationship from entity 2 to entity 1).

After you create a relationship, when you create a query, if you select the source entity in the Entity box, you can retrieve data from fields in both the source and target entities. If, however, you select the target entity, you can retrieve data only from the target entity.

Important: You cannot use a baseline entity or a pivot entity as a source entity; you can only use it as a target entity.