Compliance Checking on Topological Spatial Relationships of Building Elements Based on Building Information Models and Ontology

<jats:p>Compliance checking on the topological spatial relationships of building elements is vital for ensuring the safety and the quality of buildings. However, the complex topological spatial relationships of buildings are not usually expressed in the design scheme directly. Manual checking is still needed to analyze the design scheme and extract the spatial relationships. Such manual checking is always time consuming and prone to error. Therefore, this study has proposed a compliance checking method based on a building information model (BIM) and building ontologies for the automatic checking of topological spatial relationships. Firstly, the topological spatial relationships are well captured and represented according to the location relation of building elements. The checking rules are further established based on regulations. Then, the design information is extracted from the design model, mainly including the location information of building elements. Next, the review ontology is developed, and the design information is organized based on the ontology. Finally, the checking is completed based on the ontology and checking rules. The authors have validated the proposed method through a case study. The results show that the proposed method could help to achieve automatic compliance checking on topological spatial relationships of building elements.</jats:p>

section_content: Building regulations define safety, sustainability, and comfort throughout the life cycle of the building environment [1]. However, the compliance checking of building regulations has heavily relied on the manual efforts and experiences of domain experts. Such manual efforts are always time consuming and prone to error [2]. Recently, a large number of researchers have conducted extensive studies on automatic compliance checking methods and algorithms for the automatic extraction of rich building design information in building information models (i. e., BIM) [3]. A construction engineering data exchange standard, namely, Industry Foundation Classes (IFCs) [4], is used to represent and normalize the storage of data in BIM to promote the checking process. However, the attributes and relationships of building elements in IFC documents are modeled in an object-oriented way [5], and the geometric representation of building elements and their spatial relationships are not clearly described [6, 7], limiting the current compliance review research on building spatial relationships. However, compliance checking on the spatial relationships of building elements is vital for ensuring the safety and the quality of buildings. 

There have been a lot of studies on BIM-based building spatial relationships' acquisition, investigating which building elements conform to a certain spatial relation. Currently, the typical acquisition examples of spatial relationships are as follows [8] :

(1) Which walls are on the first floor? (2) Is there any heating equipment in room 107? (3) What are the objects within 10 m of this point? (4) Which column contacts the No. 1 plate? (5) Is there a gas pipeline under the footing? Current studies on spatial relation acquisition seem to focus on the building elements that have spatial relations. However, compliance checking is different from acquisition. The checking not only needs to query the spatial relationship of building elements but also needs to consider the different situations of the same spatial relationship and the semantic relationship between building elements. For example, the building regulation texts require: "When the height of the wall exceeds 4 m, the half-height of the wall should be connected with the column". Here, the beam should be connected at the half-height of the wall, and there is a requirement for the connection position of the connection relation. The relevant regulations state that "The toilet cannot be set above the bedroom, and the equipment room that generates noise or vibration should not be adjacent to the meeting room". Here, the toilet and the bedroom are on the upper and lower floors, and the equipment room and the meeting room are on the same floor. In the current query process, different situations of the same spatial relationship cannot be screened, nor can the relationship between query elements be set in advance, i. e., the current query research cannot be directly used for review. 

To solve the above problems, this study proposes a method based on BIM and ontology for the compliance checking of building topological spatial relations. The following are the main aims of this research: (1) To determine the quantitative expressions of a building's topological spatial relationships according to the location relation of building elements, solving the problem that arises because the topological spatial relationships of buildings are not directly expressed in the design document, which leads to difficulties when checking. Moreover, different situations of the same spatial relationship could be expressed in different quantitative expressions; (2) To develop the building topological spatial relation checking ontology, in which the semantic relation of building elements required for regulation is described. By applying the method proposed in this paper to review the building spatial relationships in the design stage, we can avoid problems in the subsequent construction stage, as well as repeated construction, which wastes resources. This paper reviews building topological spatial relationships based on the code, which can improve the comfort and safety of a building's living environment and meet the requirements of sustainable development. 

The remaining parts of this paper are organized as follows: Section 2 reviews recent related literature, building compliance checking, BIM-based spatial relationship acquisition, and identifies research gaps. In Section 3, a framework for the compliance checking of building topological spatial relationships based on BIM and ontology is proposed, and four parts of the framework are introduced. Section 4 illustrates the effectiveness of the proposed framework with the case study. Section 5 summarizes the research and describes future work.
section_name: Introduction

section_content: To promote the process of building compliance checking, relevant scholars have carried out a large number of studies on it [9] [10] [11], including establishing the framework of compliance checking [12, 13]. The compliance review process can be roughly divided into four phases: (1) rule interpretation, which translates rules expressed in natural language into a computer-processable format, (2) building model preparation, which prepares the required information for the review process, (3) rule execution, which inspects prepared models using computer-processable rules, and (4) reporting checking results. Among these four stages, rule interpretation is the most important and complex one [13]. Consequently, a large number of studies have focused on how to translate normative natural language into computer-recognizable rules. Rule interpretation was initially implemented directly using hard coding [14], an inflexible approach that required considerable programming skills and considerable system maintenance when regulatory regulations were revised or updated. Subsequently, it is transferred to using first-order predicate logic, ontology [15, 16], and other methods to make rule interpretation more flexible. 

