# Type Definitions Inheritance

# General Rules

  • Type Definitions can be extended using inheritance.
  • Inheritance is defined by the baseTypes property.
  • A derived type can inherit from multiple base type definitions using the same rules as for inheritance from one type.
  • Derived type and base type definitions must use the same "Model Definition".
  • Derived type and base type definitions cannot have different values for isExtensible property.
  • The baseTypes property is an array and contains a list of type definition IDs and full semantic version numbers in the format type.definition@major.minor.patch.
  • Derived types cannot override anything defined in the base types except the following:
    • Default values of properties can be overridden as long as they are compliant with their data type, and with all defined properties in the base type. It is forbidden to redefine other properties or values when redefining/adding the default value in a derived type. It is acceptable to duplicate this derived definition in the derived type attribute (fully or partially).
    • Types in relatedModels and references can be overridden as long as they are covariant to the type defined in the base type (more on that later).
    • Multiple derived type definitions of one base type cannot override properties, variables, attributes, and methods of another base type.
  • Map data types are, as with all other properties, allowed to be overwritten on the derived type level with only the derived type "value". ​
  • References defined in type definitions support covariance. This means that a reference definition in a type definition can target a base type and references in actual object models can point to derived types of the specified target.
  • Re-declaring the same JSON properties (in complex top-level JSON properties) is not supported due to the need of creating definition when those properties are equal.
  • It is invalid to loop over base types.
  • It is invalid to inherit twice from the same type definition or its different versions.
  • References attributes collision is allowed neither in base types nor in derived types.
  • Attributes can be shared among derived types, unless attributes are overlapped by other base types or derived types.

# Impact on Semantic Versioning​

Base types will always be specified with their exact version number type.definition@major.minor.revision. Therefore, changing a base type does not incur any change into derived types directly. However, changing the baseType(s) of a type definition must adhere to the following rules:

  • ​Removing a base type is a major change as it impacts not only instances but also makes it incompatible with references that use that base type as a target (due to covariance on object model level).
  • Adding a base type is a major change as potentially new properties can be introduced that have no default value.
  • Changing the version of an existing base type enforces the same level of change on the derived type, e.g., a change from baseType@1.2.0 to baseType@1.3.0 in myType@1.0.0's baseTypes will require increasing the minor version of the myType to 1.1.0 (myType@1.1.0).

More about classification of changes

See the article Type Definitions Semantic Versioning to learn more about semantic versioning and version changes in particular cases.

# Top Level Simple JSON Properties​

These properties must be the same in the whole inheritance chain:

  • model
  • isExtensible

These properties will be overridden by derived type definition:

  • ​​typeId
  • version
  • baseTypes

These properties will be overridden or removed if not defined by the derived type definition:

  • name
  • description

# Valid Example

The following example contains partial data for better readability.​

Base Type Definition

{
  "model": "abb.ability.device",
  "typeId": "base.b",
  "version": "1.0.0",
  "isExtensible": false,
  "name": "Base type B",
  "description": "This is sample BASE type"
}

Derived Type Definition

{
  "model": "abb.ability.device",
  "typeId": "derived",
  "version": "2.0.0",
  "baseTypes": ["base.b@1.0.0"],
  "name": "Child type"
}

Holistic view of derived type

{
  "model": "abb.ability.device",
  "typeId": "derived",
  "isExtensible": false,
  "version": "2.0.0",
  "baseTypes": ["base.b@1.0.0"],
  "name": "Child type"
}

# Covariance

References defined in type definitions support covariance. A reference definition in a type can point to a base type and on an instance level also derived types can be used for it. Derived types are allowed to override types in relatedModels as well as in references with a covariant type definition.​

The following covariance examples contain partial data for better readability.

# Type Definition

{  
  "typeId": "base.type.a",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "configuration.type@1"
    }
  },
  "references": {
    "motor": {
      "to": [
        {
          "type": "base.type.b@1"
        },
        {
          "type": "base.type.c@1"
        }
      ]
    }
  }
}

# Valid Covariance Examples

# Covariance Example 1

Override relatedModel by a type (derived.type.of.configuration.type@1) derived from the type (configuration.type@1) in the base type definition.

{  
  "typeId": "derived.of.a",
  "model": "abb.ability.device",
  "baseTypes": ["base.type.a@1.0.0"],
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "derived.type.of.configuration.type@1"
    }
  }
}

# Covariance Example 2

