---
title: The query languages
summary: Why BIM.works has a family of eight small languages built on BQL, what each is for, why BQL has no FROM and no joins, and how the family relates to SQL and IDS.
order: 60
featured: true
see-also: [reference/bql, tutorials/bql, how-to/query/validate-a-query, explanation/comparing-versions, reference/bvl, reference/bcl, reference/bul, reference/brl, reference/bsl, reference/bcol, reference/bfl, explanation/checking-and-ids, changelog/v3-0/from-2-to-3]
terms: [bql, bvl, bcl, brl, bul, bsl, bcol, feature, occurrence, type-object, sub-feature, action, ids, transaction]
---

# The query languages

BIM.works does not have one language; it has eight, and they are deliberately small. This page explains the family, the design decisions behind [[term:bql|BQL]] that the others inherit, and where each language begins and ends. The clause-by-clause reference is [[page:reference/bql]], the course is [[page:tutorials/bql]].

## One family

The eight grammars form an inheritance chain. BQL is the base: expressions over the [[term:feature|features]] of objects, a `GET` clause, aggregation and ordering. BVL adds visualisation actions to BQL conditions; BCL adds check blocks to BVL; BRL adds report layout to BCL. BUL adds update statements to BQL, BFL adds feature definitions to BQL, BCOL adds a comparison specification, and BSL sequences BVL frames. Whatever you learn about a `WHERE` condition in BQL — comparators, wildcards, `typeObject.` and `buildingStorey.` paths, units, parameters — is true in every other language, because it is literally the same grammar rule.

| Language | Adds | Runs as |
|---|---|---|
| [[term:bql|BQL]] | selecting objects and features | a query, returning a table |
| [[term:bvl|BVL]] | show, hide, colour, select, label, annotate | a restyling of the viewers |
| [[term:bcl|BCL]] | checks with a result per object | a check run, storing results |
| [[term:brl|BRL]] | pages, tables, charts, viewports | a report, rendered to HTML or PDF |
| [[term:bul|BUL]] | SET, DEL, DELETE OBJECT, TRANSFORM | a transaction, creating a version |
| [[term:bsl|BSL]] | labelled frames of BVL | a sequence played in the viewer |
| [[term:bcol|BCOL]] | matching keys, rules, watch lists, outcome styles | a comparison of two versions |
| [[page:reference/bfl|BFL]] | `DEFINE`: a virtual feature computed by a BQL expression | a feature every query reads like a stored one |

Small languages are easier to write correctly, easier to validate with useful errors, and easier to store: every script is an [[term:action]] in the actions tree, versioned, shareable and runnable against whatever models are loaded. They are also easier for a language model to produce — the BIM.works chat proposes BQL, BVL, BCL and BRL and lets you confirm before anything runs — which is one reason the grammars are kept declarative and free of escape hatches. Where rules are not enough, checks and exports can be written in Java and run in a sandbox behind [[feature:JAVA_ACTIONS]].

## BQL, briefly

A statement is `GET <features> [WHERE <condition>] [GROUP BY …] [ORDER BY …] [LIMIT n] [OFFSET n] [USING <units>]`. Features are dotted paths: `type`, `qid`, `attribute.Name`, `property.Pset_WallCommon.FireRating`, `property.*.FireRating` (any property set), `quantity.*.NetVolume`, `classification."NL-SfB"`, `material.name`, `layer.name`, `calculated.quantity.floorArea`, `buildingStorey.attribute.Name`, `typeObject.attribute.Name`, `model.ifcVersion`. `UNIT m3` after a feature converts it; `USING LENGTH_UNIT = mm` sets units for the whole statement. Aggregates (`COUNT`, `SUM`, `MIN`, `MAX`, `AVG`, `MEDIAN`, `STDDEV`, `COLLECT`, `FIRST`) go with `GROUP BY`. Parameters (`$minVolume`, `qid IN $selection`) are bound by the caller, which is how a stored action asks its user for input. Comparators cover strings (`=`, `CONTAINS`, `STARTS_WITH`, `IN`, regular expressions), numbers with arithmetic and tolerances (`!= … WITHIN 2 %`), and spatial relations (`WITHIN`, `CLASHES_WITH`, clearance, routes).

## No FROM, no joins

BQL has no `FROM` clause. The versions to query are a parameter of the API call, and one statement runs across all of them and returns one table with a `qid` column that says which version each row came from. This is the first decision that separates BQL from SQL, and it follows from what a building model is: the interesting question is almost never "which table", it is "which objects, in these models". Federating over models is the normal case — the architect's, the structural and the services model of one building — not a special one.

