Identifiers
Node UUIDs, Vids, Oids, Qids, Mids and IFC GUIDs, what each identifies, why the Qid has a dash in it, and why it survives reindexing and editing.
BIM.works has five identifiers a developer meets, and the old SDK documentation defined two of them loosely enough to cause confusion. This page says exactly what each one names, where it comes from and how long it stays valid. It assumes you have read Nodes, versions and the tree.
UUIDs: nodes and versions#
Nodes, versions, accounts, organisations, tokens and actions are all identified by a UUID, a 36-character hexadecimal string. Two of them matter constantly.
The node UUID identifies an entry in the tree. You use it to list children, create a folder, upload into a folder, bind an API token to a subtree, or issue a nodes token. Nothing about a model's content is addressed by it.
The Vid, version identifier, is the UUID of one Version of a model node. It is the argument of almost everything else: queries, geometry, checks, exports, geo-referencing, alignment. The SDKs type it (Vid in JavaScript, UUID in Java) and name it versionUuid; the OpenAPI calls it version_uuid. A Vid is assigned once and never reassigned.
Oid and Qid: objects#
Inside a version, every IFC entity has an Oid, a 32-bit integer. Oids are assigned while the file is parsed, in the order entities appear, so parsing the same bytes twice produces the same Oids. An Oid means nothing on its own: 1316 exists in every version. The API therefore never takes a bare Oid.
The Qid is the Vid and the Oid joined with a dash: 797e993c-a87f-4aa7-9587-c59d30ec5c4e-1316. It identifies one object in one version, and it is what everything object-related uses: query results (GET qid …), selection and colouring in the viewers, check results, BVL and BCL conditions (qid IN $selection), transactions. Because a UUID contains dashes itself, the Oid is whatever follows the last dash; the JavaScript SDK's Qid.ofString does that split for you, and Qid.of accepts the string form, a {vid, oid} object or an existing Qid. On the wire the Java SDK and the task API also accept the object form.
The name is historical: "Qid" once stood for "query id", and the old documentation expanded it as "unique identifier". Read it as "qualified object id" — an Oid qualified by its version.
Mid: the derivatives#
The Mid is the UUID of the indexed model, that is, of the derivative set behind a version: the parsed data, the feature index, the geometry, the floor plans. The old documentation called it "the identifier of one single model"; it is not. A version resolves to its Mid through its unique model (uploads) or its transaction (edited versions), two versions uploaded with identical content share one Mid, and a Reindex replaces a version's Mid with a new one while the version keeps its Vid.
You rarely handle a Mid. It appears in a version's im_metadata, in the names of cached geometry in the viewers, and in a few developer-facing tasks. It never appears in a Qid, and that is the point of the next section.
Why the Qid is stable#
An identifier is only useful if it keeps meaning the same thing. The Qid is designed so that the two things that happen to a model over its life do not change it.
Reindexing. When an instance is updated, derivative sets are regenerated from the stored originals. Re-parsing identical bytes reproduces identical Oids, and the Vid is untouched, so every Qid a client stored, every saved selection and every cached check result still points at the same object. The Mid changes; nothing that contains a Mid is meant to be stored by a client.
Editing. Committing a Transaction creates a new version, so the objects in it have new Qids by construction — the Vid part is different. Within the new version, objects that the transaction did not create keep their Oids, and new objects receive the next free Oid. A selection made on version 3 is therefore not valid on version 4, which is correct: version 4 is a different revision, and an object that was deleted in it must not resolve. When you need to carry a selection across versions, map it: MapQids gives each object's counterpart in the other version from a compare of the two (by Oid within a chain of edits, by GlobalId across uploads) and lists the objects that have none (BCOL). Carrying the IFC GlobalIds and re-resolving them with a query works too, for objects whose GlobalId stayed. Data attached to objects as linked data is carried across for you: each link follows its object to the later versions, by Oid and by GlobalId (Linked data).
GUIDs: what IFC brings along#
Every IFC root entity has a GlobalId, a 22-character string encoding a 128-bit value — the GUID. It is the identifier of the authoring world: a door keeps its GlobalId from one export of the design model to the next, which is exactly what makes it useful for tracking objects across revisions and across tools.
BIM.works keeps it as an ordinary attribute and does not build on it. GlobalIds are unique only by convention (files with duplicates are common), the same GlobalId appears in every revision of a model (so it cannot distinguish versions), and two unrelated files may collide. GET attribute.GlobalId WHERE … returns it, WHERE attribute.GlobalId = "…" or attribute.GlobalId IN $guids finds objects by it, and BCOL uses it as the default identification when comparing two versions. It is a different thing from a UUID: different encoding, different length, and never a parameter of a BIM.works URL or API call.
Qid, QidSet, QidMap#
Models have millions of objects, and a viewer holds several sets of them at once (visible, selected, coloured). The JavaScript packages therefore provide QidSet and QidMap in @bimworks/viewercommon: collections keyed by Qid that store the Vid once and the Oids in typed arrays, iterate as Qid objects and interoperate with plain arrays and strings. The ObjectStateManager's getters return them, and its setters accept any iterable of Qids — or a BQL query, which the manager resolves on the server into a QidSet. Select and colour objects shows the pattern.