Dsco Catalog Attribution File Guide

Overview

Customers may upload a TSV file representing the nested categories, with associated attributes, that comprise the catalog into Rithum's Dsco platform to create and update a catalog. Dsco will then use this catalog information as part of the catalog workflow to validate item catalog data conforms to the rules implied by the customer's catalog.

More Help

After reading this document, feel free to reach out to Rithum's Dsco platform support by sending an email with additional questions to support@dsco.io.

Core Concepts

The supplier then can do one of two things, depending on what the retailer allows. If the retailer has designated a template image, then the supplier need only provide the name/url of the template image and the Dsco platform will take it from there and create the other required/optional images the supplier didn't provide. Otherwise, the supplier need only provide the name/url of each required image and any other optional images desired.

Core File Concepts

Publish, Revision, Active Catalogs

Overview

A catalog is uniquely identified by its name. When a customer uploads a catalog with a name that the Dsco platform has never seen before, Dsco will create the catalog in a "draft" state known as a catalog revision. If a customer uploads a catalog with the same name, it will be merged over the top of the existing catalog revision, the one that is in draft mode. Any category that is present in the catalog will overwrite any categories and subcategories and their respective attributes.

Publishing A Catalog

At any time, a customer may choose to "publish" a catalog revision, one that is a draft catalog, using the Dsco platform portal. A published catalog cannot be modified and exists in a read-only mode. Suppose that a customer uploads her first catalog, named "Fall 2020", to Dsco. This catalog will exist as the one draft revision for that name "Fall 2020." The customer then clicks the publish button on that catalog, publishing the catalog. What will happen if the customer wants to continue to make changes to the "Fall 2020" catalog? Will that newly published catalog and the rules derived from its categories and attributes be shared with the customer's trading partners to validate item catalog information?

Making a Catalog Revision

Taking these questions in order, the customer may not edit the published version of the "Fall 2020" catalog. However, the Dsco platform portal web page for Catalog Attribution has a button named "Make a revision" that will make a draft copy of the selected catalog. Then, the customer may make changes to the draft copy. When done making changes, the customer may click the publish button to publish the draft revision and make it the one published version of the "Fall 2020" version, completely overwriting the current "Fall 2020" published version. Note there may only be one draft revision of a named catalog at a time.

There is another way to make a revision of a catalog. Let's assume that the "Spring 2021" catalog exists as a published catalog and that there is currently no draft revision. If the customer uploads a catalog whose name is "Spring 2021" the newly uploaded file will be created as the draft revision of the "Spring 2021" catalog.

Making An Active Catalog

Now that there is a published "Fall 2020" catalog, it needs to be made the "active" catalog in order for the Dsco platform to begin using the catalog's categories and attributes to validate item catalog information provided by the customer's trading partners. The Dsco portal's Catalog Attributions page includes a "Make active catalog" button next to catalogs that are published. Although any number of catalogs may be "published" only one of the published catalogs may be active at a time. This is because only one catalog's categories and attributes may be used to validate the item catalog information provided by the customer's trading partners. The customer may at any time make a different published catalog the one active catalog used for validation.

Tsv File Format

Note that the examples below will use a comma as the delimiter for the sake of clarity even though Dsco recommends using the tab character to delimit values in TSV files.

Rows 1 & 2 - Catalog File Format

The first row of the file, called the Catalog File Format row, defines the columns for the Catalog File Format while the 2nd row defines the values for the Catalog File Format, as in...

format,catalog_name,publish_and_make_active,catalog_is_complete,,,,,,
dscoCatalogAttribution-1.0,Fall 2021,true,false,,,,,,

Row 3 Category Attribute Headers

The third row of the file, called the Category Attribute Headers, provides the name of the category header columns, as in...

category,attribute_name,attribute_dscription,required_type,data_type,secondary_data_type,possible_values,additional_rules,category_is_complete,is_dsco_schema

Rows 4+ Category Attributes

All rows from four on are the actual category attributes themselves. Here are some examples.

// This attribute will be added as a global inherited attribute
// with html_description as its name and with string as its data type
{catalog},html_description,required,string,,,,

// This defines a Size attribute as a string in a top-level category named Clothes
Clothes,Size,required,string,,,,

// This defines a Length attribute of the Shirts category contained
// within the Clothes category whose value must be Tall, Regular or Petite.
Clothes||Shirts,Length,recommended,enum,string,Tall||Regular||Petite,,

