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)
Map to the source of a derivation
Some attributes can be computed from others through derivation rules. A dataset mapped to the source attribute of a rule gets a derived mapping to the rule’s target automatically, so one mapping tonormalized_email can also answer queries for sha256_hashed_email. A mapping made directly to the derived attribute covers only that attribute.
Before you choose a target attribute, check what it is derived from. Open the attribute under Rosetta Stone → Attributes: the Derivable From card lists the active rules that can produce it, and the Can Derive card lists the rules that take it as their source. See Attributes Interface for what each row shows.
The API answers the same question:
"relationship": "ancestor" is an attribute the target can be derived from. If your column holds one of those forms, map to it instead. Rules are followed one step at a time: a mapping covers the attributes derived directly from it, not the attributes derived from those in turn.
Map directly to a derived attribute only when the dataset holds nothing but the derived form, such as hashed emails with no plain addresses.
Using the UI
View suggested mappings
- Navigate to Datasets and select your dataset
- Click the Rosetta Stone tab
- Review the auto-generated mapping suggestions
- The target attribute name and description
- A confidence score
- A preview of sample data after transformation
Accept a suggested mapping
For high-confidence suggestions:- Review the suggested attribute and sample output
- Click Accept to create the mapping
Modify a suggested mapping
If a suggestion is close but not quite right:- Click Edit on the suggestion
- Modify the target attribute or transformation expression
- Click Save
Create a manual mapping
For columns without suggestions or when you need a custom mapping:- Click Add Mapping
- Select the source column
- Search for and select the target attribute
- Write a transformation expression if needed
- Click Create
Reject a suggestion
If a suggestion is incorrect:- Click the X or Reject button
- The suggestion is removed and won’t reappear
Review derived mappings
The Rosetta Stone Mappings section on a dataset lists the derived mappings your stored mappings imply alongside the stored ones. A derived row is tagged Derived, and carries a Lossy or Imprecise tag when the rule behind it loses or approximates information. Derived mappings are computed when a query runs and never stored, so they cannot be tested, edited, or deleted. Their row menu offers a single action:- Open the row menu on a derived mapping and choose View Provenance
- Read the chain in the drawer: the stored mapping it started from, each derivation rule applied in order, and the attribute it produces
- Click View source mapping to open the stored mapping it came from, read-only
Using the API
List available attributes
Before creating mappings, browse available attributes:Get mapping suggestions for a dataset
Request auto-generated mapping suggestions:Create a mapping
Create a new mapping for a dataset column: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 mappingtypes:
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.
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:Conditional logic
Map discrete values:Null handling
Provide a default for nulls:String manipulation
Normalize case:Combining multiple columns
Concatenate values:Complete worked example
Scenario
You have a customer dataset with these columns:Step 1: Review suggestions
The system suggests:sex→hl7_gender(medium confidence)signup_date→event_timestamp(high confidence)email_hash→email_sha256(high confidence)
Step 2: Accept high-confidence mappings
Accept thesignup_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
Mapcust_id to the unique_identifier attribute:
Step 5: Test and activate
Test all mappings, then activate.Troubleshooting
Related content
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
