# Relations

The `relations` object is part of the [`task`](/data/importing-and-exporting-annotations/exporting-annotations/ango-export-format/asset/task.md) object in the Ango Annotation Format. It contains all data pertaining to labels created with *relations*, e.g. not tools, classifications, or brushes.

## General Structure

{% code fullWidth="true" %}

```json
"relations" : [
    {
        from // string, only in single relations, objectID of the object from where the relation starts
        to // string, only in single relations, objectID of the object where the relation stops
        objectId // string, ID of the relation
        schemaId, // string, ID of the relation class in the project
        group // list, only in group relation, the objectIDs of the objects present in the relation
        direction, // string, only in single relations, one of straight, reverse, bidirectional.
        title // string, title of the relation class
        page // int, optional, if asset is multi-frame (video, TIFF, DICOM) frame where the relation takes place
    },
    { ... }
]
```

{% endcode %}

## Single Relation

```json
{
    "from": "3d52bc1cd570e28fa9da319",
    "to": "4e8dbe33e3223d9da92e638",
    "objectId": "572c2545502ba09bd661714",
    "schemaId": "8f8e617174718e80bbea268",
    "direction": "straight",
    "page": 0,
    "title": "Single Relation"
}
```

<table data-full-width="true"><thead><tr><th width="201">Property</th><th width="90.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>from</code></td><td>String</td><td>In single relations only, object ID of the object which was clicked first when setting up the relation.</td></tr><tr><td><code>to</code></td><td>String</td><td>In single relations only, object ID of the object which was clicked second when setting up the relation.</td></tr><tr><td><code>objectId</code></td><td>String</td><td><p>Object ID of the relation. Unique in the asset.</p><pre class="language-json"><code class="lang-json">"objectId": "6b8a4338d299c63b5ee7825"
</code></pre></td></tr><tr><td><code>schemaId</code></td><td>String</td><td><p>ID of the class to which the relation belongs.</p><pre class="language-json"><code class="lang-json">"schemaId": "4460fa700ef030c4e575604"
</code></pre></td></tr><tr><td><code>title</code></td><td>String</td><td><p>Name of the class.</p><pre class="language-json"><code class="lang-json">"title": "Image Projection Type"
</code></pre></td></tr><tr><td><code>direction</code></td><td>String</td><td>In single relations only, direction of the relation. One of:<br><code>straight</code>: The relation has an arrow starting from the object indicated by <code>from</code> and pointing towards the object with the objectID indicated by <code>to</code>.<br><code>reverse</code>: The relation has an arrow starting from the object indicated by <code>to</code> and pointing towards the object with the objectID indicated by <code>from</code>.<br><code>bidirectional</code>: The relation has two arrows, each starting from one of the two objects and pointing towards the other.</td></tr></tbody></table>

{% hint style="info" %}
**See also**

[Single Relation](/labeling/labeling-tools/relation/single-relation.md)
{% endhint %}

## Group Relation

```json
{
    "objectId": "15ff30bd776c19fee934398",
    "schemaId": "37ccadce8a7505b93659450",
    "group": [
        "3d52bc1cd570e28fa9da319",
        "4e8dbe33e3223d9da92e638",
        "4342e79c0c77a8252a7b188"
    ],
    "page": 0,
    "title": "Group Relation"
}
```

<table data-full-width="true"><thead><tr><th width="201">Property</th><th width="90.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>objectId</code></td><td>String</td><td><p>Object ID of the relation. Unique in the asset.</p><pre class="language-json"><code class="lang-json">"objectId": "6b8a4338d299c63b5ee7825"
</code></pre></td></tr><tr><td><code>schemaId</code></td><td>String</td><td><p>ID of the class to which the relation belongs.</p><pre class="language-json"><code class="lang-json">"schemaId": "4460fa700ef030c4e575604"
</code></pre></td></tr><tr><td><code>group</code></td><td>List</td><td>In group relations only, the objectIDs of the objects in the relation.</td></tr><tr><td><code>title</code></td><td>String</td><td><p>Name of the class.</p><pre class="language-json"><code class="lang-json">"title": "Image Projection Type"
</code></pre></td></tr></tbody></table>

{% hint style="info" %}
**See also**

[Group Relation](/labeling/labeling-tools/relation/group-relation.md)
{% endhint %}


---

# Agent Instructions: 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://docs.imerit.net/data/importing-and-exporting-annotations/exporting-annotations/ango-export-format/asset/task/relations.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.
