> For the complete documentation index, see [llms.txt](https://docs.infotopics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infotopics.com/trulyp/data/semantic-modeling.md).

# Semantic modeling

The Semantic Model page lets you define a semantic model. Semantic models can be used by Trulyp for Analytics or act as a datasource for SuperTables.

***

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FMvsS8wl644CeUKm8onVt%2FData_Semantic_Models_Overview.png?alt=media&amp;token=029aa5ba-fdeb-4c11-88a1-86a397f6810f" alt=""><figcaption></figcaption></figure>

### How it works

1. Under data, go to Semantic models, and click **Create new semantic model.**
2. Fill in the name and description, and then select if you want to make a connection-backed model or import one from a semantic provider.

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FiUxNb4G3CuveCuhu54W8%2Fimage.png?alt=media&amp;token=f7edb3de-637d-4fe4-83a2-54a0cad6a2ec" alt=""><figcaption></figcaption></figure>

> What is the difference between a connection-backed model and an imported semantic provider model?
>
> * A connection-backed model is built from one of your database connections. You choose which tables to include in the semantic model.
> * A semantic provider model is imported directly from a provider, for example Tableau VDS.

{% tabs %}
{% tab title="First Tab" %}

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FrtzZ652ht0lktkVJTEEP%2Fimage.png?alt=media&amp;token=94565dab-ef99-4b01-8d06-d43073df8ed8" alt=""><figcaption></figcaption></figure>

To use a connection-backed model, select your connection on the left. Your available tables will now show up. Filter or scroll to find the table you want to use, and then click on it to add it to the model.

When you have done this, you will see that the "semantic profile" is generated, which allows you to review field meanings.

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FyAaOhR0lPLbuD7kPayUF%2Fimage.png?alt=media&amp;token=2f66a7da-a2f7-454a-80fd-62ab43615080" alt=""><figcaption></figcaption></figure>

If you are happy with the semantic model, click **Save semantic model** in the top right.&#x20;

After saving it, you can preview the data in the semantic model in the **Data preview** section:

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FxM868ANLjJKItCDd39LH%2Fimage.png?alt=media&amp;token=f3af2aff-4a0c-4f1a-9b00-63b90dc273ba" alt=""><figcaption></figcaption></figure>

#### Caching (Only for connection based models)

When using large datasets (e.g. > 10000 rows) Trulyp applies caching to totals and grand totals to avoid querying the database every time. Supertables already has a mechanism built in to update the totals and grand totals whenever it detects that data has changed. In specific use cases it would be beneficial to refresh the data more often. In this case
{% endtab %}

{% tab title="Semantic provider import" %}

### Semantic provider import

Before you set up an imported semantic provider model, add a semantic provider to your Trulyp environment. Follow [Semantic providers](/trulyp/data/semantic-providers.md).

Once that is set up, follow these steps:

1. Choose **Semantic provider import** as the model source.
2. Select the semantic provider you configured.
3. In **Datasource**, select one of the available data sources from that provider.
4. After you select a data source, the model shows its tables and relationships.
5. To change the model, update it at the semantic provider, this is not possible in Trulyp. After making your desired changes, re-import the model into Trulyp.

<figure><img src="https://2312557015-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWbWxEBax8PKTjFYRLWgi%2Fuploads%2FFsow8lBjkL4pJNJ0RtPn%2Fimage.png?alt=media&amp;token=8f8e1ca0-281b-491a-b340-4fe8ca46295b" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infotopics.com/trulyp/data/semantic-modeling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