The rule interpretation stage presents two problems. The first problem is how to unify the concepts in the regulation texts and the concepts in the model, namely, semantic alignment, which is the premise of rule interpretation. The second problem is the selection of the specification markup language, which is the choice of language to describe the logic of the regulation texts. To solve the first problem, Zheng et al. [17, 18] developed the building fire protection ontology (FPBO) and automatically aligned the concepts in the ontology based on semantic similarity. Jiang et al. [19] adopted multiple ontologies and a set of mapping rules to realize the alignment. Many regulation text markup languages have been proposed in relevant studies, such as N3Logic, SWRL [20], LegalRuleML [21], Graph [22, 23], and RASE [24], etc., to express the knowledge and rules contained in the regulation. 

Currently, the main focus is on the compliance checking of the attributes of building elements, rather than spatial relationships. Because the spatial relationships of the building elements are not directly expressed in the design document, the direct translation of the spatial relationship regulations cannot be directly used for the review.
section_name: Literature Review 2.1. Compliance Checking

section_content: Aiming at building spatial relationship acquisition, Jiang [25] and Zheng [26] et al. extracted the existing spatial relationships in IFCs; however, the existing spatial relationships are far from meeting the requirements of the review [27]. Borrmann discussed in detail the types of spatial data and listed the spatial operators [28]. He used the nineintersection model to represent the proposed topological operator and then conducted a spatial analysis of the building information model based on octree, before finally extracting partial models that satisfy specific spatial constraints [7]. For the processing of spatial data to support spatial relation acquisition, quadtree and octree decomposition are the most common methods in the process of space division [29]. Another widely accepted method is the bounding body approximation method, which uses simple polyhedra to approximate irregular objects [30], including bounding balls and bounding boxes. Other foreign scholars have also carried out a series of studies based on defined spatial operators for building spatial relation queries. Daum [8] computed topological relations between elements based on boundary representation and optimized the actual running time and time complexity of topological predicates based on octree. Khalili [31] proposed a graphical data model (GDM) which can be used to extract, analyze, and present topological relationships between objects and perform topological queries by using semantic information. In recent years, Solihin [32] proposed a method to realize the spatial query of BIM data by using multiple representations of elements. In the same year, he transformed BIM data into a simplified relational database, and the R tree in Oracle Spatial was used to index the spatial relationship of building elements [33].
section_name: BIM-Based Building Spatial Relationship Acquisition

section_content: Although there have been a lot of studies on building compliance checking and BIMbased building spatial relationship acquisition, the direct realization of the compliance checking of building topological spatial relationships is still not yet possible, mainly due to two limitations. 

First, current building compliance checking mainly relies on IFC files for the compliance review; however, the IFC files do not explicitly describe the spatial relationships of building elements [6, 7], which makes it difficult to realize the compliance checking of building topological spatial relationships. 

Second, although current research on BIM-based spatial relationships acquisition could query specific building elements that conform to a certain spatial relationship, for the following reasons, it still cannot be directly used for compliance checking: (1) These studies mainly focus on the query of the spatial relationships of building elements but do not consider the different situations of the same spatial relationship and the semantic relationship between building elements, as required by the regulation texts. (2) These studies mainly focus on the topological relationships between building components and building components, building space, and building equipment [7, 8, 33]. The adjacent relationship between building space and building space is not similar to the components that are connected together, because spaces are separated by walls. Therefore, the acquisition method related to the topological relation between components and components does not apply to building spaces. (3) Currently, the defined spatial operators [29] are usually used to query the spatial relationships; however, the spatial operators do not usually adhere to the concept of spatial relationships described in the regulation texts; therefore, they cannot be directly used for compliance checking.
section_name: Knowledge Gaps

section_content: To address the abovementioned problems, the framework of the compliance checking method of building topological spatial relationships based on BIM and ontology proposed in this paper is shown in Figure 1, which contains four modules. (1) Quantitative translation module: This part firstly extracts and classifies topological spatial relations of building elements from the regulation texts; then, it quantifies the spatial relations according to the location relation of building elements; the checking rules are then further established. 

(2) Data extraction module: The design information is extracted from the IFC file, mainly including the location information of building elements. (3) Ontology development and instantiation module: This develops a review ontology according to the checking rules, and the design information is organized based on the ontology. (4) A rule-based checking module is combined with the instantiated ontology and checking rules to achieve a review of the building topological spatial relations and to obtain the checking results. 

Second, although current research on BIM-based spatial relationships acquisition could query specific building elements that conform to a certain spatial relationship, for the following reasons, it still cannot be directly used for compliance checking: (1) These studies mainly focus on the query of the spatial relationships of building elements but do not consider the different situations of the same spatial relationship and the semantic relationship between building elements, as required by the regulation texts. (2) These studies mainly focus on the topological relationships between building components and building components, building space, and building equipment [7, 8, 33]. The adjacent relationship between building space and building space is not similar to the components that are connected together, because spaces are separated by walls. Therefore, the acquisition method related to the topological relation between components and components does not apply to building spaces. (3) Currently, the defined spatial operators [29] are usually used to query the spatial relationships; however, the spatial operators do not usually adhere to the concept of spatial relationships described in the regulation texts; therefore, they cannot be directly used for compliance checking.
section_name: Methodology

