Skip to main content

Managing ANS maps

Use the ANS Maps page in Migration Center to create a mapping of fields from a source format, such as your previous CMS or a third party content provider, to Arc XP's ANS format.

At a high level, the process works like this:

  1. Upload a sample of your content into the mapping tool.

  2. Explore the data in a collapsible view to see how the content is structured.

  3. Define transformation rules in an editor. These rules tell the system where to find pieces of content and how to convert them into ANS.

  4. Validate your rules by testing them on the sample. The tool shows you the converted ANS content and highlights any errors.

When the mapping is complete, the system stores the transformation rules in Migration Center and links them to a unique content map ID.

Then, when using the Migration Center API to process source content that resembles your sample, you can reference this content map ID in your API request. The system then applies the corresponding transformation rules, converts the content, and stores it within Arc XP.

You must create a content map for each type of content you want to transform into ANS. If your previous CMS used different structures or naming conventions over time, you may need multiple maps for the same content type. Additionally, unique content properties may require specialized mappings to ensure accurate transformation.

For more information on defining transformation rules, see Creating transformation rules in a Migration Center ANS Mapper document.

You are a developer working for a news organization that is preparing to bring stories from a CMS into Arc XP. You want Migration Center to process the transformations of your previous CMS source content into ANS documents. You open the Migration Center ANS mapper and create an ANS map document. You choose a story content type template and upload a JSON file containing a representation of a story from the previous CMS, with all its properties. You work through the sample CMS content, locating the content's unique id, story body, author credits, and publish date. You add transformation rules to the map for each of the content pieces you identify. You validate and save the transformation rules and copy the map ID to use in the next part of your project.

You create another ANS map document, choosing an image content type template and uploading a JSON file containing a representation of an image from the previous CMS, with all its properties. You locate the sample image's url, filename, and caption in the uploaded JSON displayed in the ANS map. You add transformations to the map, targeting each of the image properties. You use the mapper tool's validate function to test that your transformations result in valid ANS image JSON. You copy the map ID to use in the next part of your project.

You are a developer working for a news organization that is migrating story content into Arc XP, using content maps you created in the ANS maps page of Migration Center to handle the transformations. You are investigating errors that have stopped some stories from ingesting. The error text suggests that the source content did not transform into valid ANS. You examine the complete source data of an item of erroring source content. You also open the ANS maps page and look at the map that was used for the transformation. When you compare the erroring source content to the sample content in the mapper, you notice that there are differences in the content structure. You identify the cause is that the erroring source content contains different fields than what the source content in the ANS map defines. As a result, this map won't be able to find the story's headline and author data.

You create a new ANS map document, loading the erroring source content as the source file. You create transformation rules for this map, validate that the ANS can generate correctly, save the map, and copy the map ID. You return to the project code that runs the migration routine and add logic to send some stories to the Migration Center API using the original map ID, and other stories to the Migration Center API using this new map ID. You re-migrate the erroring source document, and on the second attempt the new map ID is applied and valid ANS JSON is created and ingested into Arc XP.

Procedures

Follow these instructions to set up a new content map document:

  1. Navigate to Migration Center.

  2. Click Create Map. The New ANS Map pane opens. 

  3. Complete the following fields: 

    • Map name - enter a name for your content map, for example, Authors.

    • Starter map - choose a template to seed the transformations in your content map.

      You can choose a content type template or select a template for a wire distributor. When choosing a content type template, match the content type of your source file with the template's target content type. Select a wire distributor template if the source file you want to upload comes from the same wire distributor and matches the template's target content type. Choose a content type template if you are mapping any other source file.

      Note

      Wire distributor starter map templates are limited to supported wire publishers and content types. If the wire distributor or wire content type you are working with is not listed, choose a content type template instead.

    • File - click Upload file and upload either an XML or a JSON source file. 

  4. Click Create map.

A beginning ANS map is ready for you to record transformation rules for the source file you uploaded.

For more information on defining transformation rules, see Creating transformation rules in a Migration Center ANS Mapper document.

The ANS map's name is changeable while other map properties are fixed after the map is created. Change the map name by completing these steps.

  1. Navigate to Migration Center.

  2. Click icon_ellipsis.png > Edit next the the mapping you want to edit. The Rename ANS Map pane opens.  

  3. Update the Map name field. 

  4. Click Update map

