Transformations > Hierarchy Parser transformation > Hierarchical schemas
  

Hierarchical schemas

A hierarchical schema is based on a schema file or sample file that you import to Data Integration. If you import a sample file, Data Integration generates a schema based on the structure of the sample file. The schema defines the expected hierarchy of the input data.
You can use a hierarchical schema in a Hierarchy Builder transformation or a Hierarchy Parser transformation in two ways. You can create a standalone hierarchical schema that can be associated with any transformation that you choose. Alternatively, you can create a hierarchical schema from within a specific transformation.
When you create a standalone hierarchical schema, you import a JSON sample file, XML sample file, or an XSD file as the basis of the schema.
You can associate the hierarchical schema with any transformation, whether you create it as a standalone hierarchical schema or as part of a specific transformation.
You can create, edit, or delete a hierarchical schema. You can edit a hierarchical schema and change the root or change the schema definition. However if you have used the hierarchical schema in a transformation, you cannot edit or delete it. Before you delete a hierarchical schema, verify that you did not use it in a transformation. You can also update an existing XSD schema file or an XML sample file to reflect new or updated changes in the files. You can download an existing hierarchical schema asset created from an XML or XSD file so that you can review, reuse, or share the file.

Rules and guidelines for hierarchical schemas

Consider the following rules and guidelines when you create a hierarchical schema to associate with a Hierarchy Parser transformation:

Creating a hierarchical schema

To create a hierarchical schema, define general properties and upload a sample or schema file.
    1Click New > Components > Hierarchical Schema.
    2On the New Hierarchical Schema page, specify a name and location for the hierarchical schema, or use the default values.
    3Optionally, enter a description of the hierarchical schema.
    4Click Upload to select a file as the basis of the hierarchical schema.
    5In the Upload Schema/Sample File dialog box, click Choose File to browse for a file, and then click OK to upload it.
    6If you upload an XSD file that references other XSD files, Data Integration displays a list of the referenced files. Click Upload to upload each referenced file.
    7If you upload an XSD file with multiple possible root elements, select a root element from the drop-down menu.
    8To save the hierarchical schema, click OK.

Updating a hierarchical schema

You can update an existing sample or schema file after you create a hierarchical schema.
When you update the XSD schema file or XML sample file, use the same file type that was used when creating a hierarchical schema. For example, if you created the schema using an XML sample file, you must update it with another XML sample file.
When you update an XSD schema file, the entire file is replaced. However when you update an XML sample file, only newly added fields are updated, deleted fields are not reflected.
To update a hierarchical schema, perform the following steps:
    1On the Hierarchical Schema page, click Update Sample.
    The Update Sample File dialog box appears.
    2Click Choose File to browse the updated file, and then click OK to upload it.
    3To validate the sample file, click Validate.
    4To save the hierarchical schema, click OK.
    When you update the schema, the changes to the fields are automatically refreshed and reflected in the Field Mapping.

Downloading a hierarchical schema

You can download the source file from which a hierarchical schema asset is created, so that you can review, reuse, or share the file.
This is useful when you import or migrate a mapping and no longer have the original source file that was used to create the hierarchical schema. The Download option is available only in edit mode for existing hierarchical schema assets created from an XML or XSD file. After you save the changes to the schema, the option no longer appears.
Note:
The download option applies only to XML and XSD schema formats. You can't download JSON schemas.
To download a hierarchical schema, perform the following steps:
    1In Data Integration, click Explore, and then search for the hierarchical schema asset.
    2Open the asset and click Edit.
    3Click Download next to the Schema/Sample File field.
    Data Integration downloads the schema of the uploaded XML or XSD file to the downloads folder on your machine.