---
title: LinkedData
summary: Class in @bimworks/jssdk.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/jssdk
---

# LinkedData

[[page:reference/javascript/api|API catalogue]] · `@bimworks/jssdk` · Class

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
class LinkedData
````

Files, URLs, texts and identifiers linked to objects, which follow their objects to later versions. Available through
[[page:reference/javascript/bimworks-jssdk/bimworksclient-40a172f2#member-linkeddata-6e806d3ef92c|BimWorksClient.linkedData]]. Reading needs the scope `links:read`, changing `links:write`.

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-constructor-72f351bb5daa|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-addtargets-54976c6ba879|addTargets]] | Method | Links an existing item to more objects; a target it is on already is left as it is |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-confirm-8312febedcb7|confirm]] | Method | Confirms that a link marked CHECK on the version is on the right object |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-counts-7366c13e0d82|counts]] | Method | Which objects of a version have linked data: for colouring and markers |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-download-40df8954c44c|download]] | Method | The item's content, as uploaded: a file byte for byte, a URL, identifier or text as text/plain |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-downloadurl-d11b61659dae|downloadUrl]] | Method | A URL of the item's content, valid for a few minutes without a token (treat it like the file itself), that supports Range, for a browser tab, a player or a P… |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-end-2b9f75bca6e2|end]] | Method | Ends a link from the version on; the older versions keep it |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-get-ad11c5f0dba5|get]] | Method | One item, its links with their trail across versions, and its replacements |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-link-a7b77344e7d8|link]] | Method | Links every item to every target; a refused item does not refuse the others |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-list-55b11bd46e7f|list]] | Method | The linked data on a version, followed up to it first |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-policy-f98fb0e9a933|policy]] | Method | What this server accepts: the file families, the deny list, the limits, the categories |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-reattach-99a93e14eb22|reattach]] | Method | Puts a link on another object from the version on |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-remove-cd5a13d5c78a|remove]] | Method | Deletes items from every object and version, restorable for the policy's retention_days |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-replace-e32619a3c03a|replace]] | Method | Replaces an item from a version on; the older versions keep it |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-restore-5e02176b2b30|restore]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-unlink-d5b58a02389e|unlink]] | Method | Takes links off their objects on every version; an item that loses its last link is deleted |
| [[page:reference/javascript/bimworks-jssdk/linkeddata-0882aa3f#member-update-e05096a85e40|update]] | Method | Edits what can be edited; a stale rowVersion rejects with VERSION_CONFLICT |

## `constructor` {#member-constructor-72f351bb5daa}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
constructor()
````



## `addTargets` {#member-addtargets-54976c6ba879}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public addTargets(itemUuid: string, versionUuid: string, targets: (LinkTarget)[]): Promise<{ item: LinkedDataItem; links: (LinkedDataLink)[] }>
````

Links an existing item to more objects; a target it is on already is left as it is

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |
| `versionUuid` | `string` |  |
| `targets` | `(LinkTarget)[]` |  |

## `confirm` {#member-confirm-8312febedcb7}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public confirm(linkUuid: string, versionUuid: string): Promise<{ confirmed_anchor_uuid: string; link: LinkedDataLink }>
````

Confirms that a link marked CHECK on the version is on the right object

### Parameters

| Name | Type | Description |
|---|---|---|
| `linkUuid` | `string` |  |
| `versionUuid` | `string` |  |

## `counts` {#member-counts-7366c13e0d82}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public counts(versionUuid: string, options?: { includeLater?: boolean }): Promise<LinkedDataCounts>
````

Which objects of a version have linked data: for colouring and markers

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `string` |  |
| `options` | `{ includeLater?: boolean }` |  |

## `download` {#member-download-40df8954c44c}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public download(itemUuid: string): Promise<ArrayBuffer>
````

The item's content, as uploaded: a file byte for byte, a URL, identifier or text as text/plain

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |

## `downloadUrl` {#member-downloadurl-d11b61659dae}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public downloadUrl(itemUuid: string, options?: { inline?: boolean }): Promise<{ disposition: "attachment" | "inline"; expires: string; path?: string; url: string }>
````

A URL of the item's content, valid for a few minutes without a token (treat it like the file itself), that
supports Range, for a browser tab, a player or a PDF viewer. With inline: true it shows the content when the
type allows it; disposition says what it will do.

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |
| `options` | `{ inline?: boolean }` |  |

## `end` {#member-end-2b9f75bca6e2}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public end(linkUuid: string, fromVersionUuid: string): Promise<{ link: LinkedDataLink }>
````

Ends a link from the version on; the older versions keep it

### Parameters

| Name | Type | Description |
|---|---|---|
| `linkUuid` | `string` |  |
| `fromVersionUuid` | `string` |  |

## `get` {#member-get-ad11c5f0dba5}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public get(itemUuid: string, versionUuid?: string): Promise<LinkedDataDetails>
````

One item, its links with their trail across versions, and its replacements

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |
| `versionUuid` | `string` |  |

## `link` {#member-link-a7b77344e7d8}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public link(versionUuid: string, targets: (LinkTarget)[], items: (LinkedDataItemInput)[], options?: LinkedDataProgressOptions): Promise<LinkDataResult>
````

Links every item to every target; a refused item does not refuse the others

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `string` |  |
| `targets` | `(LinkTarget)[]` |  |
| `items` | `(LinkedDataItemInput)[]` |  |
| `options` | [[page:reference/javascript/bimworks-jssdk/linkeddataprogressoptions-7df3e352|LinkedDataProgressOptions]] |  |

## `list` {#member-list-55b11bd46e7f}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public list(versionUuid: string, options?: ListLinkedDataOptions): Promise<LinkedDataList>
````

The linked data on a version, followed up to it first

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuid` | `string` |  |
| `options` | [[page:reference/javascript/bimworks-jssdk/listlinkeddataoptions-fcf106a0|ListLinkedDataOptions]] |  |

## `policy` {#member-policy-f98fb0e9a933}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public policy(): Promise<LinkedDataPolicy>
````

What this server accepts: the file families, the deny list, the limits, the categories

## `reattach` {#member-reattach-99a93e14eb22}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public reattach(linkUuid: string, versionUuid: string, target: LinkTarget): Promise<{ link: LinkedDataLink }>
````

Puts a link on another object from the version on

### Parameters

| Name | Type | Description |
|---|---|---|
| `linkUuid` | `string` |  |
| `versionUuid` | `string` |  |
| `target` | [[page:reference/javascript/bimworks-jssdk/linktarget-77314619|LinkTarget]] |  |

## `remove` {#member-remove-cd5a13d5c78a}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public remove(itemUuids: (string)[], reason?: string): Promise<{ deleted: (string)[]; retention_days: number }>
````

Deletes items from every object and version, restorable for the policy's retention_days

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuids` | `(string)[]` |  |
| `reason` | `string` |  |

## `replace` {#member-replace-e32619a3c03a}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public replace(itemUuid: string, fromVersionUuid: string, item: LinkedDataItemInput, options?: LinkedDataProgressOptions): Promise<{ deleted: boolean; ended: (string)[]; item: LinkedDataItem; links: (LinkedDataLink)[]; unlinked: (string)[] }>
````

Replaces an item from a version on; the older versions keep it

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |
| `fromVersionUuid` | `string` |  |
| `item` | [[page:reference/javascript/bimworks-jssdk/linkeddataiteminput-c12b2eaa|LinkedDataItemInput]] |  |
| `options` | [[page:reference/javascript/bimworks-jssdk/linkeddataprogressoptions-7df3e352|LinkedDataProgressOptions]] |  |

## `restore` {#member-restore-5e02176b2b30}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public restore(itemUuids: (string)[]): Promise<{ restored: (string)[] }>
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuids` | `(string)[]` |  |

## `unlink` {#member-unlink-d5b58a02389e}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public unlink(linkUuids: (string)[]): Promise<{ items_deleted: (string)[]; unlinked: (string)[] }>
````

Takes links off their objects on every version; an item that loses its last link is deleted

### Parameters

| Name | Type | Description |
|---|---|---|
| `linkUuids` | `(string)[]` |  |

## `update` {#member-update-e05096a85e40}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public update(itemUuid: string, rowVersion: number, fields: { category?: string; description?: string; identifier_system?: string; title?: string; valid_until?: string }): Promise<LinkedDataItem>
````

Edits what can be edited; a stale rowVersion rejects with VERSION_CONFLICT

### Parameters

| Name | Type | Description |
|---|---|---|
| `itemUuid` | `string` |  |
| `rowVersion` | `number` |  |
| `fields` | `{ category?: string; description?: string; identifier_system?: string; title?: string; valid_until?: string }` |  |
