Concept

A really nice feature for BimQL would be the possibility to perform spatial queries. Then it would be possible to make selections which are based on the position of objects. It would for example be possible to select all windows on the south side of the building or all collumns above the fourth floor.

A BimQL spatial query could look like this. It selects all objects which are located above 15 meters. This example introduces a PositionZ operator, perhaps better alternatives exist!

Select ?Var1
Where ?Var1.PositionZ > 15

The next example is another suggestion. It first selects a specific object with a certain Global ID. Then all doors which are within 10 meters from that object are selected. This example introduces a DistanceTo operator. Again, this is only a suggestion for future development. This feature has not been implemented and better alternatives might exist. Any suggestions are welcome!

Select ?Var1
Where ?Var1.Attribute.GlobalId = “32UdM49pfAMxiX5WyXhCuy”
Select ?Var2
Where ?Var2.EntityType = “IfcDoor” And ?Var2.DistanceTo.?Var1 < 10

Implementation

Like all other data, geometry is also stored in an IFC file. A possible method for storing the geometry of a door is shown in the picture below.

A property, for example a color or a material, is not directly related to an object and the same is true for an object’s geometry. To retrieve an object’s property a shortcut was created. It might also be possible to create a shortcut to retrieve the geometry of an object.

If I had to implement the spatial query feature, I would start with the basics. After looking at the figure above, I would first create an operator (GetAllIfcCartesianPoints) that would help me to retrieve the IfcCartesianPoints. After completing that task, the next query should be possible. It should return a list of points, belonging to one object.

Select ?Var1
Where ?Var1.Attribute.GlobalId = “32UdM49pfAMxiX5WyXhCuy”
Select ?Var2 := ?Var1.GetAllIfcCartesianPoints

That list of points tells you something about the location of the object. It for example tells you if it is completely or partially above a certain height. Now might be the moment to implement the PositionZ operator introduced at the top of this page.

Please remind, this are just some suggestions to get you started. These suggestions are based on the methods I applied while developing BimQL, however better approaches migth exist. Any suggestions are welcome!