Override to in “motor” reference with a derived type from the base types.

NOTE

The to array in the derived type must contain all types supported for references (both covariant types and the ones duplicated with base types).

{  
  "typeId": "derived.of.a",
  "model": "abb.ability.device",
  "baseTypes": ["base.type.a@1.0.0"],
  "version": "1.0.0",
  "references": {
    "motor": {
      "to": [
        {
          "type": "base.type.b@1"
        },
        {
          "type": "derived.of.c@1"
        }
      ]
    }
  }
}

# Object Model Covariance Examples (based on type above)

{
  "type": "base.type.a@1",
  "objectId" : "123"
}

The reference "motor" can be made to the following instances as valid examples:

{
  "type": "basetype.b@1",
  "objectId" : "345"
}

{
  "type": "derived.of.b@1",
  "objectId" : "678"
}

{
  "type": "derived.of.c@1",
  "objectId" : "901"
}

{
  "type": "derived.of.b@1",
  "objectId" : "111"
}

{
  "type": "derived.of.derived.of.c@1",
  "objectId" : "222"
}

# Forbidden Reference Inheritance Examples

# Example 1

In the example below, type T2 cannot add reference to B, since T1 did not define it.

type T1
references:
  mychildren:
    to: [ A ]

type T2
baseTypes: [ T1 ]
references:
  mychildren:
    to: [ A, B ] <-- Can't add type B because parent only has A

# Example 2​​​​

Base types of some type definition cannot both have the same reference name.

type T1
references:
  mychildren:
    to: [ A ]

type T2
references:
  mychildren:
    to: [ B ]

type T3
baseTypes: [ T1, T2 ] <-- T1 and T2 both have "mychildren" reference defined, causing conflict

InfoModel Schema Metadata Management: Workflow information like Latest Status, Last updated Timestamp can be added to the output response of type definition with help of workflow collection stored in database. Fetch this information via Getworkflow end point in the API as:

Infomodel Delete Endpoint

The output of this Getworkflow API for type definition

{
     "model": "abb.ability.configuration",
     "typeId": "Test.TD.240523.050619.294912.e99c15",
     "version": "1.0.0",
     "baseTypes": [
       "Test.TD.240523.050526.988250.fa3363@1.0.0",
       "Test.TD.240523.050554.514508.dca3b9@1.0.0"
     ],
     "isDeleted": false,
     "WorkFlowStatus": {
       "CreateTimeStamp": "2024-05-23T05:07:07Z",
       "LastUpdateTimeStamp": "2024-05-23T05:07:07Z",
       "ModeOfCreation": "TextSchema",
       "PayloadSize": "0.212890625 KB"
     }
   }

# Holistic View with relatedModels and references​

# Valid Use Cases of relatedModels​

# Example 1

Base type​

{
  "typeId": "base.type.a",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "configuration.type@1"
    },
    "structure": {
      "type": "structure.type@1"
    }
  }
}

Derived Type Definition

{
  "typeId": "derived.of.a",
  "model": "abb.ability.device",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "derived.of.configuration.type@1"
    }
  }
}

Holistic view

{
  "typeId": "derived.of.a",
  "model": "abb.ability.device",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "derived.of.configuration.type@1"
    },
    "structure": {
      "type": "structure.type@1"
    }
  }
}

# Example 2

Base Type Definition

{
  "typeId": "base.type.a",
  "model": "model1",
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "configuration.type@1"
    },
    "structure": {
      "type": "structure.type@1"
    }
  }
}

Derived Type Definition

{
  "typeId": "derived.of.a",
  "model": "model1",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "derived.of.configuration.type@1"
    },
    "structure": {
      "type": "structure.type@1"
    }
  }
}

Holistic view

{
  "typeId": "derived.of.a",
  "model": "model1",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "version": "1.0.0",
  "relatedModels": {
    "configuration": {
      "type": "derived.of.configuration.type@1"
    },
    "structure": {
      "type": "structure.type@1"
    }
  }
}

# Valid Use Cases of References​

Base Type Definition

{
  "version": "1.0.0",
  "model": "abb.ability.device",
  "typeId": "base.type.a",
  "references": {
    "reference1": {
      "to": [
        {
          "type": "a@1"
        },
        {
          "type": "b@1"
        }
      ]
    }
  }
}

Derived Type Definition