section_content: To address the abovementioned problems, the framework of the compliance checking method of building topological spatial relationships based on BIM and ontology proposed in this paper is shown in Figure 1, which contains four modules. (1) Quantitative translation module: This part firstly extracts and classifies topological spatial relations of building elements from the regulation texts; then, it quantifies the spatial relations according to the location relation of building elements; the checking rules are then further established. ( 2 ) Data extraction module: The design information is extracted from the IFC file, mainly including the location information of building elements. (3) Ontology development and instantiation module: This develops a review ontology according to the checking rules, and the design information is organized based on the ontology. (4) A rule-based checking module is combined with the instantiated ontology and checking rules to achieve a review of the building topological spatial relations and to obtain the checking results.
section_name: Methodology

section_content: The purpose of this section is to translate the regulation texts related to building topological spatial relations into the SPARQL rule form. However, there is no unified classification standard for topological spatial relations in the regulations. The topological spatial relationships are not usually expressed in the design scheme directly. To translate the regulations, this paper first extracts and classifies the topological spatial relations in the regulations; then, it quantifies them based on the location relation of building elements and finally forms checking rules.
section_name: Quantitative Translation

section_content: The classification in this paper adopts the topological spatial relation category of building design proposed by Nguyen [34], i. e., adjacency, connection, inclusion, separation, and intersection. Adjacency represents the adjacent spatial relation of two building spaces, and connection represents the adjacent spatial relation of two building components. By traversing several codes and regulations on the website of the Industrial Standards Library [35], this paper extracted different building topological spatial relationships and classified them, as shown in Figure 1. We found that the building topological spatial relations in the regulations mainly included adjacency, connection, and inclusion.
section_name: Extraction and Classification of Building Topological Spatial Relationships

section_content: As shown in Table 1, this section quantifies the adjacency, connection, and inclusion relations according to the location relation of building elements. The premise of the quantitative expressions here is that the whole building is in the same coordinate system, and the relevant coordinate of building elements are selected for quantifying. However, this quantitative expression is not unique; therefore, there is no benchmark for quantified expressions. In this paper, we adopted the simplest quantified expression sought so far. The building spaces and building components involved in the quantified expressions in this section are rectangular. be set in inclusion between floor and space GB50016-2014 regulation for Fire Prevention in Building Design [39] 6. 1. 5: "Doors, Windows, and holes shall not be opened on the firewall".
section_name: Quantitative Expressions of Topological Spatial Relationships

section_name: Regulation Texts of Building Topological Spatial Relations

section_name: Building Topological Spatial Relations in Regulation Texts

section_content: be opened on inclusion between component and component
section_name: Category of Building Topological Spatial Relations

section_content: The adjacency relation represents the topological spatial relation between two adjacent building spaces. As shown in Table 1, the adjacency relation of the building in the regulations is divided into the adjacency of the adjacent floor and the adjacency of the same floor. The adjacency of the adjacent floor is shown in Figure 2a, and the adjacency of the same floors is shown in Figure 2b.
section_name: Quantitative Expression of Adjacency Relation

section_content: [39] 6. 1. 5: "Doors, Windows, and holes shall not be opened on the firewall". 

be opened on inclusion between component and component
section_name: GB50016-2014 regulation for Fire Prevention in Building Design

section_content: The adjacency relation represents the topological spatial relation between two adjacent building spaces. As shown in Table 1, the adjacency relation of the building in the regulations is divided into the adjacency of the adjacent floor and the adjacency of the same floor. The adjacency of the adjacent floor is shown in Figure 2a, and the adjacency of the same floors is shown in Figure 2b. The quantitative expression process of the adjacency relation of the adjacent floor is shown in Figure 3 (1), (2). First, the positioning coordinates of the space is determined. The positioning coordinates are {Maxx, Minx, Maxy, Miny, Maxz, Minz}, which represent the coordinate extremes of the space in the X, Y, and Z directions. For a specific space, the positioning coordinates are specific values that represent the position boundary of the space. Here, the positioning coordinates are obtained by comparing the coordinate values of each vertex of the building space. The maximum value of the X coordinates of all vertices is then selected as Maxx, and the minimum value as Minx. The same is true for Maxy, Miny, Maxz, Minz, etc. Then, the adjacency relation of the adjacent floor is expressed according to the location relationship of the spaces. Here, according to the location relation of the adjacent space's top surface, the quantified expression is that the distance between the center coordinates of the two spaces' top surfaces in the X direction (D1) is less than half of the length sum of the two spaces of the top surfaces in the X direction (T1); moreover, the distance between the center coordinates of the two spaces' top surfaces in the Y direction (D2) is less than half of the length sum of the two spaces' top surfaces in the Y direction (T2). Therefore, the adjacency relation of the adjacent floor is quantitatively expressed as D1 < T1, D2 < T2. 