// This defines a Style attribute of the Running Shoes category that
// is a string value that must be between 6 and 99 characters in
// length and that may only contain alphanumeric characters
Clothes||Shoes||Running
Shoes,Style,required,string,,,length_range:> 5 AND <100||pattern_match:/^[A-Za-z0-9]+$/

Image Category Attributes

Please read the Core Concepts Section Image bullet if you haven't already.

Partners need to define the images they want their trading partners to provide. Partners will define images a little differently in the catalog attribution file.

Images have a definition, which will include at least an image name and may also include an image export name_rule and image export sizes. Each element of an image definition is a different row in the catalog attribution file.

Here's an example of defining an image called top_view that suppliers must provide on every item in the entire catalog.

category attribute_name required_type
{catalog} images.top_view required
{catalog} images.top_view.export.name_rule optional
{catalog} images.top_view.export.sizes optional
{catalog} images.top_view.export.rules optional

Dsco Image Array

The attribute name needs to start with the Dsco schema array name that suppliers will provide the image within. The following delineates the list of Dsco images arrays that may be used...

Image Name Row

As one can see from the example, the supplier will be required to provide an image named top_view in the item's images array. The attribute name starts with the special images. keyword to let Dsco know that this image will be provided by the partner's trading partners in the Dsco standard images attribute in the root of the item catalog object as opposed to the extendedAttributes section of the item catalog object.

The name of the image, which suppliers will include with the image when they provide it to Dsco, is seen here which is top_view. Of course, any name may be used, top_view is simply an example.

Remember that only the first row in the example above, the row that defines the image name, has to be provided by the retailer in the catalog attribution file to define an image the supplier is meant to give to Dsco with their catalog data.

Below are the exact values for each column of the "name" row of an image in the catalog attribution file. Any column not included below is not used and will be ignored.

Column Name Description Example
category As normal, put the name of the category you want to require the image attribute within or the word {catalog} to ask suppliers to include the image attribute on all sku's in the entire catalog {catalog}
attribute_name the attribute_name value for the name of the image must look like this:
images.<some_name>
start the name with ​images.​ which tells Dsco this image will be provided by the trading partners in the Dsco standard ​images​ attribute of the item catalog object and replace ​<some_name>​ with whatever name you want to designate this image as
images.top_view
description an optional description for this image attribute
required_type As normal, whether the trading partners are required to provide the image or if it's simply recommended or optional required
data_type must be ​image​ to designate this is an image image
is_dsco_schema must be the value t​rue​ to indicate that this is mapped into the Dsco schema ​images​ array true

Export Name Rule Row

The second row allows the retailer to designate a rule to name the image as to ensure the image is named precisely when exported to the retailer.

Below are the exact values for each column of the "export.name_rule" row of an image in the catalog attribution file. Any column not included below is not used and will be ignored.

Column Name Description Example
category As normal, put the name of the category you want to require the image attribute within or the word {catalog} to ask suppliers to include the image attribute on all sku's in the entire catalog {catalog}
attribute_name the attribute_name value for the name rule row of the image must look like this:

images.<some_name>.export.name_rule

This must start with the i​mages.<some_name>​ that was used on the name row as the name of the image and then must be followed by export.name_rule​.
images.icon1.ex port.name_rule
required_type Should be set top optional optional
data_type must be ​string string
possible_values This should be the rule used to name the image or images that will result from the single supplier-provided image.

If image1.png ​is provided then when the retailer exports the image it will be named image1.png and there had better not be another image with that name or an error will occur.

Since it is important to allow the names to be unique and easily identifiable, Dsco allows for certain dynamic values within the name such as...

image_{{sku}}_{{image_name}}_{{dim_name}}_{{dim _w}}x{{dim_y}}_{{date}}.jpg

This would create an export image dynamically from the item and the image definition. See the Image Name Rule Dynamic Fields section for a list of all fields.

Note the extension tells Dsco what type of image to generate, with these supported: jpg, jpeg, gif, png

Export Sizes Row

The third row allows the retailer to specify the sizes to create from this one supplier-provided image. If this is not provided, the image will be exported using the width/height of whatever was provided by the supplier. Note that if this is not provided then the name rule may not include dim_name, dim_w, dim_h. Note that if the size object names are not provided then dim_name may not be used in an image name rule.

Below are the exact values for each column of the "export.sizes" row of an image in the catalog attribution file. Any column not included below is not used and will be ignored.

Column Name Description Example
category As normal, put the name of the category you want to require the image attribute within or the word {catalog} to ask suppliers to include the image attribute on all sku's in the entire catalog {catalog}
attribute_name the attribute_name value for the sizes row of the image must look like this:

