> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/working-with-the-import-api-v2/sample-use-cases.md).

# Sample use cases

## Add a community, a domain with assets representing schema, tables, columns and the relevant relations

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the following assets to the created domain: `SCHEMA_1`, `TABLE_1`, `TABLE_2`, `TAB_1_COLUMN_1`, `TAB_1_COLUMN_2`, `TAB_2_COLUMN_1`.
* Creates the relations:
  * `SCHEMA_1 contains TABLE_1`.
  * `SCHEMA_1 contains TABLE_2`.
  * `TAB_1_COLUMN_1 is part of TABLE_1`.
  * `TAB_1_COLUMN_2 is part of TABLE_1`.
  * `TAB_2_COLUMN_1 is part of TABLE_2`.

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "SCHEMA_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Schema"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TABLE_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "name": "SCHEMA_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TABLE_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "name": "SCHEMA_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_1_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_1_COLUMN_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_2_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_2",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
}]
```

## Import mappings for assets

The JSON in this section creates mappings for schema, table and column assets.

{% hint style="info" %}
This example works only if the referenced resources exist. Run the import commands from the beginning of this page to create them.
{% endhint %}

The following mappings are created, in an environment where these resources do not exist yet:

* (`EXT_SYSTEM`, `EXT_SCHEMA_1_ID`) → `SCHEMA_1`.
* (`EXT_SYSTEM`, `EXT_TABLE_1_ID`) → `TABLE_1`.
* (`EXT_SYSTEM`, `EXT_TABLE_2_ID`) → `TABLE_2`.
* (`EXT_SYSTEM`, `EXT_TABLE_1_COLUMN_1_ID`) → `TAB_1_COLUMN_1`.
* (`EXT_SYSTEM`, `EXT_TABLE_1_COLUMN_2_ID`) → `TAB_1_COLUMN_2`.
* (`EXT_SYSTEM`, `EXT_TABLE_2_COLUMN_1_ID`) → `TAB_2_COLUMN_1`.

{% hint style="info" %}
When you manually delete a resource that is referenced by a mapping, the mapping is not also deleted. Only the reference to the deleted resource in the mapping is removed. This helps external systems detect that Collibra used to store resources that are now deleted. The external systems can then decide to take appropriate action.
{% endhint %}

### Input

```json
[{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_SCHEMA_1_ID"
  },
  "asset": {
    "name": "SCHEMA_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
},
{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_ID"
  },
  "asset": {
    "name": "TABLE_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
},
{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_2_ID"
  },
  "asset": {
    "name": "TABLE_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
},
{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_COLUMN_1_ID"
  },
  "asset": {
    "name": "TAB_1_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
},
{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_COLUMN_2_ID"
  },
  "asset": {
    "name": "TAB_1_COLUMN_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
},
{
  "resourceType": "Mapping",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_2_COLUMN_1_ID"
  },
  "asset": {
    "name": "TAB_2_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  }
}]
```

## Import assets and create mappings implicitly

You can import assets and their mappings within the same input file.

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the following assets to the created domain: `SCHEMA_1`, `TABLE_1`, `TABLE_2`, `TAB_1_COLUMN_1`, `TAB_1_COLUMN_2`, `TAB_2_COLUMN_1`.
* Creates the relations:
  * `SCHEMA_1 contains TABLE_1`.
  * `SCHEMA_1 contains TABLE_2`.
  * `TAB_1_COLUMN_1 is part of TABLE_1`.
  * `TAB_1_COLUMN_2 is part of TABLE_1`.
  * `TAB_2_COLUMN_1 is part of TABLE_2`.
* Creates the mappings:
  * (`EXT_SYSTEM`, `EXT_SCHEMA_1_ID`) → `SCHEMA_1`.
  * (`EXT_SYSTEM`, `EXT_TABLE_1_ID`) → `TABLE_1`.
  * (`EXT_SYSTEM`, `EXT_TABLE_2_ID`) → `TABLE_2`.
  * (`EXT_SYSTEM`, `EXT_TABLE_1_COLUMN_1_ID`) → `TAB_1_COLUMN_1`.
  * (`EXT_SYSTEM`, `EXT_TABLE_1_COLUMN_2_ID`) → `TAB_1_COLUMN_2`.
  * (`EXT_SYSTEM`, `EXT_TABLE_2_COLUMN_1_ID`) → `TAB_2_COLUMN_1`.

{% hint style="info" %}
When you manually delete a resource that is referenced by a mapping, the mapping is not also deleted. Only the reference to the deleted resource in the mapping is removed. This helps external systems detect that Collibra used to store resources that are now deleted. The external systems can then decide to take appropriate action.
{% endhint %}

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_SCHEMA_1_ID"
  },
  "name": "SCHEMA_1",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Schema"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_ID"
  },
  "name": "TABLE_1",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "externalSystemId": "EXT_SYSTEM",
        "externalEntityId": "EXT_SCHEMA_1_ID"
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_2_ID"
  },
  "name": "TABLE_2",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "externalSystemId": "EXT_SYSTEM",
        "externalEntityId": "EXT_SCHEMA_1_ID"
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_COLUMN_1_ID"
  },
  "name": "TAB_1_COLUMN_1",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "externalSystemId": "EXT_SYSTEM",
        "externalEntityId": "EXT_TABLE_1_ID"
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_COLUMN_2_ID"
  },
  "name": "TAB_1_COLUMN_2",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "externalSystemId": "EXT_SYSTEM",
        "externalEntityId": "EXT_TABLE_1_ID"
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_2_COLUMN_1_ID"
  },
  "name": "TAB_2_COLUMN_1",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "externalSystemId": "EXT_SYSTEM",
        "externalEntityId": "EXT_TABLE_2_ID"
      }
    ]
  }
}]
```

