Introduction to Item Structure (Metadata)

All items in Data Hub have associated metadata that describes their structure. Canonical and target items also have metadata that provides transformation rules. The rules are used for processing and validating the items during the composition and publication phases of the Data Hub workflow.

Data Hub metadata is defined in XML files that are loaded at startup. The standard naming pattern for these files is<project>-<itemtype>-extension.xml. The loaded metadata then populates the Data Hub database with the following:
  • Raw Item, Canonical Item, and Target Item categories
  • The attributes, or data fields, for each of these categories
  • Data mappings and transformation rules
  • Target System definitions

For example, canonical items could be sorted into the categories productVariant, and productDetails. The product details category could include the attributes ID, name, variant, and price. Each attribute would also have a related transformation that determines which raw item would populate the canonical attribute.

While there are similarities between the metadata for raw, canonical, and target items, there are also key differences.

Raw Item Structure

The structure of raw items in Data Hub should closely match that of the source system. You therefore want to ensure that metadata for raw item categories and attributes reflect, as closely as possible, the organization and naming of the source data.

Raw item metadata does not contain any mappings or transformation rules. It simply defines the containers for raw items upon initial load.

For a more detailed view of raw item structure, see Raw Item Data Structure.

Canonical Item Structure

Canonical data is at the core of Data Hub item structure. It represents an ideal view that does not change, regardless of source or target systems. Canonical item metadata should therefore represent a structure that is completely independent of source or target data structures. Canonical item categories and attributes can be named, and organized, in any way that is flexible and easy to understand.

In addition to data structures, canonical item metadata also contains mappings that determine which raw items populate which canonical item containers.

For a more detailed view of canonical item structure, see Canonical Item Data Structure.

Target Item Structure

Target Item structure must, by definition, match that of the target system. Target item metadata allows for the specification of complex transformation rules to ensure the transformation of canonical items into target system data types and structures.

Since Data Hub can publish to multiple target systems, target item metadata contains target system definitions. Each of these target system definitions contains a complete set of target item metadata that is unique to that target system.

For a more detailed view of target item structure, see Target Item Data Structure.

Constructing and Loading the Data Hub Item Metadata

The item.xml files are automatically loaded when Data Hub starts. These files form a part of your custom extension, which is located in the /opt/datahub/extension-dir/ folder.

All raw, canonical, and target metadata can be defined in a single XML file. However, it is best practice to define metadata for raw, canonical, and target items in separate files. This separation ensures the segregation of one item type from another for easy management of your extension. It also ensures the separation of canonical item structure from any transformation rules that are tied to source or target systems.

Canonical data represents a view that is independent of source and target. Since the raw-canonical item mappings are dependent on the source system, you may place them in the raw item XML file. This file can then be easily exchanged for another when changing source systems, without having to affect in any way the canonical metadata (the canonical view). This canonical data structure can then be used for multiple integrations.

You may define multiple XML files using a simple naming convention. For example:
  • <your_extension>-raw-extension.xml - containing raw item metadata, and raw-canonical item mappings
  • <your_extension>-canonical-extension.xml - containing canonical item metadata only
  • <your_extension>-target-extension.xml - containing target system definitions, target item metadata, and canonical-target transformation rules
.

Sample XML file content can be found in the topics that follow.