# Hex Semantic Project Discovered Resources

## Overview

The Hex Semantic Project integration discovers the following resources:

* Hex Workspace
* Hex Semantic Project
* Hex Semantic Model
* Hex Dimension
* Hex Measure
* dbt Semantic Model
* dbt Dimension
* dbt Metric

## Hex Workspace

A single resource of type "hex\_workspace" is observed for each configured workspace in the integration settings.

### Properties

| Property | Value                                       |
| -------- | ------------------------------------------- |
| name     | The workspace identifier from configuration |
| type     | always `hex_workspace`                      |
| subtype  | always `hex_workspace`                      |

## Hex Semantic Project

A single resource of type "hex\_semantic\_project" is observed for each configured semantic project.

### Properties

| Property                | Value                                              |
| ----------------------- | -------------------------------------------------- |
| name                    | The semantic project name from configuration       |
| type                    | always `hex_semantic_project`                      |
| subtype                 | always `hex_semantic_project`                      |
| semantic\_project\_type | Type of semantic project (e.g., "dbt\_metricflow") |
| workspace\_id           | The parent workspace ID                            |

## Hex Semantic Model

Semantic models are discovered from dbt MetricFlow YAML files. Only semantic models with `config.meta.hex` configuration are processed.

### Properties

| Property    | Value                       |
| ----------- | --------------------------- |
| name        | The semantic model name     |
| type        | always `hex_semantic_model` |
| subtype     | always `hex_semantic_model` |
| description | Model description from YAML |

### Relationships

* **Parent**: Hex Semantic Project
* **Dependencies**: References corresponding dbt semantic model as `upstream`

## Hex Dimension

Dimensions are discovered from both semantic model dimensions and entities. There are two types:

### Regular Dimensions

Discovered from the `dimensions` section of semantic models. These have corresponding dbt dimensions and field-level lineage.

### Entity-based Dimensions

Discovered from the `entities` section of semantic models. Only entities with types `primary`, `unique`, `natural`, or `foreign` are processed. These do NOT have corresponding dbt dimensions or field-level lineage.

### Properties

| Property    | Value                  |
| ----------- | ---------------------- |
| name        | The dimension name     |
| type        | always `hex_dimension` |
| subtype     | always `hex_dimension` |
| description | Dimension description  |

### Relationships

* **Parent**: Hex Semantic Model
* **upstream\_fields**: References corresponding dbt dimension (only for regular dimensions, not entity-based dimensions)

## Hex Measure

Measures are discovered from semantic models (when `create_metric: true`) and standalone simple metrics that reference existing measures. We currently do not observe non-simple dbt metrics.

### Properties

| Property    | Value                |
| ----------- | -------------------- |
| name        | The measure name     |
| type        | always `hex_measure` |
| subtype     | always `hex_measure` |
| description | Measure description  |

### Relationships

* **Parent**: Hex Semantic Model
* **Field-level Lineage**: References corresponding dbt metric via `upstream_fields`

## dbt Semantic Model

dbt semantic models correspond to each valid Hex semantic model and are created to maintain lineage.

### Properties

| Property    | Value                       |
| ----------- | --------------------------- |
| name        | The semantic model name     |
| type        | always `dbt_semantic_model` |
| subtype     | always `dbt_semantic_model` |
| description | Model description           |

## dbt Dimension

dbt dimensions correspond to each regular dimension (from the `dimensions` section) in valid semantic models. Note that entity-based dimensions do NOT have corresponding dbt dimension resources.

### Properties

| Property | Value                  |
| -------- | ---------------------- |
| name     | The dimension name     |
| type     | always `dbt_dimension` |
| subtype  | always `dbt_dimension` |

### Relationships

* **Parent**: dbt Semantic Model

## dbt Metric

dbt metrics are created for measures with `create_metric: true` and standalone simple metrics.

### Properties

| Property | Value               |
| -------- | ------------------- |
| name     | The metric name     |
| type     | always `dbt_metric` |
| subtype  | always `dbt_metric` |

## Relationships

### Parent/Child

* **Hex Workspace** → **Hex Semantic Project**: Semantic projects are children of workspaces
* **Hex Semantic Project** → **Hex Semantic Model**: Semantic models are children of semantic projects
* **Hex Semantic Model** → **Hex Dimensions** and **Hex Measures**: Dimensions and measures are children of semantic models
* **dbt Semantic Model** → **dbt Dimensions**: dbt dimensions are children of dbt semantic models

### Cross-Platform Lineage

* **Table-level**: Hex Semantic Model → dbt Semantic Model (via `table_dependencies`)
* **Field-level**: Hex Dimension → dbt Dimension (via `upstream_fields`, only for regular dimensions)
* **Field-level**: Hex Measure → dbt Metric (via `upstream_fields`)

**Note**: Entity-based dimensions (from semantic model entities) do not have cross-platform lineage as they don't have corresponding dbt dimension resources.