## Modify an asset using the asset mapping as identification

You can update an asset using the asset mapping as identifier.

{% hint style="info" %}
This example works only if the referenced resources exist. Run the import commands from the beginning of this page to create them.
{% endhint %}

### Input

```json
[{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE_1_COLUMN_1_ID"
  },
  "name": "TAB_1_COLUMN_1_NEW"
}]
```

## Update schema, table and column assets

{% hint style="info" %}
This example works only if the referenced resources exist. Run the import commands from the beginning of this page to create them.
{% endhint %}

The JSON in this section performs the following operations:

* Changes the display name of `SCHEMA_1` to **SCHEMA**.
* Changes the display name of `TABLE_1` to **T1**.
* Changes the display name of `TABLE_2` to **T2**.
* Changes the display name of `TAB_1_COLUMN_1` to **C1**.
* Changes the display name of `TAB_1_COLUMN_2` to **C2**.
* Changes the display name of `TAB_2_COLUMN_1` to **C3**.

### Input

```json
[{
  "resourceType": "Asset",
  "identifier": {
    "name": "SCHEMA_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "displayName": "SCHEMA",
  "type": {
    "name": "Schema"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TABLE_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "displayName": "T1",
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "name": "SCHEMA_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TABLE_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "displayName": "T2",
  "type": {
    "name": "Table"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007043:SOURCE": [
      {
        "name": "SCHEMA_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_1_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  },
  "displayName": "C1",
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_1_COLUMN_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "displayName": "C2",
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "TAB_2_COLUMN_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "displayName": "C3",
  "type": {
    "name": "Column"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007042:TARGET": [
      {
        "name": "TABLE_2",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  }
}]
```