The adjacency of the same floor could be divided into the adjacent surface vertical X direction and the adjacent surface vertical Y direction. According to Nguyen [40], the distance between two non-contact adjacency spaces in the adjacent direction should be less than two feet (ft), and its quantified expression process is determined as shown in Figure 3 (1), ( 3 ), (4). Firstly, the space positioning coordinates are determined according to the The quantitative expression process of the adjacency relation of the adjacent floor is shown in Figure 3 (1), (2). First, the positioning coordinates of the space is determined. The positioning coordinates are {Maxx, Minx, Maxy, Miny, Maxz, Minz}, which represent the coordinate extremes of the space in the X, Y, and Z directions. For a specific space, the positioning coordinates are specific values that represent the position boundary of the space. Here, the positioning coordinates are obtained by comparing the coordinate values of each vertex of the building space. The maximum value of the X coordinates of all vertices is then selected as Maxx, and the minimum value as Minx. The same is true for Maxy, Miny, Maxz, Minz, etc. Then, the adjacency relation of the adjacent floor is expressed according to the location relationship of the spaces. Here, according to the location relation of the adjacent space's top surface, the quantified expression is that the distance between the center coordinates of the two spaces' top surfaces in the X direction (D 1 ) is less than half of the length sum of the two spaces of the top surfaces in the X direction (T 1 ); moreover, the distance between the center coordinates of the two spaces' top surfaces in the Y direction (D 2 ) is less than half of the length sum of the two spaces' top surfaces in the Y direction (T 2 ). Therefore, the adjacency relation of the adjacent floor is quantitatively expressed as

The adjacency of the same floor could be divided into the adjacent surface vertical X direction and the adjacent surface vertical Y direction. According to Nguyen [40], the distance between two non-contact adjacency spaces in the adjacent direction should be less than two feet (ft), and its quantified expression process is determined as shown in Figure 3 (1),( 3 ),(4). Firstly, the space positioning coordinates are determined according to the coordinate of the space vertices. Then, the relation of the adjacent surface vertical X direction is quantified according to the location relation of the adjacent space top surface. The distance between the center coordinates of the two spaces' top surfaces in the X direction (D 1 ) is less than half of the length sum of the two space top surfaces in the X direction plus two feet (T 1 ). The distance between the central coordinates of the two space top surfaces in the Y direction (D 2 ) is less than half of the length sum of the two space top surfaces in the Y direction (T 2 ). The quantitative expression of the adjacent surface's vertical Y direction is the same as the adjacent surface's vertical X direction, as shown in Figure 3 (4). Therefore, for the adjacent surface vertical X direction, the quantitative expression is

For the adjacent surface vertical Y direction, the quantified expression is

two feet (T1′). The distance between the central coordinates of the two space top surfaces in the Y direction (D2) is less than half of the length sum of the two space top surfaces in the Y direction(T2). The quantitative expression of the adjacent surface's vertical Y direction is the same as the adjacent surface's vertical X direction, as shown in Figure 3 (4). Therefore, for the adjacent surface vertical X direction, the quantitative expression is D1 < T1′, D2 < T2. For the adjacent surface vertical Y direction, the quantified expression is D1 < T1, D2 < T2′. 

Maxy=Max(y a,y b,y c,y d,y e,y f,y g,y h ) Miny=Min(y a,y b,y c,y d,y e,y f,y g,y h )

③Quantified expression of adjacency relation of same floor --Adjacent surface vertical X direction:

④Quantified expression of adjacency relation of same floor --Adjacent surface vertical Y direction:
section_name: Quantitative Expression of Adjacency Relation

section_content: The connection relation represents the topological spatial relation between two adjacent building components, namely, the connection between column and beam, as shown in Figure 4. Taking the connection relationship between column and beam as an example, the quantitative expression process of the connection relation is shown in Figure 5. Firstly, the component positioning coordinates are determined according to the coordinate of component vertices {a, b, c, d, e, f, g, h}. The meaning of position coordinates here is the same as the meaning of the position coordinates in the quantified expression of the adjacency relations. The maximum value of the X coordinates of all vertices is selected as Maxx, and the minimum value is selected as Minx; this is also true for Maxy, Miny, Maxz, Minz, etc. The component positioning coordinate is {Maxx, Minx, Maxy, Miny, Maxz, Minz}. Then, the quantitative expression is determined according to the location relation of the component top surface and the relative height of the connecting surfaces. In addition, according to the different modeling methods, there may be overlapping parts of the two components. Therefore, the quantitative expression is when the distance of the central coordinates of the two components' top surface in the X direction (D 1 ) and the Y direction (D 2 ) is less than or equal to half of the length sum of the two components' top surface in the X direction (T 1 ) and the Y direction (T 2 ), respectively. The maximum coordinate value (Maxz1) of the column in the Z direction is greater than or equal to the minimum coordinate value (Minz2) of the beam in the Z direction. The maximum coordinate value (Maxz2) of the beam in the Z direction is greater than or equal to the minimum coordinate value (Minz1) of the column in the Z direction. The connection relationship is quantified as

When there is a requirement for the position of the component connection in the regulation, the checking could be realized by adjusting the quantified expression of the relative height of the two components. 

the quantitative expression process of the connection relation is shown in Figure 5. Firstly, the component positioning coordinates are determined according to the coordinate of component vertices {a, b, c, d, e, f, g, h}. The meaning of position coordinates here is the same as the meaning of the position coordinates in the quantified expression of the adjacency relations. The maximum value of the X coordinates of all vertices is selected as Maxx, and the minimum value is selected as Minx; this is also true for Maxy, Miny, Maxz, Minz, etc. The component positioning coordinate is {Maxx, Minx, Maxy, Miny, Maxz, Minz}. Then, the quantitative expression is determined according to the location relation of the component top surface and the relative height of the connecting surfaces. In addition, according to the different modeling methods, there may be overlapping parts of the two components. Therefore, the quantitative expression is when the distance of the central coordinates of the two components' top surface in the X direction (D1) and the Y direction(D2) is less than or equal to half of the length sum of the two components' top surface in the X direction (T1) and the Y direction (T2), respectively. The maximum coordinate value (Maxz1) of the column in the Z direction is greater than or equal to the minimum coordinate value (Minz2) of the beam in the Z direction. The maximum coordinate value (Maxz2) of the beam in the Z direction is greater than or equal to the minimum coordinate value (Minz1) of the column in the Z direction. The connection relationship is quantified as D1 ≤ T1, D2 ≤ T2, Maxz1 ≥ Minz2, Maxz2 ≥ Minz1. When there is a requirement for the position of the component connection in the regulation, the checking could be realized by adjusting the quantified expression of the relative height of the two components.
section_name: Quantitative Expression of Connection Relation

