> 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/output-module/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/output-module/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.collibra.com/api/guides/output-module/the-output-module-query-language/clarify-the-relationship-between-two-entities.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