## Import multiple resource attributes

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the asset `DB_TABLE` to the created domain with the following attributes:
  * Profiling Information.
  * Description.

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_TABLE",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Table"
  },
  "attributes": {
    "Description": [
      {
        "value": "The Users table"
      }
    ],
    "Profiling Information": [
      {
        "value": "Please do"
      }
    ]
  }
}]
```

## Import multivalue attributes

For this example to work, you must create a new attribute type and assign it to the **Table** asset type in Collibra Platform.

<details>

<summary>Show me how</summary>

{% stepper %}
{% step %}
On the main toolbar, click <img src="/files/0fb2QWFHlr6EGdjVKBVW" alt="Products icon" data-size="line"> → <img src="/files/4TrHCnXp2WcnOdFcaeqL" alt="Cogwheel icon" data-size="line"> **Settings**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Settings** page opens.
{% endstep %}

{% step %}
Click **Attribute types**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The attributes table opens.
{% endstep %}

{% step %}
Above the table, to the right, click **Add**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Create Attribute Type** dialog box appears.
{% endstep %}

{% step %}
Enter the required information.

| Field         | Value                                                           |
| ------------- | --------------------------------------------------------------- |
| Name          | Indexes                                                         |
| Kind          | Multiple Selection                                              |
| with values   | surname name id (press <kbd>Enter</kbd> to separate each value) |
| {% endstep %} |                                                                 |

{% step %}
Click **Save**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The attribute type Indexes is created.
{% endstep %}

{% step %}
Click **Asset Types**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The asset type table appears.
{% endstep %}

{% step %}
In the asset type table, select the **Table** asset type.\ <i class="fa-chevrons-right">:chevrons-right:</i> The asset type editor opens.
{% endstep %}

{% step %}
In the tab pane, click **Global assignment**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The global assignments: characteristic table appears.
{% endstep %}

{% step %}
Above the table, to the right, click **Edit**.
{% endstep %}

{% step %}
Above the table, to the right, click **Add characteristic**.\ <i class="fa-chevrons-right">:chevrons-right:</i> The **Add a Characteristic** dialog box appears.
{% endstep %}

{% step %}
Select **Indexes**.
{% endstep %}

{% step %}
Above the table, to the right, click **Save**.
{% endstep %}
{% endstepper %}

</details>

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the asset `DB_TABLE` to the created domain with the following multivalue attribute:
  * Indexes.

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "externalSystemId": "EXT_SYSTEM",
    "externalEntityId": "EXT_TABLE"
  },
  "name": "DB_TABLE",
  "domain": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Table"
  },
  "attributes": {
    "Indexes": [
      {
        "values": [ "surname", "name" ]
      }
    ]
  }
}]
```

## Import relations

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the asset `DB_SCHEMA` without relations.
* Adds the asset `DB_TABLE` with a source relation to `USERS_SCHEMA`.
* Adds the asset `DB_COLUMN` with a target relation to `USERS_TABLE`.

You can specify relation types in multiple ways:

* Using the relation type resource ID and the relation direction separated by a colon, for example: `00000000-0000-0000-0000-000000007042:TARGET`.
* Using the relation type public ID and the relation direction separated by a colon, for example: `PUBLIC_ID:ColumnIsPartOfTable:TARGET`.
* Using a fully qualified relation type name separated by colons and the relation direction also separated by a colon, for example: `Schema:contains:is part of:Table:SOURCE`.

{% hint style="info" %}
You can not use the fully qualified name to specify a relation type if the name of the relation type contains a colon.
{% endhint %}

### Input

```json
[
  {
    "resourceType": "Community",
    "identifier": {
      "name": "DBs Community"
    }
  },
  {
    "resourceType": "Domain",
    "identifier": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    },
    "type": {
      "name": "Physical Data Dictionary"
    }
  },
  {
    "resourceType": "Asset",
    "identifier": {
      "name": "DB_SCHEMA",
      "domain": {
        "name": "Physical Domain",
        "community": {
          "name": "DBs Community"
        }
      }
    },
    "type": {
      "name": "Schema"
    }
  },
  {
    "resourceType": "Asset",
    "identifier": {
      "name": "DB_TABLE",
      "domain": {
        "name": "Physical Domain",
        "community": {
          "name": "DBs Community"
        }
      }
    },
    "type": {
      "name": "Table"
    },
    "relations": {
      "SchemaContainsTable:SOURCE": [
        {
          "name": "DB_SCHEMA",
          "domain": {
            "name": "Physical Domain",
            "community": {
              "name": "DBs Community"
            }
          }
        }
      ]
    }
  },
  {
    "resourceType": "Asset",
    "identifier": {
      "name": "DB_COLUMN",
      "domain": {
        "name": "Physical Domain",
        "community": {
          "name": "DBs Community"
        }
      }
    },
    "type": {
      "name": "Column"
    },
    "relations": {
      "ColumnIsPartOfTable:TARGET": [
        {
          "name": "DB_TABLE",
          "domain": {
            "name": "Physical Domain",
            "community": {
              "name": "DBs Community"
            }
          }
        }
      ]
    }
  }
]
```