section_content: As shown in Table 1, the checking of the inclusion relations in the regulations could be roughly divided into three categories. The inclusion relations between the floors and rooms and the inclusion relations between the components and components could be directly extracted from IFC files, so that only the quantitative expression of the inclusion relation between room and equipment is required. This is also true for Figure 3 (1), in which the positioning coordinates of the space are determined according to the space vertex coordinates. However, the equipment is usually an irregular geometric body; therefore, the central coordinates (x0, y0, z0) of the bounding box surrounding the equipment are used as the positioning coordinates of the equipment, as shown in Figure 6. Then, the inclusion relationship between the room and equipment was quantified as Minx < x0 < Maxx, Miny < y0 < Maxy, Minz < z0 < Maxz. 

②Quantitative expression of connection relation：
section_name: Quantitative Expression of Inclusion Relation

section_content: As shown in Table 1, the checking of the inclusion relations in the regulations could be roughly divided into three categories. The inclusion relations between the floors and rooms and the inclusion relations between the components and components could be directly extracted from IFC files, so that only the quantitative expression of the inclusion relation between room and equipment is required. This is also true for Figure 3 (1), in which the positioning coordinates of the space are determined according to the space vertex coordinates. However, the equipment is usually an irregular geometric body; therefore, the central coordinates (x 0, y 0, z 0 ) of the bounding box surrounding the equipment are used as the positioning coordinates of the equipment, as shown in Figure 6. Then, the inclusion relationship between the room and equipment was quantified as Minx < x 0 < Maxx, Miny < y 0 < Maxy, Minz < z 0 < Maxz.
section_name: Quantitative Expression of Inclusion Relation

section_content: As shown in Table 1, the checking of the inclusion relations in the regulations could be roughly divided into three categories. The inclusion relations between the floors and rooms and the inclusion relations between the components and components could be directly extracted from IFC files, so that only the quantitative expression of the inclusion relation between room and equipment is required. This is also true for Figure 3 (1), in which the positioning coordinates of the space are determined according to the space vertex coordinates. However, the equipment is usually an irregular geometric body; therefore, the central coordinates (x0, y0, z0) of the bounding box surrounding the equipment are used as the positioning coordinates of the equipment, as shown in Figure 6. Then, the inclusion relationship between the room and equipment was quantified as Minx < x0 < Maxx, Miny < y0 < Maxy, Minz < z0 < Maxz.
section_name: Quantitative Expression of Inclusion Relation

section_content: Based on the quantitative expressions of the building topological spatial relations in Section 3. 1. 2, the basic expression forms of the regulation texts were analyzed to establish checking rules. SPARQL was used as the rule description language. SPARQL is an RDF-oriented query language that obtains the content to be found using graph matching. SPARQL takes its syntax from SQL and can use the filter function to narrow the scope of the query. Taking the establishment of checking rules for the adjacency of an adjacent floor as an example, the basic expression form of the regulation texts and the checking rule is shown in Table 2. Modal words in the regulation are usually "should not", "inappropriate", etc. The filter function is used to screen out the specific building space according to SPARQL checking rules. Here, the filter function is the quantitative expression of the adjacency of the adjacent floor. By the same token, the checking rules for the connecting relation and inclusion relation could be determined.
section_name: Checking Rules' Establishment

section_content: According to checking rules, this paper checks the spatial topological relationships between building elements with the help of the positioning coordinates of the building elements. According to the description of the positioning coordinates in Section 3. 1. 2. For building elements and building spaces, the positioning coordinates are determined using the vertex coordinates of the elements. For building equipment, which is usually irregular in shape, the positioning coordinates are determined using the vertex coordinates of the bounding box that encloses the equipment. This section focuses on how to extract the vertex coordinates of the building elements and vertex coordinates of the bounding box. 

In this paper, coordinates are extracted based on the IFC file derived from the building design BIM model. In the IFC file, the coordinates of the building elements are not described directly but are instead obtained by combining location information and geometric shape information. The location and geometric shape information of the building elements are depicted as shown in Figure 7. Building elements have a variety of shape description methods, combined with spatial relationship quantitative expression, for the different shapes of building elements. The geometry parameters to be obtained here are IfcExtrudedAreaSolid and IFCBoundingBox. 

According to checking rules, this paper checks the spatial topological relationships between building elements with the help of the positioning coordinates of the building elements. According to the description of the positioning coordinates in Section 3. 1. 2. For building elements and building spaces, the positioning coordinates are determined using the vertex coordinates of the elements. For building equipment, which is usually irregular in shape, the positioning coordinates are determined using the vertex coordinates of the bounding box that encloses the equipment. This section focuses on how to extract the vertex coordinates of the building elements and vertex coordinates of the bounding box. 

