Entities, the backbone of all data

This article is about entities in P2 Server, what they are and what they do. For details on how to configure entities in P2 Server, see: Configuring Entities.

Entities are the backbone of all data in P2 Server, and represents the objects in your world that you want to gather information about. These can be real world objects, like a well or pump, or they can be things that are known by convention, such as an area, or business unit.  

Entities being modelled in a hierarchy

Entities are added to hierarchies, to represent the relationships between them. For example, we can have entities that represent a well, or a country, or a pump. You can put entities into a hierarchy to organise them in a way that makes sense for your organisation.

Entities have attributes, which represent specific aspects of the thing we are concerned with. For example, we may have an entity that represents a well, and the well has several aspects that we care about, such as Flow Rate, Choke, and Tubing Head Pressure.

Related: Hierarchies, Attributes

At a higher level, wells might be grouped according to region, state, or country. These regions, states, or countries are also entities – and they may also have attributes, such as total oil production.

Now let’s get a bit more technical and look in more detail at how entities are defined within the system.

Entity

At a simplistic level, an entity has 3 main parts: name, display name, and description. The name is a unique name that the entity is known by within P2 Server. The display name is what appears in consuming applications – often, but not always, this will be the same as the unique name.

Name Display Name Description
Western Australia WA WA Business Unit
Pilbara Pilbara Pilbara Region
Mobile Fleet All Mobile Fleet equipment Grouping of all Mobile Fleet equipment
Herbert Herbert Gas Well Herbert Gas Producing Well
Derby Derby Water Well Derby Water Injection Well
Hunter Hunter Oil Well Hunter Oil Producing Well

 

System Identifiers

A key aspect of P2 Server is that it is able to pull in and consolidate entities from different systems, from other P2 applications such as Procount, Stratus, and P2P, or from other data systems.

One of the issues that people run into when trying to integrate systems is that the same item may be called different things in each of the systems, so how do we keep all of these different names linked up?

In P2 Server we do this by using a System Identifier. Each entity can have a different name in each data source connected to P2 Server.  We can then refer to a single entity and P2 Server will use the system identifier to understand which entity we are referring to in the underlying source system.

Related: Datasouces and Adaptors

For example, an entity may exist in P2P and in Procount under different names. In reality, these represent the same real-world object. In order to represent that in P2 Server, we must be aware of how P2P and Procount identify that entity internally. We do this by associating the entity with corresponding system identifiers – consisting of the system name and the identifier for the entity itself.

Name Display Name System Identifier
Derby Derby Water Well P2P Derby_2184
Procount Q52KL5

Once these have been set up, P2 Server can do some automatic mapping to these systems, for example when running a dataset query:

SELECT ENTITYNAME(Id), Status FROM STRATUSTABLE WHERE
StratusId = PARAM(name, entity)

Related: Creating a Dataset Datasource, How to Write a Dataset Query

Comments are closed