Use Attributes of the Current Entity

A given SemQL clause is expressed for a given entity. For example, an enricher, a validation or a filter is performed on a pre-defined entity. Such a clause always has access to the attributes of this entity. These attributes may be simple or complex attributes.

Simple Attributes

Simple attributes can be accessed using their Name.

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.

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 <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 by the name of the complex attribute.

The SimpleAddressType complex type includes the Country definition attribute. This type is used for the InputAddress attribute of the Custome 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 in 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>
Example: 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 duplicates management operations:

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

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

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

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

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 matched.

<IDAttribute>
Example: 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 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>
Example: 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>
Example: 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 of 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 lifecycle in the data hub. For example, Golden Data, Master Data, Source Error, etc. Views are available depending on the type of the entity. 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 is used in the REST API to query this view, and as a prefix for the physical table containing this view’s data, if such a table exists.

The complete list of data access views with their description is available in 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 of fuzzy matched).

For example, a clause that involves the Source Data view (for example, 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). On 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 or fuzzy matched), and view being used.

The complete list of built-in attributes with their description and views is available in Data Access Views, Attributes and Lineage
The SemQL Editor automatically lists the attributes available depending on the situation. Use this editor to make sure to use only the correct attributes.