In this paper, coordinates are extracted based on the IFC file derived from the building design BIM model. In the IFC file, the coordinates of the building elements are not described directly but are instead obtained by combining location information and geometric shape information. The location and geometric shape information of the building elements are depicted as shown in Figure 7. Building elements have a variety of shape description methods, combined with spatial relationship quantitative expression, for the different shapes of building elements. The geometry parameters to be obtained here are IfcExtrudedAreaSolid and IFCBoundingBox. This section uses Ifcopenshell to extract relevant parameters, as shown in Figure 8. For the acquisition of geometry shape parameters, different parameters are extracted for different building elements. For building components and building spaces, relevant parameters of IfcExtrudedAreaSolid are drawn here, including the stretching plane size (SweptArea), stretching plane Position (Position), stretching distance (Depth), and stretching direction (ExtrudedDirection). For equipment, relevant parameters of IfcBoundingBox are drawn here, including bounding box corner coordinates (Corner), X direction length (XDim), Y direction length (YDim), and Z direction length (ZDim). Finally, the positioning coordinates of the building elements are calculated in combination with the location information and geometric shape information. This section uses Ifcopenshell to extract relevant parameters, as shown in Figure 8. For the acquisition of geometry shape parameters, different parameters are extracted for different building elements. For building components and building spaces, relevant parameters of IfcExtrudedAreaSolid are drawn here, including the stretching plane size (SweptArea), stretching plane Position (Position), stretching distance (Depth), and stretching direction (ExtrudedDirection). For equipment, relevant parameters of IfcBoundingBox are drawn here, including bounding box corner coordinates (Corner), X direction length (XDim), Y direction length (YDim), and Z direction length (ZDim). Finally, the positioning coordinates of the building elements are calculated in combination with the location information and geometric shape information.
section_name: Data Extraction

section_content: The ontology is developed according to the checking rules, and the extracted information is converted into ontology instances. As shown in Figure 9, the ontology contains 4 classes and 6 relationships. Building components, building equipment, and building space are the reviewed objects. The arrows between class and class indicate that there is a
section_name: Ontology Development and Instantiation

section_content: The ontology is developed according to the checking rules, and the extracted information is converted into ontology instances. As shown in Figure 9, the ontology contains 4 classes and 6 relationships. Building components, building equipment, and building space are the reviewed objects. The arrows between class and class indicate that there is a relationship between the two classes. For example, there is a relationship "floor" between the building space and the building floor, representing the building space belonging to the floor. Moreover, there are relationships relating to the "upper floor" and "same floor" inside the building floor. The coordinates used for the reasoning topological spatial relationships between the review objects are defined by data attributes as shown in Table 3. In Table 3, there may be some other attributes which could be added according to the need of regulations.
section_name: Ontology Development and Instantiation

section_content: The building topological spatial relationship checking was completed based on the checking rules established in Section 2. 1 and the instantiated ontology, and the review results were obtained. Using the regulation of "Restrooms shall not be placed directly on the upper floors of bedrooms, living rooms (halls), kitchens and dining rooms of lowerlevel residents" as an example, the final checking result of the adjacency relation is shown in Table 4. According to the checking result, toilet 1 on the second floor is located above bedroom 1 on the first floor, which does not meet the requirements of the regulation.
section_name: Rule-Based Checking

section_content: The building topological spatial relationship checking was completed based on the checking rules established in Section 2. 1 and the instantiated ontology, and the review results were obtained. Using the regulation of "Restrooms shall not be placed directly on the upper floors of bedrooms, living rooms (halls), kitchens and dining rooms of lower-level residents" as an example, the final checking result of the adjacency relation is shown in Table 4. According to the checking result, toilet 1 on the second floor is located above bedroom 1 on the first floor, which does not meet the requirements of the regulation.
section_name: Rule-Based Checking

section_content: In this paper, the spatial relationships involved in several codes are extracted and classified. The classified spatial relations were expressed quantitatively according to the position relationships of building elements. The classified spatial relations and the corresponding quantified expressions are shown in Table 5. The meanings of all variable values in the quantified expressions are explained in Section 3. 1. 2. In addition, a review of the ontology of the building topological spatial relations applicable to this method was developed. The above results of the study could be reused in subsequent applications. The subsequent application process is probably to extract the location information of building elements new BIM instances. The checking rules are written according to new checking rules, and the quantified expressions are shown in Table 5. Finally, the spatial relationship checking process is completed by combining the checking rules and ontology instances. When adjacent surface vertical X direction:
section_name: Results and Discussion

section_content: Minx < x 0 < Maxx, Miny < y 0 < Maxy, Minz < z 0 < Maxz Compared with the current BIM-based spatial relationship acquisition methods, this paper has converted the spatial relationships into quantified expressions based on the position relationships of the building elements. Thus, it achieved the conversion of the checking of spatial relations into the checking of the position relations of building elements. The method proposed in this paper could query different states of the same topological spatial relationships and could screen out the relationships between query objects required in the regulations. Therefore, the method proposed in this paper is more in line with the characteristics of compliance checking and is convenient for the review. Moreover, different states of the same topological spatial relationship could use more accurate quantitative expressions. For example, the height of the connection between the beam and the column could be limited by reducing the coordinate range of the connection surface in the Z direction. 

