In IFC, Type Objects can be used for attributes, properties, classifications and materials.
Default
To simplify using BQL, and to not require the user to think about Type Objects that could potentially be linked to objects, by default, when querying for attributes, properties, classifications and materials, the information from any potentially linked Type Objects is merged and represented in the same location as the regular features.
Whenever a feature is defined in both the object itself and in a linked Type Object, the feature defined on the object has precedence.
For example the following query, it will return the Name attribute value of each object. For any object that does not have a Name attribute, but the linked Type Object does, it will return the Name of the TypeObject.
GET attribute.NameIdentifying type information
The query results allow you to distinguish whether information is coming from the object, or from the linked Type Object. Note the origin field
{ "attribute": { "PredefinedType": { "name": "PredefinedType", "type": "ENUM", "value": "STANDARD", "classType": "IFCWALLTYPEENUM", "unit": "UNITLESS", "origin": "type" } }Querying only type object features
You can also query only the linked Type Object’s features. Results of these queries are put in a separate typeObject json object.
GET typeObject.attribute.NameQuerying only object features
If you want to query only for features defined on objects themselves, and ignore any Type information, you can do that using the own keyword. Keep in mind that the regular location is used for the returned data.
GET own.attribute.NameBoolean expressions
The same logic as applied in the WHERE part of queries. So when you query for an attribute, properties, classification or materials, also the linked Type information is used, with the same preference rules. So the below expression will return true when:
An object is found with the IsExternal property (on any property set) and the value = true OR
An object is found with the IsExternal property (on any property set) on a linked Type Object with the value = true AND it was not found on the object itself
property.*.IsExternal = true