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
- 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
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: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:| Column | Sample values |
|---|---|
cust_id | "12345", "67890" |
sex | "M", "F", "X" |
signup_date | "01/15/2024", "02/20/2024" |
email_hash | "a1b2c3...", "d4e5f6..." |
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
| Issue | Cause | Solution |
|---|---|---|
| ”Type mismatch” error | Transformation output doesn’t match attribute type | Use CAST() or adjust transformation |
| ”Invalid enum value” error | Transformation produces values not in allowed list | Add missing cases to CASE statement |
| Null values in output | Transformation doesn’t handle all source values | Add ELSE clause or use COALESCE |
| ”Column not found” error | Typo in column name | Verify column name matches exactly |

