Handling Nested Data Structures

Nested data structures are sometimes required to capture pieces of product information. A good example is nutritional information describing the contents of a product at various scales. Consider the GDSN modeling of this data:

Nutritional Information: group{
Preparation State: lov,
Daily Value Intake Reference: string+,
Nutrient Basis Quantity Type Code: lov,
Nutrient Basis Quantity: decimal,
Serving Size: decimal[],
Serving Size Description: string+,
Nutrient Detail: group{
Nutrient Type Code*: string,
Percentage of Daily Value Intake: decimal,
Measurement Precision: lov,
Nutrient Quantity Contained: decimal[],
Daily Value Intake Percent Measurement Precision Code: lov,
Nutrient Value Derivation Code: lov,
Description On Nutrient Qualifier: string[],
Nutrient Source: string+
}[],
Nutrient Basis Quantity Description: string+,
Servings Per Package Description: string+
}[]

To model this data as accurately as possible, the STEP data model is currently required to have a referential nature (i.e. using references to other objects) as illustrated below:

The referential structure needs to be included in the Advanced STEPXML Template of the PDX OIEP, by embedding the referenced data. Consider the example below:

Copy
<STEP-ProductInformation ResolveInlineRefs="true" FollowOverrideSubProducts="true"> 
    <ContextList ExportSize="Minimum"/> 
    <CrossReferenceTypes ExportSize="Minimum"/> 
    <UnitList ExportSize="Minimum"/> 
    <AttributeList ExportSize="Minimum"/> 
    <Products ExportSize="Minimum" FlattenHierarchy="false"> 
        <Product> 
            <Name/> 
            <Values/> 
            <ProductCrossReference Type="NutritionalInformationReference" ExportSize="Minimum"> 
                <MetaData/> 
                <Product Referenced="True" Embedded="True"> 
                    <Values/> 
                    <ProductCrossReference Type="NutrientDetailsReference" ExportSize="Minimum"> 
                        <MetaData/> 
                        <Product Referenced="True" Embedded="True"> 
                            <Values/> 
                        </Product> 
                    </ProductCrossReference> 
                </Product> 
            </ProductCrossReference> 
        </Product> 
    </Products> 
    <Assets ExportSize="Referenced"/> 
</STEP-ProductInformation> 

Important: In the examples used, the referential structure is modeled using STEP Objects of the Product type tied together by Product cross-references, but Entity-based structures would be equally valid for transferring a nested data structure to PDX.

On the PDX side, the attribute values of each reference and its target object are consolidated to form a row of values in a Composite Attribute. PDX Composite attributes closely resembles multi-valued Data Containers in STEP, but they are able to contain other Composite Attributes, thus forming a 'tree' of data.

Managing Composite Attribute Names Shown in PDX

By default, composite attributes are titled according to the name of the given STEP reference type, or the ID of the reference type if no name is available. However, the recommendation is to create a meta data attribute for the reference types tying together the nested data structures that explicitly sets the ID of the Composite Attribute in PDX. This can be done through the following steps:

  1. Creating the metadata attribute: A new metadata attribute is needed to store the desired name of the composite attributes to be shown in PDX. Find an appropriate attribute group and create a new attribute within it. It should be a single-valued description attribute with a suitable name and no dimension dependencies, that can be used to store text.

  2. Adding Reference Type Validity: Go to the Object Types & Structures section in the System Setup tab, and expand the Basic Object Types subsection. Find the 'Reference-Type' object type, and add the newly created metadata attribute to the list of valid attributes.

  3. Adding Metadata Values to the Reference Types: The reference types constructing the nested data structure are then updated with the appropriate names for the composite attributes they will be converted into on the PDX side, by entering a value for the newly created metadata attribute.

    For example, two references used to model nutritional information, i.e. 'Product to Nutritional Information' (NutritionalInformationReference) and 'Nutritional Information to Nutrient Details' (NutrientDetailsReference) will be given the values 'Nutritional Information' and 'Nutrient Details' respectively.

  4. Adding to the sharedconfig.properties file: In order to inform PDX of which attribute should be used to determine the composite attribute name, the property 'PDSDelivery.CompositeAttributeID' must be added to the sharedconfig.properties file. This will have to be set to the STEP attribute ID of the newly created metadata attribute.

    In this example case, the addition to the sharedconfig.properties file would be the following:

    PDSDelivery.CompositeAttributeID=PDXCompositeAttribute
  5. Validate the Composite Attribute Names: Lastly, a product with the nested data structures can be pushed to PDX through the OIEP, allowing validation of the composite attribute names (the column headers) which reflect the values added to the reference types in Step 3.

Example 1: The name of the attribute is 'PDX Composite Attribute,' the ID of the attribute is 'PDXCompositeAttribute,' and it has been created within an attribute group named 'PDX Reference Attributes.’

A value can be set for the created meta data attribute, allowing the user to change the composite attribute ID in PDX.

Example 2: The ‘PDX Composite Attribute' attribute values is set, which will now be included as a description attribute within the ‘NutritionalInformationReference' and 'NutrientDetailsReference’ reference types, changing the IDs of the two composite attributes in PDX to 'Nutritional Information' and 'Nutrient Details’ respectively.

Note: The 'PDX composite attribute ID' attribute is made valid on the reference type object, not on the reference type link between the source and target product.

Once the bullet list of items above are implemented, create a value for the 'PDX Composite Attribute' attribute, which will now be included as a description attribute within the 'Product to Product Case' reference type. In the example below, the user has assigned the value 'ProductCase' to the 'PDX Composite Attribute.'

With the 'PDX Composite Attribute' now assigned a value, when the 'Bose Soundlink Micro' (Black) product is exported to PDX, the composite attribute on the 'Product to Product Case' reference will be titled 'ProductCase,' based on the value of the 'PDX Composite Attribute' attribute.