Use attributes of the current entity

A given SemQL clause is expressed for a given entity, such as an enricher, validation, or filter performed on a predefined entity. This type of clause always has access to the attributes of the designated entity, which can be simple or complex attributes.

Simple attributes

Simple attributes can be accessed using their name.

Example

FirstName returns the value of the FirstName simple attribute of the current entity (Employee).

Complex attributes

Display name

Complex attributes can be accessed using their attribute name. This returns the value of the complex attribute in the format of the corresponding complex type’s display name.

Example

The SimpleAddressType complex type is defined with a display type that shows the Address, City, and Country definition attributes separated by a space. This type is used for the InputAddress attribute of the Customer entity. The InputAddress qualified name therefore returns a string containing the <Address> <City> <Country> value for each Customer.

Definition attribute

It is also possible to retrieve the value of each definition attribute of a complex type by prefixing this definition attribute name with the name of the complex attribute.

Example

The SimpleAddressType complex type includes the Country definition attribute. This type is used for the InputAddress attribute of the Customer entity. The InputAddress.Country qualified name therefore returns the Country stored in the InputAddress complex type value for each Customer.

ID attributes

SemQL exposes several ID attributes to identify a record at certain phases of the certification process.

For example:

  • A customer golden record is identified by the value in the CustomerID attribute.

  • Each master record consolidated into this golden is identified by the PublisherID, SourceID pair.

The table below lists the attributes representing a record ID and the value they take depending on the data access view. In this table, <IDAttribute> refers to the name of the ID attribute of the entity.

ID attribute Label Description

Gold_<IDAttribute>
(e.g., Gold_CustomerID)

Golden ID

The ID of the golden record or ID of the golden record related to the current record, if any. This attribute is not available for basic entities.

For fuzzy-matched entities, this attribute is completed by the following attributes that track changes due to duplicate management operations:

  • OldGold_<IDAttribute>: the ID of the previous golden record to which a master record was attached.

  • ConfirmedGold_<IDAttribute>: the ID of the confirmed golden record to which a master record is attached.

  • OriginalGold_<IDAttribute>: in a duplicate manager operation, the ID of the original golden record to which a master record was attached.

  • OriginalConfirmedGold_<IDAttribute>: in a duplicate manager operation, the ID of the original confirmed golden record to which a master record was attached.

SourceID

Record Source ID

The ID of the source record. This attribute is available only for views exposing master or source records, for fuzzy-matched entities.

PublisherID

Record Publisher

The code of the publisher of the source record. This attribute is available only for views exposing master or source records for fuzzy- or ID-matched entities.

<IDAttribute>
(e.g., CustomerID)

Record ID

The ID of the current record. Its value depends on the view:

  • For views exposing golden records and for basic entities (GD, GDWE, GE, GH, GH4B, GI, GX, UG) it exposes the same value as Gold_<IDAttribute>.

  • For views exposing, in matched entities, master or source records (AE, MD, MH, MH4B, MI, MX, SA, SA4L, SA4LK, SAWE, SD, SD4L, SD4LK, SE), it exposes a string containing PublisherID.SourceID.

Foreign attributes

SemQL exposes multiple attributes representing a related (parent) record ID at certain phases of the certification process.

The table below lists the various attributes representing a related record ID and the value they take depending on the data access view. In this table, <ForeignAttribute> refers to the name of the foreign attribute in the reference.

ID attribute Label Description

SourceID_<ForeignAttribute>

Referenced Record Source ID

The ID of the referenced record. This attribute is available when referring to fuzzy-matched entities.

PublisherID_<ForeignAttribute>

Referenced Record Publisher

The code of the publisher of referenced record. This attribute is available when referring to fuzzy-matched entities.

FID_<ForeignAttribute>
(e.g., FID_Customer)

Referenced Record ID

The ID of the referenced record. Its value depends on the referenced record type: when referencing a golden record or a basic entity record, it exposes the ID of the referenced golden record.

FDN_<ForeignAttribute>
(e.g., FDN_Customer)

Referenced Record

In the forms and collections, this attribute returns a pointer to the referenced record.

You can use it as-is in a form attribute to display the reference in a user-friendly format—​like a hyperlink or a chip—​using the format defined in a display card configured for the referenced entity.

When using this attribute in SemQL expressions, the value returned is the primary text of the referenced entity’s default display card.

In addition to related record foreign IDs, you can also access their attributes.

Built-in attributes

Built-in attributes are provided by Semarchy xDM to support the certification process. They appear in addition to the attributes designed in the data model.

Data access views

Data is accessed or manipulated using SemQL via a data access view.

A data access view represents the data at a particular phase of its life cycle within the data hub, such as golden data, master data, or source errors. The availability of views varies based on the entity type; for example, the Master Data view does not exist for a basic entity.

Each view is identified by an alias (GD for Golden Data, SE for Source Error, etc.). This alias serves in the REST API for querying the respective view, and as a prefix for the associated physical table, if one exists.

For the complete list of data access views with their description, see Data access views, attributes, and lineage.

Available attributes depend on the data access view running the SemQL expression and on the type of entity (basic, ID-matched, or fuzzy-matched).

Example

A clause that involves the Source Data view (e.g., an enricher on source data) will support built-in attributes such as the SourceID (ID of the source record) or the PublisherID (code of the application that published the source record). For golden records—​which are not directly related to one source—​these built-in attributes no longer make sense.

Built-in attributes list

Built-in attributes are available depending on the type of entity (basic, ID-matched or fuzzy-matched), and view being used.

For the complete list of built-in attributes with their description and views, see Data access views, attributes, and lineage.
The SemQL editor automatically lists available attributes based on the context. You can rely on this tool to select only the correct attributes.