---
title: Attributes
summary: Direct IFC attributes — attribute.Name and the other schema attributes, the wildcard, the name/type/value fields, references to other objects, and attribute.meta.
order: 110
see-also: [reference/bql/properties, reference/bql/meta, reference/bql/type-objects]
---

# Attributes

An attribute is a direct field of the IFC entity: `Name`, `Description`, `GlobalId`, `ObjectType`, `Tag`, `PredefinedType`, `LongName` (spaces), `Elevation` (storeys), and so on, exactly as the IFC schema names them.

## attribute.Name {#attribute}

`attribute.<Name>` reads one attribute. Names are case-sensitive and never quoted (they contain no characters that need quoting); an unknown name is a validation warning and fails at run time.

```bql {#attribute-basic}
GET qid, attribute.Name, attribute.GlobalId, attribute.ObjectType WHERE type = IFCWALL
```

```bql {#attribute-where}
GET qid, attribute.Name WHERE type = IFCSPACE AND attribute.LongName STARTS_WITH "Living"
```

In `WHERE`, the string comparators of [[bql:where#strings]] apply to string attributes, the numeric ones to numbers such as `attribute.Elevation`; a bare `attribute.Description` selects objects that have a description.

## Wildcard {#wildcard}

`attribute.*` returns every attribute of the object that has a value.

```bql {#attribute-all}
GET attribute.* WHERE attribute.GlobalId = "25xnmjtXDBEeYnceWKw7hY"
```

## Fields {#fields}

An attribute value in the result is an object with `name`, `type` (the value's basic type), `value` and `classType` (the IFC type of the attribute, such as `IfcLabel`). The fields can be addressed in the query: `attribute.Name.value`, `attribute.Name.type`, `attribute.Name.name`, `attribute.Name.*`; `attribute.*.value` applies a field to every attribute. Grouping and ordering on `attribute.Name.value` is the explicit form of grouping on the value.

```bql {#attribute-value}
GET attribute.ObjectType.value, COUNT(qid) WHERE type = IFCSPACE GROUP BY attribute.ObjectType.value
```

## References {#references}

An attribute that points at another entity (`ObjectPlacement`, `Representation`, `OwnerHistory`) has `type: "REFERENCE"` and the referenced object's qid as its value. Related *objects* are reached through the relations of [[bql:sub-features]], not through these attributes.

## Attributes of related objects {#related}

Prefix the attribute with a relation to read it from a related object: `buildingStorey.attribute.Name`, `typeObject.attribute.Name`, `space.attribute.LongName`, `parent.attribute.Name`.

```bql {#attribute-related}
GET qid, attribute.Name, buildingStorey.attribute.Name, typeObject.attribute.Name WHERE type = IFCDOOR
```

## Origin {#origin}

An attribute the object inherits from its type object carries `origin: "type"` in the result; see [[bql:type-objects#merging]].

## attribute.meta {#meta}

`attribute.meta` lists which attributes exist instead of their values; `GET attribute.meta, COUNT(qid) GROUP BY attribute.meta` surveys the attributes of a selection. It is selectable only ([[bql:meta]]).

## Used in {#used-in}

- [[page:tutorials/bql/your-first-query]] — reading names.
- [[page:tutorials/bql/filtering-with-where]] — string tests on attributes.