You can change the source file associated with the map.

  1. Navigate to Migration Center.

  2. Click the name of the content map you want to work with.

    The content map page opens. The page is divided into an Original file pane showing the source file and a New Ans Map pane showing the contents of the starting map template.

    Note

    You can click icon_ellipsis.png > View next to your mapper document's name to open the content map page.

  3. Click Download at the top of the Original file pane. The source file you added to the mapper document saves to your system.

  4. Click Replace at the top of the Original file page. Select a new source file from your system's file browser dialog.

You can delete an ANS map when you no longer need to reference ts transformation rules. A deleted map cannot be recovered.

  1. Navigate to Migration Center.

  2. Click icon_ellipsis.png > Delete next to the mapping you want to delete.

Your transformation logic controls how your content map creates ANS documents from your original source content. The map displays the source file you loaded so you can reference an example of the original source content as you write the transformation rules.

For more information on defining transformation rules, see Creating transformation rules in a Migration Center ANS Mapper document.

  1. Navigate to Migration Center.

  2. Click the name of the content map you want to work with.

    The content map page opens. The page is divided into an Original file pane showing the source file and a New Ans Map pane showing the contents of the starting map template.

    Note

    You can click icon_ellipsis.png > View next to your mapper document's name to open the content map page.

  3. Click the arrow icons on the elements in the Original file pane to expand and collapse the source content. Elements in the source content cannot be modified.

  4. Position your cursor at a location in the New ANS Map pane where you want to add a transformation rule or change an existing rule. Type in the New ANS Map pane to modify transformation rules.

  5. Click Save

Test the mapping rules to ensure they can transform the source file into a correctly structured ANS document.

For more information on defining transformation rules, see Creating transformation rules in a Migration Center ANS Mapper document.

  1. Navigate to Migration Center.

  2. Click the name of the content map you want to work with.

  3. Click Validate. The system attempts to transform the source content file loaded in the left pane of the mapping document into ANS, using the mapping rules in the right pane of the mapping document.

  4. Review the results. If errors exist, note the errors and return to the content map to resolve them.

Validation errors and resolutions

The following table provides a list of errors you might receive when validating your content maps, along with instructions for how to resolve them. 

Error Examples

Description

Error Category

Error Notation in the UI

Error Resolution

Expected property name or } in JSON at position 858

Expected : after property name in JSON at position 865

Expected , or } after property value in JSON at position 28

These errors indicate that your content map contains JSON schema errors.

Syntax Error

N/A (appears as an inline error message in the map pane)

Check the JSON notation in the map for possible errors due to missing or incorrect JSON syntax.

/mappingTemplate/mappings/0/sourceValue/value must be string

The query was expecting a string, but the query is missing or incorrect.

Transformation Error

Mapping Validation

Check the query for possible errors due to missing or incorrect values. Refer to the Transform Engine for more details on transform engine rules and usage.

${assignedField} is not a supported property for the path you provided for ANS version: ${assignedAnsVersion} and type: ${assignedAnsType}

The ANS body contains elements that the schema version and content type do not support. This usually occurs when targetPath (JSON field in the ANS output file) in the map is missing, incorrect, or incomplete.

Validation Error

ANSValidationError

Check the targetPath for possible errors due to missing or incorrect ANS field names. Refer to the ANS schema for details on correct naming and usage.

ANS version 0.10.23 is not a valid version

The ANS version that the map is using is not a version that Arc XP supports

Validation Error

ANSValidationError

Fix the ANS version used in the map

 .${assignedField} should be string

The ANS body contains values that the schema version and content type do not support. This usually occurs when a transformed value (JSON value in the ANS output file) is missing or not valid.

Validation Error

ANSValidationError

  1. Check the ANS output for possible errors due to missing or incorrect ANS values. Refer to the ANS schema for details on supported data types and proper usage.

  2. Check the processors in the mapping block for possible errors due to incorrect invocation or dependencies. Troubleshoot by testing one processor at a time.

You can download the content map transformation rules as a JSON file.

  1. Navigate to Migration Center.

  2. Click icon_ellipsis.png > Download next to the mapping you want to download.

You use the map ID to integrate the mapping transformations into your Migration Center API call to save source content. See Example

  1. Navigate to Migration Center.

  2. Click the name of the content map you want to work with.

    The content map page opens. The page is divided into an Original file pane showing the source file and a New Ans Map pane showing the contents of the starting map template.

    Note

    You can click icon_ellipsis.png > View next to your mapper document's name to open the content map page.

  3. Click Copy ID at the top of the New ANS map pane. The map ID is copied to your system clipboard.