> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IWorkspaceLogicalModelService

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/ldm/model.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Service for querying and changing the logical data model of a workspace.

**Signature:**

```typescript
export interface IWorkspaceLogicalModelService 
```

## Methods

| Method | Description |
| --- | --- |
| [getDatasets(includeParents)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacelogicalmodelservice/index.md#iworkspacelogicalmodelservicegetdatasets) | **_(ALPHA)_** Returns information about date datasets in the workspace. |
| [getDeclarativeModel(options)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacelogicalmodelservice/index.md#iworkspacelogicalmodelservicegetdeclarativemodel) | **_(ALPHA)_** Returns the logical data model of the workspace in the declarative form. |
| [setDeclarativeLayout(layout)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacelogicalmodelservice/index.md#iworkspacelogicalmodelservicesetdeclarativelayout) | **_(ALPHA)_** Replaces the logical data model and the analytical objects of the workspace in one request. |
| [setDeclarativeModel(model)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iworkspacelogicalmodelservice/index.md#iworkspacelogicalmodelservicesetdeclarativemodel) | **_(ALPHA)_** Replaces the logical data model of the workspace. |

## Method details

### IWorkspaceLogicalModelService.getDatasets()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Returns information about date datasets in the workspace.

**Signature:**

```typescript
getDatasets(includeParents: boolean): Promise<IDateDataset[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| includeParents | boolean | true if parents should be included/ |

**Returns:**

Promise&lt;[IDateDataset](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.idatedataset/index.md)[]&gt;

### IWorkspaceLogicalModelService.getDeclarativeModel()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Returns the logical data model of the workspace in the declarative form.

**Signature:**

```typescript
getDeclarativeModel(options?: IDeclarativeLogicalModelOptions): Promise<IDeclarativeLogicalModel>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| options | [IDeclarativeLogicalModelOptions](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ideclarativelogicalmodeloptions/index.md) | _(Optional)_ options of the read |

**Returns:**

Promise&lt;[IDeclarativeLogicalModel](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ideclarativelogicalmodel/index.md)&gt;

### IWorkspaceLogicalModelService.setDeclarativeLayout()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Replaces the logical data model and the analytical objects of the workspace in one request.

**Signature:**

```typescript
setDeclarativeLayout(layout: IDeclarativeWorkspaceLayout): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| layout | [IDeclarativeWorkspaceLayout](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ideclarativeworkspacelayout/index.md) | the logical data model and the analytical objects |

**Returns:**

Promise&lt;void&gt;

#### Remarks

Use this to provision a workspace from a layout that the backend exported, for example demo content.

### IWorkspaceLogicalModelService.setDeclarativeModel()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Replaces the logical data model of the workspace.

**Signature:**

```typescript
setDeclarativeModel(model: IDeclarativeLogicalModel): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| model | [IDeclarativeLogicalModel](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ideclarativelogicalmodel/index.md) | the new logical data model |

**Returns:**

Promise&lt;void&gt;