images.<some_name>.export.sizes

This must start with the images.<some_name>​ that was used on the name row as the name of the image and then must be followed by export.sizes
images.icon1.ex port.sizes
required_type Should be set top o​ptional optional
data_type must be ​array array
secondary_data_type must be ​dimension dimension
possible_values This is a ||​ separated list of dimension objects where each dimension object looks like this:

<dim_name>:<dim_w>x<dim_h>

dim_name​ is a name to associate with this width/height. dim_w​ and ​dim_h​ specify the width and height that Dsco is to resize the image to.

Here's an example that designates that Dsco should resize this one supplier image as two images when the retailer exports the images...

small:256x256||large:1024x1024

Note that the dimension name is optional and the value could simply be this...

256x256||1024x1024

However, note that if dimension name is not provided that it can't be used in the associated name rule as a dynamic field.

Also, a single value is valid as well as in... 1024x1024

This would cause Dsco to resize the one supplier image to 1024x1024.

If the supplier-provided image is smaller than any size specified by the retailer in this ​sizes​ array then Dsco will create an error to the supplier to let them know that they didn't provide a valid image.

Note that this validation will of necessity be performed after the supplier has provided the images to Dsco since Dsco cannot do this type of check synchronously due to the performance issues posed by downloading images from remote supplier servers that Dsco does not own or control.

There are occasions when you wish to tell Dsco not to set a width or height. An underscore character ​_​ may be used instead of a width or height as in:

small:256x_

This means to set the width to 256 and let the height scale accordingly.

Here's an example that means just export the image as is, using the width/height of the supplier provided source image:

small:_x_

Note that the dimension name (small) is required in this specific case.

Export Rules Row

The fourth row allows the retailer to specify any rules specific to the image provided by the supplier and the supplier image will fail if it does not conform to the provided rules.

Below are the exact values for each column of the "export.sizes" row of an image in the catalog attribution file. Any column not included below is not used and will be ignored.

Column Name Description Example
category As normal, put the name of the category you want to require the image attribute within or the word {catalog} to ask suppliers to include the image attribute on all sku's in the entire catalog {catalog}
attribute_name the attribute_name value for the rules row of the image must look like this:

images.<some_name>.export.rules

This must start with the images.<some_name>​ that was used on the name row as the name of the image and then must be followed by export.rules
images.icon1.ex port.rules
required_type Should be set top o​ptional optional
data_type must be ​array array
secondary_data_ type must be ​image_export_rule image_export_rule
possible_values This is a ||​ separated list of rules where each rule is the rule name followed by a colon followed by the rule value.like this:

<rule name>:<rule value>

Here's a rule that requires that the aspect ratio is between 1.5 and 1.9 to require a vertically oriented image...

max_aspect_ratio:1.5||min_aspect_ratio: 1.9

Please see the Image Rules section below.

Image Name Rule Dynamic Fields

The table below delineates every possible field that may be used in an export name rule to help dynamically define the name that Dsco will export the image to the retailer as.

Field Description
{{color}}
{{sku}}
{{extended_attributes.color}}
Any attribute of an item may be replaced. So {{color}} will be replaced with the item's color attribute. {{sku}} will be replaced with the item's sku. {extended_attributes.shoe_size} will be replaced with the extended attribute shoe size and so forth.
{{date}} This will be replaced with a unix timestamp as in 1597693906.
{{dim_name}} or {{size_name}} If the retailer-provided image definition included the third row "sizes" and each size object included a name for that size then this will be replaced with this image's dimension name
{{dim_w}} If the retailer-provided image definition included the third row "sizes", this will be replaced with this image's dim width
{{dim_h}} If the retailer-provided image def included the third row "sizes", this will be replaced with this image's dim height

Image Rules

The table below delineates every possible image rule that can be provided by a retailer.

Rule Name Description Example
bgcolor Detect that the image is on either a black or white background bgcolor:white bgcolor:black
max_aspect_ratio The image must have an aspect ratio less than or equal to the provided value max_aspect_ratio:1.9
max_aspect_ratio The image must have an aspect ratio greater than or equal to the provided value mix_aspect_ratio:1.4
min_width The image must have a width greater than or equal to this value min_width: 1024
max_width The image must have a width less than or equal to this value max_width: 2048
min_height The image must have a height greater than or equal to this value min_height: 1024
max_height The image must have a height less than or equal to this value max_height: 2048