---
title: "Schema Mapping"
slug: schema-mapping
date: 2026-10-18T14:19:46+00:00
modified: 2026-10-18T14:19:46+00:00
permalink: https://brightdata.com/glossary/schema-mapping
type: page
---

# Schema Mapping

**TLDR:** Schema mapping defines how fields in a source dataset correspond to fields in a target schema. It is what allows data collected from many different sites to be combined into one consistent structure.

**Schema mapping** is the translation layer between how a source organizes data and how a destination expects it. Scraping five retailers produces five different shapes: one calls the field `product_name`, another `title`, a third nests it under `item.displayName`. Mapping resolves those differences so every record lands in the same columns.

### Mapping Relationships:

1. **One to one**: A source field maps directly to a target field, with at most a rename. The simple and common case.
2. **One to many**: A single source field splits into several targets, such as a full name becoming first and last name.
3. **Many to one**: Several source fields combine, such as street, city, and postcode merging into a single address string.
4. **Derived**: The target value is computed rather than copied, such as a discount percentage calculated from list and sale price.
5. **Constant**: The target is populated with a fixed value, such as a source identifier recording which site a record came from.
6. **Unmapped**: A source field with no target, or a target with no source. Both need an explicit decision rather than silent omission.

### A Concrete Mapping:

Source ASource BTarget fieldTransformationproduct\_nametitlenameTrim whitespaceprice\_centspricepriceDivide A by 100, parse B as decimalcurcurrency\_codecurrencyUppercase, validate against ISO 4217in\_stockavailabilityavailableA is boolean, B maps InStock to trueskuitem\_idsource\_idCast to string(none)brandbrandNull when source is AThe currency row shows why mapping is rarely just renaming. Source A emits a lowercase three letter code, Source B emits a different field name with correct casing, and the target requires a validated ISO value. Three distinct operations hide behind one row.

### Mapping as Configuration:

```
MAPPINGS = {
    "retailer_a": {
        "name":      {"from": "product_name", "fn": str.strip},
        "price":     {"from": "price_cents",  "fn": lambda v: v / 100},
        "currency":  {"from": "cur",          "fn": str.upper},
        "available": {"from": "in_stock",     "fn": bool},
        "brand":     {"const": None}
    },
    "retailer_b": {
        "name":      {"from": "title",          "fn": str.strip},
        "price":     {"from": "price",          "fn": float},
        "currency":  {"from": "currency_code",  "fn": str.upper},
        "available": {"from": "availability",
                      "fn": lambda v: v == "InStock"},
        "brand":     {"from": "brand"}
    }
}

def apply_mapping(record, source):
    out = {}
    for target, rule in MAPPINGS[source].items():
        if "const" in rule:
            out[target] = rule["const"]
            continue
        value = record.get(rule["from"])
        if value is None:
            out[target] = None
            continue
        fn = rule.get("fn")
        out[target] = fn(value) if fn else value
    return out
```

Expressing mappings as data rather than code means adding a source is a configuration change. The alternative, a function per source, works until roughly the fifth source and then becomes unmaintainable.

### Problems Mapping Must Solve:

**Granularity mismatch.** One source reports price per unit, another per case. Without normalization the values are not comparable even though both are called price.

**Vocabulary mismatch.** Availability might be expressed as true, InStock, Y, 1, or Available across five sources, all meaning the same thing.

**Precision loss.** Mapping a timestamp with timezone into a date field discards information permanently, which may or may not be acceptable.

**Structural mismatch.** A source returning multiple nested variants per product does not fit a flat target row without either flattening or exploding into multiple records.

### Mapping and Entity Resolution:

Schema mapping aligns field structure. It does not determine whether two records describe the same real world thing. That is a separate problem, handled by [product matching](/glossary/product-matching) or entity resolution more generally.

The order matters: mapping comes first, because comparing records is only meaningful once they share a structure. Two product records cannot be matched on brand and model until both have been mapped into fields called brand and model.

### Maintaining Mappings:

Mappings decay. Sources add fields, rename them, change types, and alter value vocabularies, usually without notice.

The practical defenses are to validate mapped output against an expected schema rather than assuming it conforms, to log unmapped source fields instead of discarding them silently, and to alert when a field’s null rate or type distribution shifts sharply between runs. An unmapped field appearing in a source is often the first visible sign that the source has changed.

Bright Data’s [Scraper APIs](/products/web-scraper) return records in a documented schema per site, which means mapping work starts from a stable, typed structure rather than from raw page markup.

Start free trial[Start with Google](#)





 ## Trusted by 50,000+ customers worldwide



























































Welcome to the Scraping Cloud

## Maximum Control and Efficiency

 [Proxies

Premium proxy infrastructure. 100% ethically sourced IPs.

- Automated session management
- Target any city in 195 countries
- Unlimited concurrent sessions





 Proxy Services





 ](/proxy-types)

 [Unlocker

Say goodbye to blocks and CAPTCHAs with a single API.



 Unlocker





 ](/products/web-unlocker)

 [Browser

Scale dynamic scraping with built-in unblocking and proxies



 Scraping Browser





 ](/products/scraping-browser)

 [Functions

Run your scrapers as fully-hosted serverless functions.



 Functions





 ](/products/web-scraper/functions)

 [Scrapers

Extract parsed data on-demand with dedicated scraper APIs.



 Scrapers API





 ](/products/web-scraper)

 [Datasets

Get fresh, validated datasets from any public website.



 Datasets





 ](/products/datasets)

 [SERP API

Quick and easy search engine scraping on demand



 SERP API





 ](/products/serp-api)







### Ready to get started?

Start free trial
