Skip to main content
Skip table of contents

Feature inheritance - Key concept


Feature inheritance integrates data inherited over hierarchical asset structures into the target asset.

Target groups

  • Solution developers
  • Solution administrators

Context

Feature inheritance can be used in any asset structure: For example, with any type of relationship between assets. The examples in this article refer to the asset structures in censhare PIM. 

Introduction

Features and feature values can be inherited. In PIM setups, features are inherited over Product category hierarchies to Products and Product items. In Print production management, issue numbers and placed items are inherited to layouts. Feature inheritance can be configured for other solutions.

Feature inheritance increases the consistency of data in hierarchical asset structures. Features and values are inherited to children or parent assets. censhare Product Information Management (PIM) uses feature inheritance in product categories, products and product items. censhare Publication management uses feature inheritance for issue numbers and placed items. Feature inheritance can be set up for many different contexts. 

Asset features or asset properties, as they are called in censhare Web store any type of asset data. In a PIM system, this data is also referred to as product features. For example, the dimensions (length, height, width), color or retail price of a product.

Multiple products (assets) can share one or more types of product features. For example, in a product line of home appliances, dishwashers are either "built-in" or "freestanding". Multiple dishwashers share the same "installation type = built-in" or "installation type = freestanding" product feature.

You can assign the "installation type" to a top-level product category. The top-level product category inherits the feature to all child product categories and to the products that are assigned to the child categories. It is not necessary to add a product feature to the product itself. As soon as you add a product to the respective category, censhare creates the inherited features in the product.

Values of inherited features are inherited, too. If you enter a value for the feature on any level of the product category hierarchy, the feature and value are inherited. In the product, censhare creates the inherited feature and adds the inherited value.

The following graphic shows how feature inheritance and value inheritance work in censhare:

The assets (1), (2) and (3) are parent and child product categories. The feature "installation type" is added to the top-level category. The child categories inherit the feature from their parent. In the bottom-level categories (3), a value is added to the feature. Both, the feature and the values are inherited to the child products (4).

Technical implementation

Feature inheritance is based on three concepts:

Cascaded inheritance

Features can be inherited from one asset to another. With a feature inheritance cascade, you can pass features to multiple assets. These assets must be related to each other with an asset relation or asset reference. In the cascade, each asset that inherits a feature, becomes the source asset for the next asset that follows in the cascade. You can build cascades along with asset structures in any direction:

  • From parent to child assets (child-relation)

  • From child assets to parent assets (parent-relation)

  • From parent assets to feature reference assets (feature)

  • From feature reference assets to parent assets (feature-reverse)

Here is an example of the censhare PIM structure:

  • Root product category*

    • Subordinated product category*

      • Product

        • Product item

* Note: There can be more hierarchical levels of product categories. The inheritance rule "Parent to child product category" works with any depth of nested product categories.

The asset structure in the example uses the following relations:

  • Child asset relations between the root product category and subordinated product categories. Each product category except the root node is both a child of the superordinated category and a parent of the subordinated category. The relation type is "user.product-category-hierarchy.".

  • Feature-reverse relations between the product categories and products. Product categories are referenced in products as features. The relation from product categories to products is called "feature-reverse". The feature ID is "censhare:product.category".

  • Child asset relations between the products and product items. Product items are assigned to a product as child assets. The asset type is "user.product-item.".

Once the inheritance cascade is set up, you can enter a value for an inherited feature at any point of the cascade. The asset to which you enter a value for an inherited feature, is the source asset. However, this source asset does not store any information about the inheritance:

XML
<asset_feature asset_id="27316"
               feature="censhare:product.depth"
               value_double="22.0"
               value_unit="[in_i]"/>

Value are inherited downward to all following assets in the cascade. The assets that inherit the feature from the source asset store the information about the source asset and the applied inheritance rule:

XML
<asset_feature asset_id="27399"
               feature="censhare:product.depth"
               value_double="22.0" value_unit="[in_i]">
 <asset_feature asset_id="27399"
                feature="censhare:feature.inheritance-rule-key"
                value_asset_key_ref="test:feature-inheritance.parent-to-child-category"/>
 <asset_feature asset_id="27399"
                feature="censhare:feature.inheritance-source-asset"
                value_asset_id="27316"/>
</asset_feature>

Feature inheritance rules

Feature inheritance rules define which features are inherited and the source and target assets of the inherited feature. Feature inheritance rules are stored in the respective "Module / Feature inheritance rule" asset type.

To create a feature inheritance rule, assign the following assets in the respective relation widgets:

Widget

Assigned assets

Feature inheritance rule of

Feature

Source asset query

Search

Relation asset query

Search

The feature inheritance rule is stored as an asset reference in the feature asset to which it applies. Source asset query and relation asset query are stored as an asset reference in the Feature inheritance rule.

