Importing complex relations

Command structure
[
  {
    "resourceType": "Complex Relation",
    "identifier": {
      "externalSystemId": "EXT_SYSTEM",
      "externalEntityId": "Asset_1234"
    },
    "complexRelationType": {
      "name": "Field Mapping"
    },
    "attributes": {
      "Original Column Name": [
        {
          "value": "XXX_COLUMN_1"
        }
      ],
      "00000000-0000-0000-0001-000500000011": [
        {
          "value": "True"
        }
      ]
    },
    "relations": {
      "00000000-0000-0000-0000-000000007088:TARGET": [
        {
          "name": "Asset 2",
          "domain": {
            "name": "Data Asset Domain 1",
            "community": {
              "name": "Data Community"
            }
          }
        }
      ],
      "00000000-0000-0000-0000-000000007089:TARGET": [
        {
          "name": "Table representation Asset",
          "domain": {
            "name": "Business Asset Domain 2",
            "community": {
              "name": "Business Community"
            }
          }
        }
      ]
    }
  }
]

Identifier

The identifier for a complex relation may contain any of the following fields:

  • id
  • externalSystemId and externalEntityId
  • RELATION_TYPE_ID:RELATION_DIRECTION

    The list of relations, also known as complex relation legs, does not guarantee the unique identification of a complex relation. This method is prone to error in cases where there are two complex relations in Collibra:

    • One complex relation with legs A, B and C.
    • Another complex relation with legs A, B, C and D.

    In this example, identifying a complex relation by the legs A, B and C results in an error because the API cannot determine which of the two complex relations it should process. In cases like this, use one of the other identification methods.

Code snippets in this section may show redundant data to demonstrate the fields accepted by the import API.

Identifier structure
{
  "id": "12345678-1234-1234-1234-123456788765",
  "relations": {
    "00000000-0000-0000-0000-000000007088:TARGET": [
      {
        "name": "Data Element Source Asset 1",
        "domain": {
          "name": "Data Domain 1",
          "community": {
            "name": "The Community"
          }
        }
      },
      {
        "name": "Data Element Source Asset 2",
        "domain": {
          "name": "Data Domain 1",
          "community": {
            "name": "The Community"
          }
        }
      }
    ],
    "00000000-0000-0000-0000-000000007089:TARGET": [
      {
        "name": "Data Element Target Asset 1",
        "domain": {
          "name": "Data Domain 2",
          "community": {
            "name": "The Community"
          }
        }
      },
      {
        "name": "Data Element Target Asset 2",
        "domain": {
          "name": "Data Domain 2",
          "community": {
            "name": "The Community"
          }
        }
      }
    ],
    "00000000-0000-0000-0000-000000007090:TARGET": [
      {
        "name": "Mapping Specs 1",
        "domain": {
          "name": "Mapping Specs Domain",
          "community": {
            "name": "The Community"
          }
        }
      }
    ]
  },
  "externalSystemId": "EXT_SYSTEM",
  "externalEntityId": "Asset_1234"
}

Optional fields

Field name Field type Remarks
attributes ATTRIBUTE_TYPE_ID or ATTRIBUTE_TYPE_NAME Sets or updates the complex relation attributes.
complexRelationType id or name Sets the complex relation type. Should only be used for create operations. It is silently ignored for update operations.
relations RELATION_TYPE_ID:RELATION_DIRECTION Sets or updates the relations of the complex relation based on the relation type id and the direction.

Expected behavior

The behavior is similar to the commands for communities and domains.

Add operation

If the complex relation needs to be created, the following fields have to be provided in order to import successfully:

  • relations