However, the method proposed in this paper is only intended for building spaces and building components of rectangular shape. The quantitative representations of spatial relations involving building elements of other shapes will be addressed later. Due to the small amount of data regarding the regulations related to building topological spatial relations, it is difficult to implement data training; therefore, the construction of the checking rules in this paper was mainly completed manually. Therefore, the following research work could be carried out according to two aspects: (1) Enriching the quantitative expressions of spatial relationships involving other shaped building elements. (2) Automatic translations of the regulation texts related to topological spatial relations.
section_name: inclusion between Space and equipment

section_content: To verify the feasibility and practicability of the method, the regulation texts in Table 1 were selected as the checking texts. Because the checking texts in Table 1 are for different building types, two buildings are used here for the case study. Building 1 is a residential building and Building 2 is a building integrating office and commercial areas. The BIM models of the buildings are shown in Figure 10. In Building 2, floors -3 to 3 are for the commercial area and floors 4 to 5 are for the office area. To better reflect the practicability of the method in this paper, the design scheme of the buildings is modified according to the selected regulations; therefore, it does not meet the requirements of the regulations. The selected regulations, checking rules, and corresponding design modification scheme are shown in Table 6, where Q1, Q2. 1, Q2. 2, and Q3 are for checking Building 1 and Q4. 1, Q4. 2, Q5, Q6 are for checking Building 2. The variables used to determine spatial relationships in the checking rules, such as D1 and T1, are defined in Section 3. 1. 2 and can be expressed using the positioning coordinates of the building elements. During the checking process, it is necessary to represent these variables using positioning coordinates. The second checking rule is divided into two steps according to the regulation. The first step is to query the wall with a height of more than 4 m. The second step is to query the wall with a height of more than 4 m and with a beam connected at the semi-height. Since there are requirements for the connection position of the connection relationship, the quantitative expression is further adjusted according to the relative height of the component. The middle of the wall is defined here as between 1/3 and 2/3 of the height of the wall. The final checking result could be obtained by combining the two-step query results. The fourth checking rule is also divided into two parts, where Q4. 1 is used to check the space of the adjacent surfaces that are vertical to the X direction and Q4. 1 is used to check the space of the adjacent surfaces that are vertical to the Y direction. The checking results of the two parts were integrated to obtain the space of the adjacency of the adjacent floor. ?b ont:minx ?minx2. ?a ont:miny ?miny1.
section_name: Case Study

section_content: ?b ont:miny ?miny2. ?a ont:maxx ?maxx1. 

?b ont:maxx ?maxx2. ?a ont:maxy ?maxy1. 

?b ont:maxy ?maxy2. 

Set the toilet above the bedroom: To better reflect the practicability of the method in this paper, the design scheme of the buildings is modified according to the selected regulations; therefore, it does not meet the requirements of the regulations. The selected regulations, checking rules, and corresponding design modification scheme are shown in Table 6, where Q1, Q2. 1, Q2. 2, and Q3 are for checking Building 1 and Q4. 1, Q4. 2, Q5, Q6 are for checking Building 2. The variables used to determine spatial relationships in the checking rules, such as D 1 and T 1, are defined in Section 3. 1. 2 and can be expressed using the positioning coordinates of the building elements. During the checking process, it is necessary to represent these variables using positioning coordinates. The second checking rule is divided into two steps according to the regulation. The first step is to query the wall with a height of more than 4 m. The second step is to query the wall with a height of more than 4 m and with a beam connected at the semi-height. Since there are requirements for the connection position of the connection relationship, the quantitative expression is further adjusted according to the relative height of the component. The middle of the wall is defined here as between 1/3 and 2/3 of the height of the wall. The final checking result could be obtained by combining the two-step query results. The fourth checking rule is also divided into two parts, where Q4. 1 is used to check the space of the adjacent surfaces that are vertical to the X direction and Q4. 1 is used to check the space of the adjacent surfaces that are vertical to the Y direction. The checking results of the two parts were integrated to obtain the space of the adjacency of the adjacent floor. 

The topological spatial relationship of the building elements was reviewed according to the checking method described in Section 3, and the checking results are shown in Table 7. Combined with the selected regulations, the checking results of Q1 indicate that toilet 3 on the second floor is set above bedroom 2 on the first floor; the checking results of Q2 indicate that wall 6 and wall 10 have a height of over 4000; however, no beam is set for half of the height of wall 10. Wall 10 does not meet the requirements according to the regulation. The checking results of Q3 indicate that gas water heater 1 is set in bathroom 1. The final checking results are consistent with the design modification scheme, which indicates that the method can realize a review of the building's topological spatial relationships. The checking results of Q4 indicate that there are equipment rooms and meeting rooms adjacent to each other on the 4th floor. The checking results of Q5 indicate that there is a business hall on the -3rd floor. The checking results of Q6 indicate that there is a hole in the firewall on the 2nd floor.
section_name: Regulation Texts Checking Rules Design Modification Scheme

section_content: In order to realize a review of a building's spatial relationships, this paper proposed a building topological spatial relationship review method based on BIM and ontology, with the following main research results: (1) the quantified expressions of the spatial relationships were constructed. This paper extracted and classified building topological spatial relations in several commonly used codes and expressed the spatial relations quantitatively based on the position relationships of building elements. Combined with the quantitative expressions of spatial relations, the regulations involving the review of the spatial relations could be converted into checking rules. This result is the key to converting a review of spatial relations into a review of the location of building elements. However, the quantitative expressions of spatial relations are not unique, and the current quantitative expressions are the simplest ones sought so far. (2) An ontology that is suitable for this method has been developed. Based on this ontology, the location information of building elements extracted from BIM can be converted into ontology instances and combined with corresponding checking rules to obtain checking results. 