{
  "version": "1.0.0",
  "model": "model1",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "typeId": "derived.of.a",
  "references": {
    "reference2": {
      "to": [
        {
          "type": "d@1"
        },
        {
          "type": "g@1"
        }
      ]
    }
  }

Holistic view

{
  "version": "1.0.0",
  "model": "model1",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "typeId": "derived.of.a",
  "references": {
    "reference1": {
      "to": [
        {
          "type": "a@1"
        },
        {
          "type": "b@1"
        }
      ]
    },
    "reference2": {
      "to": [
        {
          "type": "d@1"
        },
        {
          "type": "g@1"
        }
      ]
    }
  }
}

# Invalid Use Cases of References

Attributes defined in the base type cannot be overwritten (changed or removed). The following base type contains two errors. The first error is caused by trying to remove the min attribute in the derived type. The second error is caused by not specifying isHierarchical as 'false' in the derived type.

Base Type Definition

{
  "version": "1.0.0",
  "model": "model1",
  "typeId": "base.type.a",
  "references": {
    "reference1": {
      "to": [
        {
          "type": "a@1",
          "min": 2
        },
        {
          "type": "b@1"
        }
      ],
      "isHierarchical": false
    }
  }
}

Derived Type Definition

{
  "version": "1.0.0",
  "model": "model1",
  "baseTypes": [
    "base.type.a@1.0.0"
  ],
  "typeId": "derived.of.a",
  "references": {
    "reference1": {
      "to": [
        {
          "type": "a@1"
        }
      ]
    },
    "reference2": {
      "to": [
        {
          "type": "d@1"
        },
        {
          "type": "g@1"
        }
      ]
    }
  }
}

# Type Definition Holistic View

The type definition holistic view is a JSON object representing a type definition registered in the Type Definitions Registry that contains all fields defined in both the type requested and all the base types it inherits from. This is especially useful with type definition inheritance now supported in the ABB Ability™ Platform. Use of the type definition holistic view eliminates the need to send multiple calls to the TDR to generate the desired UI, streamlining implementation.

NOTE

The TDR service provides a public API to retrieve a holistic view of a requested type.

# Example Type Definition

# Example 1

Property Merge

{
  "typeId": "base.A",
  "tags": [ "tag1" ],
  "model": "model1",
  "version": "1.0.0",
  "isDeleted": false,
  "properties": {
    "system": {
      "serialNumber": {
        "dataType": "string"
      }
    }
  }
}
{
  "typeId": "base.B",
  "tags": [ "tag2" ],
  "model": "model1",
  "version": "1.0.0",
  "isDeleted": false,
  "properties": {
    "system": {
      "bootSeriesVersion": {
        "dataType": "string"
      }
    }
  }
}
{
  "typeId": "subtype",
  "version": "1.0.0",
  "model": "model1",
  "isDeleted": false,
  "baseTypes": [ "base.A@1.0.0", "base.B@1.0.0" ],
  "properties": {
    "system": {
      "bootImageVersion": {
        "dataType": "string"
      }
    }
  }
}

Holistic View

{
  "typeId": "subtype",
  "isDeleted": false,
  "version": "1.0.0",
  "tags": [ "tag1", "tag2" ],
  "model": "model1",
  "baseTypes": [ "base.A@1.0.0", "base.B@1.0.0" ],
  "properties": {
    "system": {
      "serialNumber": {
        "dataType": "string"
      },
      "bootSeriesVersion": {
        "dataType": "string"
      },
      "bootImageVersion": {
        "dataType": "string"
      }
    }
  }
}

# Example 2

Two-level Base Types and Attributes Merge

{
  "model": "abb.ability.device",
  "typeId": "baseTypeAA",
  "version": "1.0.0",
  "attributes": {
    "temperature": {
      "dataType": "string",
      "appliesTo": [ "integer" ],
      "enum": [ "K", "C" ]
    }
  }
}
{
  "model": "abb.ability.device",
  "typeId": "baseTypeA",
  "version": "1.0.0",
  "attributes": {
    "height": {
      "dataType": "number",
      "appliesTo": [ "integer" ]
    }
  }
}
{
  "model": "abb.ability.device",
  "typeId": "baseTypeB",
  "baseTypes": [ "baseTypeAA@1.0.0" ],
  "version": "1.0.0",
  "attributes": {
    "width": {
      "dataType": "number",
      "appliesTo": [ "integer" ]
    }
  }
}
{
  "model": "abb.ability.device",
  "typeId": "subType",
  "baseTypes": [ "baseTypeA@1.0.0", "baseTypeB@1.0.0" ],
  "version": "1.0.0",
  "attributes": {
    "language": {
      "dataType": "string",
      "appliesTo": [ "string" ]
    }
  }
}

Holistic View

{
  "model": "abb.ability.device",
  "typeId": "subType",
  "baseTypes": [
    "baseTypeA@1.0.0",
    "baseTypeB@1.0.0"
  ],
  "version": "1.0.0",
  "attributes": {
    "language": {
      "dataType": "string",
      "appliesTo": [ "string" ]
    },
    "height": {
      "dataType": "number",
      "appliesTo": [ "integer" ]
    },
    "width": {
      "dataType": "number",
      "appliesTo": [ "integer" ]
    },
    "temperature": {
      "dataType": "string",
      "appliesTo": [ "integer" ],
      "enum": [ "K", "C" ]
    }
  }
}

# Example 3

Map

{
  "typeId": "base.A",
  "model": "model1",
  "version": "1.0.0",
  "properties": {
    "system": {
      "bootImageVersion": {
        "dataType": "map",
        "values": {
          "dataType": "string"
        },
        "value": { "foo": { "value": "a" } }
      }
    }
  }
}
{
  "typeId": "base.B",
  "model": "model1",
  "version": "1.0.0",
  "properties": {
    "system": {
      "serialNumber": {
      "dataType": "string"
      },
      "bootSeriesVersion": {
        "dataType": "map",
        "values": {
          "dataType": "string"
        },
        "value": { "foo": { "value": "a" } }
      }
    }
  }
}
{
  "typeId": "subtype",
  "version": "1.0.0",
  "model": "model1",
  "baseTypes": [ "base.A@1.0.0", "base.B@1.0.0" ],
  "properties": {
    "system": {
      "someOtherProperty": {
        "dataType": "string"
      },
      "bootSeriesVersion2": {
      "dataType": "string"
      }
    }
  }
}

Holistic View

{
  "typeId": "subtype",
  "version": "1.0.0",
  "model": "model1",
  "baseTypes": [ "base.A@1.0.0", "base.B@1.0.0" ],
  "properties": {
    "system": {
      "bootImageVersion": {
        "dataType": "map",
        "values": {
          "dataType": "string"
        },
        "value": { "foo": { "value": "a" } }
      },
      "serialNumber": {
        "dataType": "string"
      },
      "bootSeriesVersion": {
        "dataType": "map",
        "values": {
          "dataType": "string"
        },
        "value": { "foo": { "value": "a" } }
      },
      "someOtherProperty": {
        "dataType": "string"
      },
      "bootSeriesVersion2": {
        "dataType": "string"
      }
    }
  }
}

# Extra Top-level JSON Properties​

Extra top-level JSON properties that are not defined as “metadata” in “abb.ability.*” schemas but exist in example payloads are:

  • tags – merged arrays from derived and base type definitions (duplicates are removed)
  • other properties – other extra top level properties are being overwritten by derived type

# Valid Example

The following example contains partial data for better readability.​​

Base Type Definition

{
  "model": "abb.ability.device",
  "typeId": "base.b",
  "version": "1.0.0",
  "baseTypes": ["base.a@1.0.0"],
  "isExtensible": false,
  "name": "Base type B",
  "description": "This is sample BASE type"
}

Derived Type Definition

{
  "model": "abb.ability.device",
  "typeId": "derived.b",
  "version": "2.0.0",
  "baseTypes": ["base.b@1.0.0"],
  "name": "Derived type from B"
}

# Tags

# Valid Example

The following example contains partial data for better readability.​​

Base Type Definition

{
  "tags": ["foo", "baz"]
}

Derived Type Definition

{
  "tags": ["foo", "bar"]
}

Holistic view of derived type definition

{
  "tags": ["foo", "bar", "baz"]
}

# Attributes

Inheritance includes attributes. Have a look at examples below.

# Valid Example

The following example contains partial data for better readability.​​​ The example is only for the attributes property, however the same rule applies for others.

Base Type Definition A

{
  "typeId": "base.a",
  "version": "1.0.0",
  "attributes": {
    "unit": {
      "dataType": "string",
      "appliesTo": [
        "number"
      ]
    }}
}

Base Type Definition B

{
  "typeId": "base.b",
  "version": "1.0.0",
  "attributes": {
    "min": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }}
}

