> ## Documentation Index
> Fetch the complete documentation index at: https://docs.variable.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Data model

### Products, Elements & Datasets

**Datasets** are the original source of impact data (emission factors). They can come from databases like ecoinvent, be shared by other companies, or be created by the user.

A **Product** (also called an LCA) is a modeled footprint - it has a bill of materials (a `Model` with many `Input`s) and calculates its impacts from them.

An **Element** is a named, reusable source that an `Input` points to. **Materials**, **Energy**, **Transport**, and **Process** are all kinds of Element - they live in your Inventory and can be referenced by Inputs across many Products.

A **Material** is one kind of Element. It gets its impacts by referencing a **Dataset** directly rather than modeling a bill of materials. You add metadata like supplier, SKU, and location to it.

This modeled-vs-referenced distinction applies to every kind of Element - Materials, Processes, Energy, and Transport can each either be modeled (with their own BOM) or reference a Dataset.

| API endpoint | What it returns | Description                                                           |
| :----------- | :-------------- | :-------------------------------------------------------------------- |
| `/product`   | Products        | Modeled footprints with a bill of materials                           |
| `/material`  | Materials       | Sourced items that reference a Dataset for their impacts              |
| `/dataset`   | Datasets        | User-created, supplier-shared, or database-added emission factor data |
| `/database`  | Datasets        | Search the full Variable emission factor database                     |

### Models & Inputs

An `Input` is a line item in a Product's bill of materials. It carries a quantity and unit, and points to an Element - a `Material`, `Process`, `Energy`, or `Transport` - or, in some cases, to another `Product` directly. The Input's calculated CO<sub>2</sub>e is its quantity multiplied by the emission factor from the source's Dataset.

### Where an element is used

`Input`s point *down* from a Product to the Elements it consumes. Reading that relationship in reverse — every Product and assembly that depends on a given Element — is the **"Where it's used"** view. In the app it walks the bill of materials upward to every top-level product, grouped by company, annotated with the element's contributed amount at each level.

### Activity

An `Activity` represents the actual flow of materials through the system. Activities are a quantity of `Product`, `Material`, or `Transportation` with a resulting CO<sub>2</sub>e value.

### Diagram

```mermaid theme={"system"}
erDiagram
    Product ||--o{ Model : "has"
    Model ||--o{ Input : "has"
    Input ||--o| Processing : "processed by"
    Input ||--o| Transportation : "distributed by"
    Input ||--o| "Use Stage" : "has"
    Input ||--o| Material : "using source"
    Material ||--o| Transportation : "transported via"
    Material ||--o| Supplier : "product of"
    Product ||--|| Taxonomy : "categorized in"
    Material ||--|| Taxonomy : "categorized in"
    Transportation ||--o| Supplier : "product of"

    Product ||--o{ Activity : "distribution"
    Activity }o--o| Material : "part of"
    Activity }o--o| Transportation : "part of"
    Activity ||--o| Taxonomy : "categorized in"
    Activity ||--|| Org : "in"
    Activity ||--|| Scope : "in"
```
