> 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/introduction/the-output-module-query-language/clarify-the-relationship-between-two-entities.md).

# Clarify the relationship between two entities

When two entities are related in more than one way, nesting the entities inside each other is not enough to determine which path to follow. For example, an asset can be either the `source` or `target` of a relation or a user can be the `creator` or the `lastModifier` of a resource. Depending on the entity, there are two possibilities:

* The name of the child entity is changed. For example,`SourceAsset` or `TargetAsset` should be used under `Relation` instead of `Asset`. In this case, they act and behave just like normal assets and exist for the sole purpose of clarifying the relationship followed.
* A special parameter called the `Parent Relationship Selector` is added to the child entity. For example, `Relation` has a `Type` parameter with possible values of `SOURCE` or `TARGET`. This parameter determines the relationship between the `Relation` and the parent`Asset`.

The following example shows the query going two levels deep.

{% tabs %}
{% tab title="JSON" %}

```json
{
  "ViewConfig": {
    "Resources": {
      "Asset": {
        "Id": { "name": "id" },
        "Signifier": { "name": "name" },
        "Relation": {
          "type": "SOURCE",
          "TargetAsset": {
            "Id": { "name": "relatedAssetLevelOneId" },
            "Signifier": { "name": "relatedAssetLevelOne" },
            "Relation": {
              "type": "TARGET",
              "SourceAsset": {
                "Id": { "name": "relatedAssetLevelTwoId" },
                "Signifier": { "name": "relatedAssetLevelTwo" }
              }
            }
          }
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
---
ViewConfig:
  Resources:
    Asset:
      Id:
        name: "id"
      Signifier:
        name: "name"
      Relation:
        type: "SOURCE"
        TargetAsset:
          Id:
            name: "relatedAssetLevelOneId"
          Signifier:
            name: "relatedAssetLevelOne"
          Relation:
            type: "TARGET"
            SourceAsset:
              Id:
                name: "relatedAssetLevelTwoId"
              Signifier:
                name: "relatedAssetLevelTwo"
```

{% endtab %}
{% endtabs %}

These special parameters and custom entity names only exist for a fraction of the available entities. For a complete list, see [Entities, properties and relations](/api/guides/introduction/entities-properties-and-relations.md).

{% hint style="info" %}
To reduce the number of assets returned, the query example above is not filtered. Filtering would return a large amount of data and impact performance.
{% endhint %}


---

# 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/introduction/the-output-module-query-language/clarify-the-relationship-between-two-entities.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.