Derived Type Definition

{
  "typeId": "derivedType",
  "version": "1.0.0",
  "baseTypes": [
    "base.a@1.0.0",
    "base.b@1.0.0"
  ],
  "attributes": {
    "max": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }
  }
}

Holistic View of Derived Type

{
  "typeId": "derivedType",
  "version": "1.0.0",
  "baseTypes": [
    "base.a@1.0.0",
    "base.b@1.0.0"
  ],
  "attributes": {
    "unit": {
      "dataType": "string",
      "appliesTo": [
        "number"
      ]
    },
    "min": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    },
    "max": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }
  }
}

# Invalid Example 1 (Base Type Definitions Collision)

The following example contains partial data for better readability.​​​

Base Type Definition A

{
  "typeId": "base.a",
  "version": "1.0.0",
  "attributes": {
    "min": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }}
}

Base Type Definition B

{
  "typeId": "base.b",
  "version": "1.0.0",
  "attributes": {
    "min": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }}
}

Derived Type Definition

{
  "typeId": "derived",
  "version": "1.0.0",
  "baseTypes": ["base.a@1.0.0", "base.b@1.0.0"]
}

# Invalid Example 2 (Derived Type Collision)​

The following example contains partial data for better readability.​​​

Base Type Definition A

{
  "typeId": "base.a",
  "version": "1.0.0"
}