There are no joins either. What SQL would join, IFC expresses as relations, and BQL exposes relations as paths: `buildingStorey.attribute.Name` is the name of the storey the object is contained in, `typeObject.property.*.FireRating` a property of its type, `spaceBoundary(SUM(quantity.*.Area) WHERE type = IFCWINDOW)` the window area bounding a space. These [[term:sub-feature|sub-features]] follow the relations the model already has — containment, decomposition, fillings and openings, systems, zones, ports, space boundaries — so a query reads like the model is structured instead of reconstructing the structure from keys. It also means the engine can index those paths once at upload and answer most queries from an index, which is what makes a query over a hundred models return in a fraction of a second.

## Occurrences and types

IFC keeps *occurrences* (the wall in the building) apart from *types* (`IfcWallType`, the definition many walls share), and properties are often attached to the type. BQL merges the two when you read a property on an occurrence, the occurrence's own value winning, and offers `typeObject.` when you want the type explicitly. The trap this avoids is querying `type = IFCWALLTYPE` hoping for walls: the query is valid and selects the type definitions, which have no geometry to show and are not what a schedule counts. Match the [[term:occurrence]] and filter through `typeObject.…`; see [[page:reference/bql/type-objects]] for the merging rules.

## Visualise, check, report

[[term:bvl|BVL]] answers "make me see it": `if (type = IFCWALL AND property.*.IsExternal = true) { COLOR "#800080"; } else { HIDE; }`. It changes only what the viewers show, never the model, so it can be run freely; `group(<feature>) { COLOR auto; }` colours by distinct value, labels and annotations pin text to objects, and the same conditions drive selection, pickability and section-plane behaviour.

[[term:bcl|BCL]] answers "does it comply": `select (<condition>) { name "…" check (<condition>) { success; } else { error("…"); } }`, or `require <condition>;` for the common case. Every object in the selection gets exactly one result, results are stored and reviewable, and BVL actions inside a block colour the scope or the failures. It is the in-house counterpart of buildingSMART's [[term:ids|IDS]], which BIM.works also runs; [[page:explanation/checking-and-ids]] compares them.

[[term:brl|BRL]] answers "put it on paper": pages of tables, charts, KPIs and rendered viewports, fed by embedded `bql GET …` queries and `bcl select …` checks, expanded per storey or per type with `foreach`. A report definition contains no model-specific values, so one report runs on every project.

## Update

[[term:bul|BUL]] is the one language that changes a model: `SET property."Pset_WallCommon"."FireRating" = "REI 60" WHERE …`, `DEL …`, `DELETE OBJECT WHERE …`, `TRANSFORM MOVE(0, 2 m, 0) WHERE …`. Its statements are collected into a [[term:transaction]] and committed as a new version, with the `WHERE` resolved once at commit time and a dry run available. Two differences from BQL are deliberate: the left-hand side names a concrete property set (no `property.*` wildcard when writing), and there is no way to create geometry from text — drawn objects are committed alongside, from the UI's authoring tools. Editing is a feature ([[feature:BUL]]) and a scope (`model:write`).

## Sequence and compare

[[term:bsl|BSL]] is a list of `{ label "…" <BVL> }` frames the viewer plays in order: construction phases, a guided tour, a before-and-after. [[term:bcol|BCOL]] tells the compare engine how to match objects between two versions (`match attribute.GlobalId;`), which features count as a change and with what tolerance (`compare (attribute.Name, property.*.FireRating, geometry);`), and how the added, removed, changed and unchanged objects are shown — the shown part is BVL, so a comparison colours the viewer the way a visualisation does. [[page:explanation/comparing-versions]] explains what a compare does with the definition.

## Errors that say where {#errors-that-say-where}

Being small is half of what makes a language easy to write; the other half is being told precisely what is wrong. The eight languages share one diagnostic. Every syntax error is reported with its line and column (`line 3:14: mismatched input '…'`), up to three at once, and every parse error is reported rather than producing a broken statement that fails later, somewhere else. Behind the parser, the semantic validation knows the schema and says what was probably meant: *did you mean IFCWALL?* for `IfcWall`, the closest existing name for a misspelt BRL block. Because the diagnostic lives in the grammar shared by the family, the same message reaches the API error, the editor markers in the app, the SDKs and the assistant that repairs actions in the chat; [[page:how-to/query/validate-a-query]] shows how to read it.

## Relation to IDS and to the past

IDS and BCL solve the same problem in different media. IDS is an exchange format: an XML file that a client hands to every contractor and that many tools can evaluate. BCL is a working language: quicker to write, more expressive (any BQL condition, calculated values, spatial relations), and executable against the live model. BIM.works evaluates IDS by translating each facet into BQL, so both produce the same kind of per-object result, and a BCL check can be exported as IDS ([[feature:BCL_TO_IDS]]) when it has to leave the platform.

Before BQL, queries were JSON documents ("BimQuery"), and older SDK examples still build them. That format is deprecated and not documented here; BQL replaced it, and version 3 also renamed the unit keyword from `IN` to `UNIT` so that `IN` could mean membership everywhere. [[page:changelog/v3-0/from-2-to-3]] lists the grammar changes.
