---
title: Type objects
summary: The type definition of an occurrence — typeObject.attribute, typeObject.property, the merging of type and occurrence properties, origin, and the own relation.
order: 190
terms: [type-object]
see-also: [reference/bql/types, reference/bql/properties, reference/bql/sub-features]
---

# Type objects

Most building objects are occurrences of a [[term:type-object|type object]] (`IfcWallType`, `IfcDoorType`, …) that carries shared attributes, properties and materials. `typeObject` reaches it from the occurrence; the properties of the type are also merged into the occurrence's own.

## typeObject.feature {#feature}

```bql {#typeobject-get}
GET qid, attribute.Name, typeObject.qid, typeObject.attribute.Name, typeObject.niceType WHERE type = IFCDOOR
```

```bql {#typeobject-several}
GET qid, typeObject(attribute.Name, attribute.PredefinedType, property.*) WHERE type = IFCWALL
```

## In WHERE {#where}

Selecting occurrences by data of their type is the way to find building objects by type name; querying the `*TYPE` classes directly returns geometry-less definitions ([[bql:types#occurrences]]).

```bql {#typeobject-where}
GET qid, attribute.Name WHERE type = IFCSPACE AND typeObject.attribute.Name CONTAINS "balkon"
```

```bql {#typeobject-group}
GET typeObject.attribute.Name, COUNT(qid) WHERE type = IFCWINDOW GROUP BY typeObject.attribute.Name
```

## Merging rules {#merging}

When a property is read from an occurrence (`property.Pset_WallCommon.FireRating`), BIM.works first takes the type object's properties and then the occurrence's own. A property present on both is returned with the occurrence's value; a property only the type defines is returned with `origin: "type"`. The same holds for attributes read with `attribute.*`. Filtering on `property.*.X` therefore sees type properties too — an occurrence without its own `FireRating` still matches when its type has one.

## own {#own}

`own` restricts a feature to the occurrence's own data, without the merge: `own.property.Pset_WallCommon.FireRating` has no value when only the type defines the rating.

```bql {#own}
GET qid, attribute.Name, own.property.Pset_WallCommon.FireRating, typeObject.property.Pset_WallCommon.FireRating
WHERE type = IFCWALL AND property.Pset_WallCommon.FireRating
```

```bql {#own-where}
GET qid, attribute.Name WHERE type = IFCWALL AND property.Pset_WallCommon.FireRating AND NOT own.property.Pset_WallCommon.FireRating
```

## Used in {#used-in}

- [[page:tutorials/bql/relations]] — type names of doors.
- [[page:tutorials/bql/filtering-with-where]] — the occurrence rule.
