Thing Type Association

Association between thing types

Overview

Association is a way of grouping objects, where every object is related to one or more objects in a unique way. You can create association between thing types, which in turn enables you to create association between thing instances of the associated thing types. However, the scope of the association between thing types depends on the scope of the package to which the thing types belong.

For example, a Truck carries multiple Cars. The thing type Truck has 1:N association with the thing type Car as illustrated in the following diagram.

A Bogie is part of an Engine. The thing type Bogie has 1:1 association with the thing type Engine as illustrated in the following diagram.

Types of Association

The following are the predefined association types:

  • onetomany

  • onetoone

  • manytomany

  • manytoone

Types of Relationship

The following are the predefined relationship types:

  • IS A: Car is a type of vehicle. You can associate the thing type Car with the thing type Vehicle and assign the IS A relationship.

  • HAS A: Car has wheels. You can associate the thing type Wheel with the thing type Car and assign the HAS A relationship.

  • PART OF: Bogie is part of the engine. You can associate the thing type Bogie with the thing type Engine and assign the PART OF relationship.

OData Version: 2.0

Root URI://<server address>[:<port number>][/path]/ThingConfiguration

Example for a base URI in a cloud foundry environment: https://config-thing-sap.cfapps.eu10.hana.ondemand.com/ThingConfiguration

Operations

CRUD Operations

HTTP Method Operation URI Scope
POST Create Thing Type Association /v1/ThingType('<thing type name')/ObjectAssociations <thingconf>.c
GET Read Association Details of a Thing Type /v1/ThingType('<thing type name')/ObjectAssociations <thingconf>.r
DELETE Delete Thing Type Association /v1/ObjectAssociations(PrimaryEntity='<thing type name>',AssociatedEntity='<thing type name>',Relationship='<relationship name>') <thingconf>.d

Thing Type Association Object Properties

Property Type Mandatory Maximum Length Description
AssociatedEntity String Yes 81 Thing type associated with the primary thing type
Descriptions Array of description objects No - Description of the thing type association for each language with the corresponding ISO language code
AssociationType String Yes 20 Type of association between the primary thing type and the associated thing type
Relationship String Yes 50 Type of relationship between the primary thing type and the associated thing type
ExpiryTime TimeStamp No 50 Expiry time after which the association between the thing types becomes invalid
CreationTime TimeStamp No 50 Time when the association is created, which is the current time

Thing Type Association Description Properties

Property Data Type Maximum Length Description
LanguageCode String 2 ISO code of the language of the object description
Description String 60 Description of the object