Skip to main content
This guide covers how to create and manage mappings between your dataset columns and Rosetta Stone attributes. Mappings are the translation layer that enables your data to be queried through the normalized narrative.rosetta_stone table.
For background on how mappings work, see How Rosetta Stone Works.

Prerequisites

  • A dataset uploaded to Narrative
  • Understanding of your dataset’s column semantics
  • Familiarity with basic NQL syntax (for transformation expressions)

Using the UI

View suggested mappings

  1. Navigate to Datasets and select your dataset
  2. Click the Rosetta Stone tab
  3. Review the auto-generated mapping suggestions
The UI displays your columns alongside suggested attributes. Each suggestion includes:
  • The target attribute name and description
  • A confidence score
  • A preview of sample data after transformation

Accept a suggested mapping

For high-confidence suggestions:
  1. Review the suggested attribute and sample output
  2. Click Accept to create the mapping
The mapping becomes active immediately.

Modify a suggested mapping

If a suggestion is close but not quite right:
  1. Click Edit on the suggestion
  2. Modify the target attribute or transformation expression
  3. Click Save

Create a manual mapping

For columns without suggestions or when you need a custom mapping:
  1. Click Add Mapping
  2. Select the source column
  3. Search for and select the target attribute
  4. Write a transformation expression if needed
  5. Click Create

Reject a suggestion

If a suggestion is incorrect:
  1. Click the X or Reject button
  2. The suggestion is removed and won’t reappear

Using the API

List available attributes

Before creating mappings, browse available attributes:
Response:

Get mapping suggestions for a dataset

Request auto-generated mapping suggestions:
Response:

Create a mapping

Create a new mapping for a dataset column:
Response:

Accept a system-proposed mapping

Accept a suggestion from the auto-generated mappings:

Update an existing mapping

Modify a mapping’s transformation:

Delete a mapping

Remove a mapping:

Mapping types

The Mappings API accepts three mapping types:
  • value_mapping — a single SQL expression producing a primitive value.
  • object_mapping — one expression per property of an object attribute.
  • cached_mapping — joins the source dataset against a precomputed cache dataset at query time. Use this when the transformation is expensive or comes from an external workflow.
For the full schema, validation rules, and constraints (including the company-scope and opt-out restrictions on cached mappings), see Mapping types.

Writing transformation expressions

Transformation expressions are NQL expressions that convert source values to the target attribute format.

Simple column reference

When no transformation is needed:

Type conversion

Convert a string to an integer:
Convert to timestamp:

Conditional logic

Map discrete values:
Map ranges:

Null handling

Provide a default for nulls:
Replace specific values with null:

String manipulation

Normalize case:
Trim whitespace:
Extract a substring:

Combining multiple columns

Concatenate values:
Build a struct:

Complete worked example

Scenario

You have a customer dataset with these columns:

Step 1: Review suggestions

The system suggests:
  • sexhl7_gender (medium confidence)
  • signup_dateevent_timestamp (high confidence)
  • email_hashemail_sha256 (high confidence)

Step 2: Accept high-confidence mappings

Accept the signup_date and email_hash mappings.

Step 3: Customize the gender mapping

The suggested transformation doesn’t handle "X" correctly. Create a custom mapping:

Step 4: Create a manual mapping for customer ID

Map cust_id to the unique_identifier attribute:

Step 5: Test and activate

Test all mappings, then activate.

Troubleshooting

How Rosetta Stone Works

Understand the mechanics of attributes and mappings

Validating Mappings

Test and verify your mappings

Edge Cases

Handle complex mapping scenarios

Transformation Functions

Complete function reference

Mapping Types

API reference for value_mapping, object_mapping, and cached_mapping