You can create multiple feature inheritance rules for a feature. For example, the "installation type" feature is inherited from the parent product category to the child product categories. This inheritance pattern is defined in a feature inheritance rule. Child product categories that match the following conditions inherit the feature:

  • The source asset is a product category.

  • A child product category exists.

    In the source asset, the feature "installation type" exists.

This rule populates the product categories hierarchy from top to bottom with the respective features. To inherit the feature from product categories to a product, you must create a second inheritance rule. This second inheritance rule has the following conditions:

  • The source asset is a product category.

  • A product that references the source product category exists. The direction of this reference is called "feature-reverse".

  • In the source asset, the feature "installation type" exists.

To inherit the feature from a product to assigned product items, a third inheritance rule is created. This third inheritance rule has the following conditions:

  • The source asset is a product.

  • A child product item exists.

  • In the source asset, the feature "installation type" exists.

These three feature inheritance rules create the inheritance cascade for the censhare PIM structure. Within an inheritance cascade, you can stop the inheritance at any point.

Stop feature inheritance

Feature inheritance creates and stores a feature in assets that are part of an inheritance cascade. Because feature inheritance does not create a reference that points to the source asset, you can stop the inheritance at any asset.

To stop feature inheritance, click "Stop inheritance" in the properties dialog. censhare adds an inheritance stop key. The information about the inheritance rule and source asset is not removed from the asset. The feature for which the inheritance ended is removed from the asset:

XML
<asset_feature asset_id="27398"
               feature="censhare:feature.inheritance-stop-feature-key"
               value_string="censhare:product.depth">
 <asset_feature asset_id="27398"
                feature="censhare:feature.inheritance-rule-key"
                value_asset_key_ref="censhare:product-category.inheritance"/>
 <asset_feature asset_id="27398"
                feature="censhare:feature.inheritance-source-asset"
                value_asset_id="27316"/>
</asset_feature>

The feature inheritance information and the feature are removed from all following assets in the inheritance cascade.

Overwrite the inherited value and pass the new value downward in the cascade

To overwrite an inherited value, click "Stop inheritance" in the properties dialog and enter a new value for the feature. censhare adds an inheritance stop key. Information about the inheritance rule and the source asset is not removed from the asset. censhare stores the new value in the feature for which the inheritance ended:

XML
<asset_feature asset_id="27398"
               feature="censhare:feature.inheritance-stop-feature-key"
               value_string="censhare:product.depth">
 <asset_feature asset_id="27398"
                feature="censhare:feature.inheritance-rule-key"
                value_asset_key_ref="censhare:product-category.inheritance"/>
 <asset_feature asset_id="27398"
                feature="censhare:feature.inheritance-source-asset"
                value_asset_id="27316"/>
</asset_feature>
<asset_feature asset_id="27398"
                feature="censhare:product.depth" value_double="33.0"
                value_unit="[in_i]"/>
</asset_feature>

All following assets in the inheritance cascade inherit the new value. The inheritance rule and the new source asset (this is the asset where the new value is entered) are stored as well in the asset data:

XML
<asset_feature asset_id="27399" feature="censhare:product.depth" value_double="33.0" value_unit="[in_i]"> <asset_feature asset_id="27399" feature="censhare:feature.inheritance-rule-key" value_asset_key_ref="censhare:product-category.inheritance" /> <asset_feature asset_id="27399" feature="censhare:feature.inheritance-source-asset" value_asset_id="27398" /> </asset_feature>

Child feature inheritance

Child features are inherited together with their parent feature. This is the default behavior and cannot be changed.

When you stop the inheritance of a feature that has child features, you have several options:

  • Leave the values for the parent and child features empty. Nothing is inherited to the following assets in the cascade.

  • Overwrite the value for the parent feature and leave the child features empty. The parent feature value is inherited to the following assets in the cascade.

  • Overwrite the values for parent and child features. The new values are inherited to the following assets in the cascade.

When you stop the inheritance of a feature that has child features, some options are not possible:

  • You cannot stop the inheritance for a child feature only. Inheritance stops only work on the entire feature (including the associated child features).

  • You cannot enter a new value for a child feature only. To overwrite an inherited feature, always enter new values for the parent and the child features.

Inherit features from multiple sources

Based on the asset structures in your system, assets can inherit features from multiple sources. If the inherited feature allows multiple values, censhare stores all inherited values in the asset that inherits the feature from the source assets.

If an asset feature does not allow multiple values (unique property), the first assigned source asset inherits the feature value to the target asset. The feature inheritance ignores values from source assets that are assigned later.

Left side: The feature "Bicycle type" allows multiple values. The product (2) inherits these values from different categories (1).

Right side: The feature "Wheelsize" only allows one value. If the product is assigned to multiple categories (1-3), the value from the first assigned category (1) is inherited. Values from other assigned categories (2, 3) are ignored.

Result

Features and their respective values are inherited from a product category to the child product categories and products. Features and their respective values are inherited from a product to the child product items.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.