Base Type Definition B

{
  "typeId": "base.b",
  "version": "1.0.0",
  "attributes": {
    "max": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }}
}

Derived Type Definition

{
  "typeId": "derived",
  "version": "1.0.0",
  "baseTypes": [
    "base.a@1.0.0",
    "base.b@1.0.0"
  ],
  "attributes": {
    "max": {
      "dataType": "number",
      "appliesTo": [
        "integer"
      ]
    }
  }
}

# Components from Model Definition that Support Nesting (Grouping)

A Category is a special JSON property that can appear in properties and in variables that provides a grouping feature. The name of this property is the name of the grouped sub-properties. A group can contain standard properties and variables respectively as well as other groups. A group cannot contain attributes. It is possible to extend a group using the same rule as in the case of properties without nesting (group is treated as top level one).

Components:

  • properties
  • variables
  • methods
  • attributes

# Valid Example

The following example contains partial data for better readability.​​​ ​

Base Type Definition A

{
  "typeId": "base.a",
  "version": "1.0.0",
  "properties": {
    "height": {
      "dataType": "number"
    },
    "system": {
      "bootImageVersion": {
        "dataType": "string",
        "value": "1.0.0"
      }
    }
  }
}

Base Type Definition B

{
  "typeId": "base.b",
  "version": "1.0.0",
  "properties": {
    "width": {
      "dataType": "number"
    }}
}

Derived Type Definition

TIP

Overriding the default value of a base type property is allowed.

{
  "typeId": "derived",
  "version": "1.0.0",
  "baseTypes": [
    "base.a@1.0.0",
    "base.b@1.0.0"
  ],
  "properties": {
    "system": {
      "bootImageVersion": {
        "value": "2.0.0"
      },
      "bootImageDate": {
        "dataType": "string"
      }
    }
  }
}

Holistic view

{
  "typeId": "derived",
  "version": "1.0.0",
  "baseTypes": [
    "base.a@1.0.0",
    "base.b@1.0.0"
  ],
  "properties": {
    "height": {
      "dataType": "number"
    },
    "width": {
      "dataType": "number"
    },
    "system": {
      "bootImageVersion": {
        "dataType": "string",
        "value": "2.0.0"
      },
      "bootImageDate": {
        "dataType": "string"
      }
    }
  }
}

TIP

Inheriting multiple times from the same type (even though major versions are different) is forbidden.

# Valid Overriding Examples

# Example 1

Base Type Definition

{
  "typeId": "base.a",
  "version": "1.0.0",
  "model": "abb.ability.device",
  "properties": {
    "system": {
      "bootImageVersion": {
        "dataType": "string"
      },
      "bootImageDate": {
        "dataType": "string"
      }
    }
  }
}

Derived Type Definition

{
  "typeId": "derived",
  "version": "1.0.0",
  "model": "abb.ability.device",
  "baseTypes": [
    "base.a@1.0.0"
  ],
  "properties": {
    "system": {
      "bootImageVersion": {
        "value": "2.0.0"
      },
      "bootImageDate": {
        "dataType": "string",
        "value": "2.0.1"
      }
    }
  }
}

