Skip to content

Entity Types

An entity type is the “class” of a basic semantic concept in the knowledge graph. It generally holds one or multiple data types, that are the “attributes” that an entity belonging to this type can have.

Every entity data type has the following configuration elements:

Element Description
Name The identifying name of this data type. It must not contain spaces, as it can be used in queries.
Type The type of data that will be contained by this data type: a string, an integer or double value, a date, a bitset, an IP address or subnet.
Write once only If set, this data type will be written only once and cannot be updated afterwards. It allows to create a data type carrying the “creation date” of the entity, for example
Sensitive data If set, CogTL will encrypt the content of this attribute in database. See the note about sensitive data types below.
Hidden in viewer If set, CogTL won’t display this attribute in the explorer view (when clicking on an entity), and this attribute won’t be sent to clients through the query REST API. It can be used on technical identifiers, that are not useful to see for an end-user.

Primary data type and composite label

The primary data type is the data type that will be used as a “label” when displaying entities. It is also possible that the “label” of an entity should be composed of multiple data types for less ambiguity (typically when there is not an unique identifier for the entity). CogTL allows to define a Composite Label to build the entities names.

Be aware of the fact that even if this name is close to the concept of “primary key” in a relational database, a primary data type will not be automatically considered as an identifier by CogTL. If it is the case, an entity constraint must be created. To illustrate this, let us imagine an entity type City. A City is generally designated by its name, thus name would definitely be flagged as the primary data type of the entity type City. However, cities names are not unique. Paris exists in France, and also in the USA. Therefore, we shouldn’t automatically consider the city name as universally unique.

Hint: Upon entity type creation, an optional checkbox exists to automatically create an entity constraint for the primary data type defined.

Visual configuration

For a quick visual identification of the entities of a type, you can define a color (Nodes color) and upload a pictogram (Nodes image) that will be used in the admin GUI whenever an entity of this type is displayed.

Inheritance

An entity type can inherit from one or multiple other entity types. In that case, it inherits the data types of its parents. For example, a Smartphone is a Phone and a Computer at the same time. Therefore, it would inherit from the data types of Phone (e.g. a phone number), and elements from a Computer (e.g. an operating system type).

If neither a primary data type nor a composite label are defined in an entity type, CogTL will use the configuration of one of its parent types. I.e. the primary data type of a type can be a data type defined in one of its parents. If multiple parents are defined, with different primary data types or composite labels, the behaviour of CogTL is not defined. The first found will be used.

Security restrictions

The visibility of all entities of a specific type can be restricted (either through the admin GUI or the REST API), typically to limit the visibility of sensitive data to authorized persons only. The roles can be created through the System > Users and Roles page.

Note about sensitive data types

Sensitive data types are encrypted by CogTL in database, using the algorithm AES-256 and using a key that is defined on CogTL properties page (System > Properties). A sensitive data type is thus protected against DB administrators. You can still perform queries on the values, as long as you are looking for the exact value. However, the downside of flagging data types as sensitive is that you cannot perform “free text” search queries on it.