Open-Trade-Transfer-Package

A structure that allows files to be generated to facilitate the exchange of data concerning trade. It can be utilized to exchange information on product specifications, requirements, defaults and restrictions as well as capabilities. It can also be used to exchange a material list or other needed related data.

View the Project on GitHub

Open Trade Transfer Package

A structure that allows files to be generated to facilitate the exchange of data concerning trade. It can be utilized to exchange information on product specifications, requirements, defaults and restrictions as well as capabilities. It can also be used to exchange a material list or other needed related data.

Is meant to facilitate both XML and JSON creation.

How to define the file as an Open Trade Transfer Package

The root level should be an element with the name of “open_trade_transfer_package”:

Examples

{
  "open_trade_transfer_package": {
    "version": 1.0,
    {content here}
}
<?xml version = 1.0 encoding = "UTF-8"?>
<open_trade_transfer_package version="1.0">
  {content here}
</open_trade_transfer_package>

Version

Current version is 1.0. This should stated in every file as showed in the example above. 1.0 is the first released version, and there are no prior versions.

Structure

Within the root level (open_trade_transfer_package) everything is divided into four groups and their subgroups:

JSON schema

JSON schema is available in the versions folder. To link to it, please use the raw link. The schema allows you to validate your OTTP file syntax. An example of how this is done in Ruby with the json-schema GEM below:

ottp = '{
  "open_trade_transfer_package": {
    "version": 1.0,
    "information": {
      "company": "Elmatica as",
      "created": "2017-04-03T08:00:00Z"
    },
    "profiles": {
      "restricted": {
        "generic": {
          "version": 1.0,
          "country_of_origin": {
            "nato_member": false
          }
        }
      }
    }
  }
}'

puts JSON::Validator.validate!('https://raw.githubusercontent.com/elmatica/Open-Trade-Transfer-Package/master/v1/ottp_schema.json', ottp)

Data formats

When possible subelements are documented, they need to specify what format to use. Possible formats are:

Possible elements in the “information” group

company

A string wih the company who owns the information in the file

person

A string with the person responsible for the information in the file

editor_software

Astring with the software that has generated the file

created

The timestamp of the creation of the file, in format RFC 3339 date-time

updated

The timestamp of the last update of the file, in format RFC 3339 date-time

project

A string with name of the project included in the file

version

A number with the version of the information included in the file

Description

A string representing the description of the content

Possible generic elements in the products/profile/capability sections.

If you want to place generic information in the file, you should enclose the information within a section called “generic”. E.g. if you wanted to create a profile indicating that no products can be manufactures outside NATO countries, you could do it like this:

{
  "open_trade_transfer_package": {
    "version": 1.0,
    "information": {
      "company": "Elmatica as",
      "created": "2017-04-03T08:00:00Z"
    },
    "profiles": {
      "restricted": {
        "generic": {
          "version": 1.0,
          "country_of_origin": {
            "nato_member": false
          }
        }
      }
    }
  }
}

Standards and Requirements (“standards”)

If the format is boolean and nothing is stated other than the name of the standard in the Description column, it should be understood as follows: Are to be met (if Specification), required/restricted/default (in Profile) or possible (in Capability)

Data tag Format Description
ul  Boolean  Indicating if UL is required for the board. Can not be used as a capability, as this will be indicated on each material
c_ul  Boolean  Indicating if Canadian UL is required for the board. Can not be used as a capability, as this will be indicated on each material
rohs  Boolean  RoHS
itar  Boolean  ITAR
dfars  Boolean  DFARS

E.g. this would indicate that UL approval should be handled as a default if not otherwise instructed:

{
  "open_trade_transfer_package": {
    "version": 1.0,
    "information": {
      "company": "Elmatica as",
      "created": "2017-04-03T08:00:00Z"
    },
    "profile": {
      "default": {
        "generic": {
          "version": 1.0,
          "standards": {
            "ul": true
          }
        }
      }
    }
  }
}

Country of Origin (“country_of_origin”)

Data tag Format Description
iso_3166_1_alpha_3 String  A three letter string representation of the Country of origin according too ISO 3166-1
iso_3166_1_alpha_2 String  A two letter string representation of the Country of origin according too ISO 3166-1
nato_member Boolean  Indicates if the COO is a NATO member state (or needs to be if used as a profile)
eu_member Boolean  Indicates if the COO is a European Union member state (or needs to be if used in a profile)

The custom elements

This element is where you place description of colors or materials

Colors

Data tag Format Description
name String  Any name to describe the colour
value_type String  Can be any of “hex”, “rgb”, “cmyk” or “name”
value String If value_type is hex, the value needs to be a "#" + 6 hexadecimals (e.g. "#FFFFFF"). for "rgb" the format is "rgb(0, 255, 255)", for "cmyk" the format is "cmyk(100%, 0%, 0%, 0%)". The name is just a string.

Example:

...
  "custom": {
    "colors": [
      {
        "name": "orange",
        "value_type": "hex",
        "value": "#f4ad42"
      }
    ]
  }
...

Examples

Look in the examples folder

Projects using this package format: