Skip to content

Classification taxonomy

The tool uses a project-owned internal classification (MaterialCategory) as its canonical machine-readable classification for all domain logic. External classification codes (Uniclass 2015, IFC entity codes, UN CPC) may be attached to records as user-supplied metadata; they are validated for format only — the tool never checks whether a code exists in any vendored or downloaded table.

Decision #19 (revised Session 3.8): No classification tables are vendored in the repository. See PROJECT.md §Decisions #19 and #22, and THIRD_PARTY.md §5.


Primary (internal) — MaterialCategory

  • Defined in: backend/app/schemas/enums.py (MaterialCategory StrEnum).
  • Values (v1): earth, binder, aggregate, metal, finish, timber, polymer, other.
  • Used by: all domain modules for branching, grouping, proxy-cascade selection, and result aggregation. This is the only classification layer the calculation engine reads.
  • Extended by: Alembic migration + PR review. New values are not added ad-hoc.

External (optional) — Uniclass 2015

  • Owner: Hubexo North UK Ltd (formerly NBS / RIBA Enterprises).
  • Source: https://uniclass.thenbs.com
  • Licence: CC BY-ND 4.0 — redistribution permitted; no derivatives. NBS explicitly requests that users not adapt tables or add codes. Earth-based materials (adobe, CEB, CSEB) require codes that do not yet exist in Uniclass, making vendoring impractical.
  • How stored: the uniclass_code field on Assembly and Material records accepts a Uniclass-format string. Validation is format-only via regex ^[A-Z][a-z]_\d{2}_\d{2}_\d{2}$. No Uniclass table is committed to the repository.
  • Tables removed: the four .xlsx files committed in Session 3.7 (Ss v1.42, Pr v1.42, Ac v1.26, change log) were deleted in Session 3.8 under decision #22 (no-vendored-ND-data policy).

External (optional) — IFC entity codes (ISO 16739-1)

  • Owner: buildingSMART International.
  • Standard: ISO 16739-1:2018.
  • Applied at: Assembly records (for future BIM interoperability).
  • Validation: format-only, regex ^Ifc[A-Z][A-Za-z]+$. No IFC schema file vendored.

External (optional) — UN CPC codes

  • Owner: United Nations Statistics Division.
  • Standard: Central Product Classification v2.1.
  • Applied at: Material records, where global material comparability matters.
  • Validation: format-only, regex ^\d{5}$. No CPC table vendored.

Display labels — French Devis Descriptif

The team's French Devis Descriptif codes (A.III.1, A.V.1, ...) are stored as code_display (max 50 characters) on Assembly records. They are human-readable labels only and carry no semantic weight in any calculation.

Classification at BoQ import time

At BoQ import (Phase 1 quantities module), each line item is assigned:

  1. A MaterialCategory value — mandatory, drives all calculation branching.
  2. Optionally, Uniclass / IFC / UN CPC codes — attached as external metadata hints.

The Phase 1 Step 1 sub-chat will produce a mapping table that aligns the 76 Devis Descriptif items in reference/excel/1a_boq_input_lca.xlsx to their MaterialCategory values and optional external codes. This mapping is stored in the database as versioned project data.

Enforcement

  • MaterialCategory is enforced at the Pydantic schema layer: Material.category accepts only valid enum values; the corresponding DB column carries a CHECK constraint (migration a07c3619bd9e).
  • External code fields are format-validated at schema instantiation time.
  • No CI check verifies membership in any external classification table — by design.