## Import tags

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a community: `DBs Community`.
* Adds a domain inside the created community: `Physical Domain`.
* Adds the asset `DB_SCHEMA` without tags.
* Adds the asset `DB_TABLE` with the tags:
  * `TAG_1`.
  * `TAG_2`.

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_SCHEMA",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Schema"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_TABLE",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Table"
  },
  "tags": ["TAG_1", "TAG_2"]
}]
```

## Import complex relations

For this example to work, you must have the following resources:

* A community named `DBs Community`.
* A **Physical Data Dictionary** domain inside the community named `Physical Domain`.
* A **Mapping** domain inside the community named `My Mapping Domain`.
* The following **Column** assets in **Physical Domain**: `DB_COL_SOURCE_1`, `DB_COL_SOURCE_2`, `DB_COL_TARGET_1`, `DB_COL_TARGET_2`.
* A **Mapping Specification** asset named `MapSpec` in **My Mapping Domain**.

<details>

<summary>Get the JSON to create them</summary>

### Input

```json
[{
  "resourceType": "Community",
  "identifier": {
    "name": "DBs Community"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "Physical Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Physical Data Dictionary"
  }
},
{
  "resourceType": "Domain",
  "identifier": {
    "name": "My Mapping Domain",
    "community": {
      "name": "DBs Community"
    }
  },
  "type": {
    "name": "Mapping Domain"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_COL_SOURCE_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_COL_SOURCE_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_COL_TARGET_1",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "DB_COL_TARGET_2",
    "domain": {
      "name": "Physical Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Column"
  }
},
{
  "resourceType": "Asset",
  "identifier": {
    "name": "MapSpec",
    "domain": {
      "name": "My Mapping Domain",
      "community": {
        "name": "DBs Community"
      }
    }
  },
  "type": {
    "name": "Mapping Specification"
  }
  }]
```

</details>

The JSON in this section performs the following operations in an environment where these resources do not exist yet:

* Adds a field mapping complex relation between the assets and a description attribute.
* Creates a mapping based on the external system and entity for the imported complex relation for further reference.

### Input

```json
[{
  "resourceType": "Complex Relation",
  "identifier": {
    "externalSystemId": "DB-Metadata-System",
    "externalEntityId": "FieldMapping12345678"
  },
  "complexRelationType": {
    "name": "Field Mapping"
  },
  "relations": {
    "00000000-0000-0000-0000-000000007088": [
      {
        "name": "DB_COL_SOURCE_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      },
      {
        "name": "DB_COL_SOURCE_2",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ],
    "00000000-0000-0000-0000-000000007089": [
      {
        "name": "DB_COL_TARGET_1",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      },
      {
        "name": "DB_COL_TARGET_2",
        "domain": {
          "name": "Physical Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ],
    "00000000-0000-0000-0000-000000007090": [
      {
        "name": "MapSpec",
        "domain": {
          "name": "My Mapping Domain",
          "community": {
            "name": "DBs Community"
          }
        }
      }
    ]
  },
  "attributes": {
    "Description": [
      {
        "value": "XXX_COLUMN_1"
      }
    ]
  }
  }]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.collibra.com/api/guides/working-with-the-import-api-v2/sample-use-cases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
