---
title: Classifications
summary: Classification references — identity, identification and itemReference, name and location, the classification system and its fields, wildcards, filtering, and classification.meta.
order: 140
terms: [classification]
see-also: [reference/bql/materials, reference/bql/meta, reference/bql/where]
---

# Classifications

A classification reference links an object to a code in a classification system ([[term:classification]]): NL-SfB, Uniclass, OmniClass, a company table. BQL exposes the reference's fields and the system it belongs to.

## Fields {#fields}

| Path | Value |
|---|---|
| `classification` | The reference's identity: `ItemReference` in IFC2X3 models, `Identification` in IFC4 and later. |
| `classification.identity` | The same, spelled out. |
| `classification.identification`, `classification.itemReference` | The schema-specific field, when you need one of them exactly. |
| `classification.name` | The reference's `Name`. |
| `classification.location` | The reference's `Location` (a URI). |
| `classification.*` | Every field of the reference. |
| `classification.system` | The classification system's name. |
| `classification.system.name`, `.edition`, `.editionDate`, `.source` | Fields of the `IfcClassification` the reference belongs to. |
| `classification.system.*` | Every field of the system. |

```bql {#classification-basic}
GET qid, attribute.Name, classification.identity, classification.name, classification.system.name WHERE type = IFCWALL
```

```bql {#classification-all}
GET qid, classification.* WHERE type = IFCDOOR
```

## In WHERE {#where}

The string comparators apply to every field. Filtering on the system name and the code together pins a reference to one system.

```bql {#classification-where}
GET qid, attribute.Name WHERE type = IFCWALL AND classification.system.name = "NL-SfB" AND classification.identity STARTS_WITH "21"
```

```bql {#classification-missing}
GET type, COUNT(qid) WHERE NOT classification GROUP BY type
```

## One system's entries {#filter}

An object can carry references of several systems, and two conditions on `classification` may each be satisfied by a different reference. A filter in brackets narrows the path to the references that satisfy one comparison — on a field of the reference, or with `system.` on a field of its system (`name`, `edition`, `source`) — so the field read after it comes from those references only.

```bql {#classification-filter}
GET qid, classification[system.name CONTAINS "SfB"].identification WHERE classification[system.name CONTAINS "SfB"].identification STARTS_WITH "21"
```

Any comparator that takes a text applies inside the brackets. In an expression the filtered path is the first matching reference's value, which is what a [[page:reference/bfl|virtual feature]] that maps one system onto another builds on. A condition on a filtered path, and `GROUP BY` on one, is decided once per classification reference of the model: the filter is a property of the reference (or of its system), not of the object. `GET classification[system.name = "NL-SfB"].identification, COUNT(qid) GROUP BY classification[system.name = "NL-SfB"].identification` counts per code of that one system - a Revit export also carries the Uniformat assembly code, which an unfiltered `classification.identification` counts as well.

## Distribution of codes {#group}

```bql {#classification-group}
GET classification.identity, classification.name, COUNT(qid) WHERE type = IFCWALL GROUP BY classification.identity, classification.name
```

## Classifications of materials {#materials}

A material can carry its own classification; read it through `material.classification.<field>` ([[bql:materials#fields]]).

## classification.meta {#meta}

`classification.meta` lists which classification fields and systems an object has, without the values; it is selectable only ([[bql:meta]]).

## Used in {#used-in}

- [[page:tutorials/bql/relations]] — codes per object and per system.
