# Name mapping

The TREP adapter can be configured to map its internal namespace to a different external namespace. This can either be used to simply make it a valid object name for an external source, or to create a complex directory structure of objects.

## add-pattern

**Type**: Function

**Default**: None

**Syntax**: `add-pattern <trep-pattern> <caplin-platform-pattern>`

`add-pattern` maps a RTDS namespace to a Caplin Platform namespace.

Both patterns may include one wildcard (*), positioned at the beginning or at the end of the pattern. The wildcard matches 0 or more characters.

<dl><dt><strong>📌 NOTE</strong></dt><dd>

The default configured RTDS service for the TREP Adapter is `ELEKTRON_DD`. To change the service name from `ELEKTRON_DD`, edit configuration items [upa-priority-service](trep-service.md#upa-priority-service) (if used), [upa-dictionary-service](trep-service.md#upa-dictionary-service), and [add-pattern](trep-name-mapping.md#add-pattern).

If you have deployed the TREP Adapter to the Deployment Framework, you don’t need to edit the above configuration items directly. Instead, edit the [configuration variables](../caplin-platform/datasource/datasource-configuration-syntax.md#configuration-variables) `REUTERS_DATA_SERVICE` and `REUTERS_DICTIONARY_SERVICE` in the file `global_config/overrides/TREPAdapter/DataSource/etc/upasrc.conf`.
</dd></dl>

**Example**:

```
add-pattern ELEKTRON_DD/* /I/*
```

The example above maps the RTDS namespace `ELEKTRON_DD` to the Caplin Platform namespace `/I`. As an example application of this mapping, the TREP Adapter would map Caplin Platform requests for the subject `/I/VOD.L` to the RTDS symbol `ELEKTRON_DD/VOD.L`.

---

**See also**:

* [DataSource C API: Name Mapping](https://docs.caplin.com/developer/api/datasource_c/latest/NameMapping.html)
* [DataSource name mapping configuration](../caplin-platform/datasource/datasource-name-mapping-configuration.md)
