> For the complete documentation index, see [llms.txt](https://docs.segments.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.segments.ai/how-to-annotate/annotate-object-links.md).

# Annotate object links

With the object linking feature you can annotate *relations* or *links* between objects in the scene. These links can also contain *link attributes*.

The format of the link annotations in the exported label attributes is documented [here](/reference/label-types.md#links).

## Enable the object linking feature

Navigate to the dataset settings and go to the "Labeling" section. At the bottom of the page, check the option "Use object linking". If the option is not present, it means that the dataset is not compatible yet (see limitations above).

#### Enable category restrictions

With the "Enable category restrictions" flag disabled, links can be created between any two objects. With the flag enabled (default), links can only be created between whitelisted categories. These categories need to be configured in the categories editor.

## Configure link attributes and category restrictions

Link attributes and category restrictions can be configured in the category editor.

<figure><img src="https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FzaGsw964S6CzcO2ymVey%2Fimage.png?alt=media&amp;token=0aa4afad-a1f4-4251-a3c0-af678bd26c7d" alt=""><figcaption></figcaption></figure>

#### Category restrictions

Configure which categories can be linked to the current category by adding them in the "Allow linking with these categories" input field. If a category can be linked to itself, it should also be added in the list. Since links have a direction, pay attention to which categories are added to each configuration.

#### Link attributes

Once the feature is activated, it's possible (but not required) to configure link attributes for each category.&#x20;

Note that a link has a direction, *from* one object *to* another one. The attributes that will appear when annotating a link from one object to another one are determined by the *from* category.

Link attributes can also be configured [programmatically](/reference/categories-and-attributes.md#category).

## Link two objects and edit link attributes

The tool bar has a new button to activate the object linking tool.

<figure><img src="https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2F6jgWKGUu0UeQkkPLpXvc%2Flocalhost_8080_admin-david_demo-object-linking-dev_samples_daaa4b5d-0f68-456f-bee6-0b0afd35847e_ground-truth_track%3D1.png?alt=media&amp;token=54b1f914-c1c9-4e11-854d-cff023d9e81e" alt=""><figcaption><p>The toolbar with the object linking tool activated</p></figcaption></figure>

The below video shows how to link two objects, in this case a traffic light and a lane:

1. Select an object
2. Activate the object linking tool
3. Click on the other object you want to link it to
4. The link is now shown in the right sidebar. You can also set the link attributes here.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FWZWdiyFwfwPTFvDewlvU%2Foutput.mp4?alt=media&token=738e3ad5-13d7-4cc7-89de-9dbaf5644308>" %}

## Unlink two objects

The following video shows how to delete a link:

1. Select the object
2. Select the object linking tool
3. Click on the other object to break the link

Alternatively a link can be deleted by clicking the trash bin icon in the sidebar next to the link.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2F54i7hchuiS315FpQGw6W%2Foutput.mp4?alt=media&token=a61385bb-88c9-40e0-a323-0ca584d0f7f2>" %}

<figure><img src="https://1553794111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHczBG7NHgAtEe4ql1rXH%2Fuploads%2FuXMjIe7HxByEvDUEWNUK%2Flocalhost_8080_admin-david_demo-object-linking-dev_settings_labeling%20(1).png?alt=media&amp;token=02e0d947-d787-431f-97e3-2af82389fe0b" alt=""><figcaption></figcaption></figure>


---

# 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://docs.segments.ai/how-to-annotate/annotate-object-links.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.