Holistic view

{
  "typeId": "derived",
  "version": "1.0.0",
  "model": "abb.ability.device",
  "baseTypes": [
    "base.a@1.0.0"
  ],
  "properties": {
    "system": {
      "bootImageVersion": {
        "dataType": "string",
        "value": "2.0.0"
      },
      "bootImageDate": {
        "dataType": "string",
        "value": "2.0.1"
      }
    }
  }
}

# Syntax Variety (Define/Overwrite Value)

Base Type Definition

{
  "typeId": "baseType.a",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "properties": {
    "height": {
      "dataType": "integer",
      "unit": "K"
    },
    "width": {
      "dataType": "number"
    },
    "length": {
      "dataType": "number",
      "enum": [
        1,
        1.1,
        1.2
      ]
    },
    "system": {
      "bootImageVersion": {
        "dataType": "string",
        "value": "2.0.0"
      },
      "bootImageDate": {
        "dataType": "string",
        "value": "2.0.0"
      }
    }
  },
  "attributes ": {
    "unit": {
      "dataType": "string"
    }
  }
}

Allowed Derived Type Definition

{
  "typeId": "derived.a",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "baseTypes": [
    " baseType.a@1.0.0"
  ],
  "properties": {
    "height": {
      "value": 21,
      "unit": "K"
    },
    "width": {
      "value": 7.3
    },
    "length": {
      "value": 1.1
    },
    "system": {
      "bootImageVersion": {
        "value": "2.0.1"
      },
      "bootImageDate": {
        "dataType": "string",
        "value": "2.0.0"
      }
    }
  }
}

Forbidden Derived Type Definition

{
  "typeId": "derived.b",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "baseTypes": [
    " baseType.a@1.0.0"
  ],
  "properties": {
    "height": {
      "value": 21,
      "unit": "Km" //not allowed to redefine attributes
    },
    "width": {
      "value": "7.3" //not allowed: base definition is no longer consistent with derived type 
    },
    "length": {
      "value": 1.5 //not allowed: base definition is no longer consistent with derived type  
    },
    "system": {
      "bootImageVersion": {
        "value": "2.0.1",
        "unit": "K"//not allowed to add attributes that extend base definition
      },
      "bootImageDate": {
        "dataType": "number", //not allowed: base definition is no longer consistent with derived type  
        "value": 2.0
      }
    }
  }
}

# Prohibited Scenarios

# Example 1

Type definitions may be inherited once and only once from the same type. Creation of the derived.derived.type.a type definition in the following example is forbidden. It will be treated as an attempt to inherit multiple times from the same type. Note that the base.a type is already a part of the derived.type.a (full) holisticView.

{
  "typeId": "base.a",
  "model": "abb.ability.device",
  "version": "1.0.0",
  "properties": {
    "system": {
      "serialNumber": {
        "dataType": "number"
      }
    },
    "deviceName": {
      "dataType": "string"
    }
  }
}

{
  "typeId": "derived.type.a",
  "baseTypes": [
    "base.a@1.0.0"
  ],
  "model": "abb.ability.device",
  "version": "1.0.0",
  "properties": {
    "system": {
      "systemName": {
        "dataType": "number"
      }
    },
    "device": {
      "dataType": "string"
    }
  }
}

{
  "typeId": "derived.derived.type.a",
  "baseTypes": [
    "base.a@1.0.0", "derived.type.a@1.0.0" // WRONG! base.a type is already a part of derived.type.A (full) holisticView
  ],
  "model": "abb.ability.device",
  "version": "1.0.0",
  "properties": {
    "system": {
      "device": {
        "dataType": "string"
      }
    }
  }
}

# Example 2

In the following example, the type definition in the third code block will be rejected, as it is forbidden to inherit twice from the same type definition or its different versions.

{
  "model": "abb.ability.device",
  "typeId": "base.typeDefinition.a",
  "version": "1.0.0"
}
{
  "model": "abb.ability.device",
  "typeId": "base.typeDefinition.a",
  "version": "2.0.0"
}
{
  "model": "abb.ability.device",
  "typeId": "derived.typeDefinitions.a",
  "baseTypes": ["base.typeDefinition.a@1.0.0", "base.typeDefinition.a@2.0.0"],
  "version": "1.0.0"
}
Last updated: 7/26/2024, 7:00:24 AM
Feedback