In order to verify the feasibility and applicability of the proposed method, two different types of buildings were used as case studies to review the spatial relationships. Combined with the quantified expressions of the spatial relationships in Table 5, the regulations were converted into SPARQL checking rules. Combined with the constructed ontology, the location information of building elements extracted from BIM was converted into ontology instances. Based on the checking rules, the ontology instances are queried to obtain the checking results. The checking results are the same as the predefined non-compliant spatial relationships, i. e., it was verified that the method proposed in this paper could achieve a review of the building topological spatial relationships. The method proposed in this paper for reviewing building spatial relationships can also be used to review other spatial relationships outside the code; however, the quantified expressions of new spatial relationships need to be enhanced. That is, the method proposed in this paper can be used to improve the comfort and safety of a building's living environment based on various spatial relationship design requirements and to meet the requirements of sustainable development.
section_name: Conclusions

section_name: Institutional Review Board Statement: Not applicable.

section_content: Funding: This research received no external funding.

section_content: Informed Consent Statement: Not applicable.
section_name: Institutional Review Board Statement: Not applicable.

section_name: Acknowledgments:

section_content: Data Availability Statement: Not applicable.

section_content: The authors would like to thank Beijing University of Technology, Beijing, China.
section_name: Acknowledgments:

section_name: Table 6.

section_content: The selected regulations, the checking rules, and the corresponding design modification scheme. ?b ont:minx ?minx2. ?a ont:miny ?miny1.
section_name: Table 6.

section_name: Regulation Texts Checking Rules Design Modification Scheme

section_content: ?b ont:miny ?miny2. ?a ont:maxx ?maxx1. 

?b ont:maxx ?maxx2. ?a ont:maxy ?maxy1. 

?b ont:maxy ?maxy2. filter (D1 < T1 && D2 < T2)} GB50011-2010 Regulation for Seismic Design of Buildings 13. 3. 4: "For masonry filled walls in reinforced concrete structures, when the wall height exceeds 4 m, reinforced concrete horizontal beams connected with columns and through the whole length of the wall should be installed at the halfheight of the wall". Table 6. The selected regulations, the checking rules, and the corresponding design modification scheme. ?b ont:minx ?minx2. ?a ont:maxx ?maxx1.
section_name: Regulation Texts Checking Rules Design Modification Scheme

section_content: ?b ont:maxx ?maxx2. ?a ont:miny ?miny1. 

?b ont:miny ?miny2. ?a ont:maxy ?maxy1. 

?b ont:maxy ?maxy2. ?a ont:minz ?minz1. 

?b ont:minz ?minz2. ?a ont:maxz ?maxz1. 

?b ont:maxz ?maxz2. ?a ont:ID ?ID1. ?b ont:ID ?1D2 ?a inclusion ?b}

The topological spatial relationship of the building elements was reviewed according to the checking method described in Section 3, and the checking results are shown in Table 7. Combined with the selected regulations, the checking results of Q1 indicate that toilet 3 on the second floor is set above bedroom 2 on the first floor; the checking results of Q2 indicate that wall 6 and wall 10 have a height of over 4000; however, no beam is set for half of the height of wall 10. Wall 10 does not meet the requirements according to the regulation. The checking results of Q3 indicate that gas water heater 1 is set in bathroom SELECT ?a ?ID1 ?a floor WHERE {?a rdf:type ont:business hall. 

?a ont:floor ?a floor. filter (?a floor < = -3)} GB50016-2014 regulation for Fire Prevention in Building Design 6. 1. 5: "Doors, Windows, and holes shall not be opened on the firewall".
section_name: Regulation Texts

section_content: Set a hole in the firewall:

?a ont:minx ?minx1. ?b ont:minx ?minx2. ?a ont:miny ?miny1. 

?b ont:miny ?miny2. ?a ont:maxx ?maxx1. 

?b ont:maxx ?maxx2. ?a ont:maxy ?maxy1. 

?b ont:maxy ?maxy2. filter (D1 < T1 && D2 < T2′)} GB50016-2014 regulation for Fire Prevention of Building Design 5. 4. 3:" Business Hall and exhibition hall shall not be set in the underground three floors or below".
section_name: Q6:

section_content: Set up the business hall on the -3F:

SELECT ?a ?ID1 ?a floor WHERE {?a rdf:type ont:business hall. 

?a ont:floor ?a floor. ?a ont:ID ?ID1. ?b ont:ID ?1D2 ?a inclusion ?b}

The topological spatial relationship of the building elements was reviewed according to the checking method described in Section 3, and the checking results are shown in Table 7. Combined with the selected regulations, the checking results of Q1 indicate that toilet 3 on the second floor is set above bedroom 2 on the first floor; the checking results of Q2 indicate that wall 6 and wall 10 have a height of over 4000; however, no beam is set for half of the height of wall 10. Wall 10 does not meet the requirements according to the regulation. The checking results of Q3 indicate that gas water heater 1 is set in bathroom
section_name: Q5:

section_content: The authors declare no conflict of interest.
section_name: Conflicts of Interest: