Enrichment

Information about automatically enriching events when ingesting

When ingesting events extra metadata can be put on events:

  • Tenant codes
  • Keywords
  • Entity references
  • Different type of dates

This can be provided by the sender of the timeseries data via the API, or this can be done automatically by configuring an enrichment definition.

 

Enrichment definitions are configured on timeseries definitions, which is required when you want to make use of automatic enrichment. The timeseries for which events are ingested will need to be created with that specific definition.

General configuration

Enrichment can be configured with a couple of properties (all optional), if none is provided no enrichment is done.

Property
Description
relations
Can only be used when the owner of the timeseries is not None. It will look up related entities of the owner entity according to the specified relations, taking into account timeslicing, and stores an entity reference of the related entity on the event. To configure following properties are required: - entityType (the applicable relation entity, eg PartyAccessPointRelation),  - hasTarget (the target entity type, eg AccessPoint) - targetRole (the target role on the relation, eg accessPointRole#METERING_POINT) - hasSource (the source entity, eg Party) - sourceRole (the source role on the relation, eg partyRole#SUPPLIER). Either the target or source entity must be the owner of the timeseries.
dates
Dates can be automatically set for different types of dates: entryfromtoopenclosesettlementauthorize And the timestamp for that date type can be set to predefined variables: {{now}}{{startOfDay}}{{startOfWeek}{{startOfMonth}}{{startOfYear}} Dates enrichment will not override existing provided dates. Instead it will add another one. It is also possible to enrich with a fixed timestamp (in ISO notation), but that is not very common.
derivedIndexSetCodes
It will find the specified tenant codes in the available context and stores it on the event. The timeseries, timeseries definition and ‘owner’ entity are available in the context. An entityType and attribute need to be specified. Extensions are also supported in the attribute → metaIndexSetCodes.someExtensionKey For example: if the owner is an Access Point, the accessPointRole code could be derived and stored on every event to make aggregations later more easy.
indexSetCodes
Tenant codes can be automatically set by specifying a type and code. The codes must exist.
keyValueSets
Key value sets can be automatically set by specifying a key and values.

Example

"enrichmentDefinition": {
    "relations": [
        {
            "entityType": "PartyAccessPointRelation",
            "hasTarget": "AccessPoint",
            "targetRole": "accessPointRole#METERING_POINT",
            "hasSource": "Party",
            "sourceRole": "partyRole#SUPPLIER"
        },
        {
            "entityType": "PartyAccessPointRelation",
            "hasTarget": "AccessPoint",
            "targetRole": "accessPointRole#METERING_POINT",
            "hasSource": "Party",
            "sourceRole": "partyRole#GRID_OPERATOR"
        }
    ],
    "dates": [
        {
            "type": "entry",
            "timestamp": "{{now}}"
        },
        {
            "type": "settlement",
            "timestamp": "{{startOfYear}}"
        },
        {
            "type": "open",
            "timestamp": "2022-09-26T10:29:00.000Z" 
        }
    ],
    "derivedIndexSetCodes": [
        {
            "entityType": "AccessPoint",
            "attribute": "accessPointType"
        },
        {
            "entityType": "Item",
            "attribute": "itemType"
        },
        {
            "entityType": "Item",
            "attribute": "metaIndexSetCodes.someExtensionKey"
        }
    ],
    "indexSetCodes": [
        {
            "type": "someIndexSetCodeType",
            "code": "someIndexSetCode"
        },
        {
            "type": "anotherIndexSetCodeType",
            "code": "anotherIndexSetCode"
        }
    ],
    "keyValueSets": [
        {
            "key": "someKey",
            "values": [
                "someValue",
                "anotherKey"
            ]
        }
    ]
}
Did this answer your question?
😞
😐
🤩

Last updated on December 27, 2022