Directed Representative Graph Modeling of MEP Systems Using BIM Data

: Mechanical, electrical, and plumbing (MEP) systems are crucial to a building, which directly affect the building safety, energy saving, and operational efﬁciency. Building information models (BIMs) help engineers to view the connection structure of MEP elements, reducing the time for reading drawings and training costs. However, existing MEP systems bring a tremendous challenge to monitoring due to issues with the complicated spatial structure, large scale, and intuitiveness. In addition, there is still a lack of feasible methods to model a representative graph in MEP systems. To address this problem, this study proposes an approach to model a directed representative graph of MEP systems using BIM data. The proposed approach contains two parts, the representative edge extraction and the direction identiﬁcation. Firstly, MEP elements are converted into triangular meshes on which boundary points are extracted. Secondly, representative sets are developed to extract the representative points. Thirdly, representative points are connected to generate representative edges. Meanwhile, there are topological connection relationships among MEP elements and the ﬂow directions of MEP ports, all of which are extracted to obtain the graph direction based on Industry Foundation Classes (IFC). Subsequently, representative edges and directions are combined to obtain the directed representative graph. Finally, experiments of directed representative graph extraction are evaluated on six BIM models. The experimental results show that directed representative graphs are extracted successfully. Furthermore, a simulated system is developed to integrate the directed representative graph and the Internet of Things (IoT) to realize the intelligent monitoring of MEP systems. The proposed directed representative graph model lays a solid foundation for the development of MEP systems monitoring management in smart buildings.


Introduction
Mechanical, Electric, and Plumbing (MEP) system is an indispensable part of a building, providing a comfortable and safe environment for individuals. MEP engineering refers to the engineering of management of plumbing, Heating, Ventilation, and Air Conditioning (HVAC), water supply, drainage, electricity, energy conservation, etc., in buildings [1]. The healthy operation of the MEP system is vital to the lifecycle of any MEP subsystem, including the design, construction, operation, and maintenance of the MEP system and its subsystems [2].
Building Information Model/Modeling (BIM) is a digital representation of physical and functional characteristics of a facility and supports decision makings throughout its lifecycle [3][4][5]. BIM provides a virtual model for the operation and maintenance management to visualize the spatial layout of buildings using 3D digital technology. BIM models (1) Proposing the directed representative graph model of an MEP system. The directed representative graph uses the representative points and the lines between two adjacency representative points to represent the vertices and edges, respectively. Moreover, the graph describes the representative spatial locations and the real flow direction. (2) Integrating IoT and the directed representative graph model. Several sensors are installed on MEP elements to collect the monitored data. Then, the data are linked to the directed representative graph model based on BIM. The proposed graph model reflects the operation of an MEP system in real-time.
(3) Developing a simulated system to visualize the monitored data. The proposed system visualizes the data simulated by the OPC server and employs arrows with encoded information to represent the types of systems, the flow directions of substances, and the velocity.
The remainder of this paper is organized as follows. Section 2 discusses related works. Section 3 provides the necessary definition and the overall framework. Section 4 develops Buildings 2022, 12, 834 3 of 21 the scheme of directed representative graph generation. Section 5 describes the experiments, and the last section presents conclusions.

Related Works
MEP systems, also termed active building systems, are essential to a building's function and must meet performance expectations for comfort and safety [1]. As BIM technology has attracted extensive attention in recent decades, it provides new opportunities to achieve high-quality management of MEP systems. At present, BIM-and MEP-related publications cover different phases from the design and construction to operation and maintenance.
In the design phase, current studies mainly focus on the MEP coordination. MEP coordination aims to eliminate potential conflicts between systems before field installation [22]. Korman et al. [1] captured distributed knowledge about the different types of systems and utilized a computer tool designed to represent this knowledge for MEP coordination improvement. Riley et al. [23] explored the costs associated with the design coordination in concert with the benefits of eliminating coordination conflicts and developed a standard method to measure the costs of coordination.
In the construction phase, existing research includes monitoring pipe prefabrications [24], collision tests [25], construction safety analysis [24], site management [26], and so on. For example, Akhil and Das [27] employed value engineering, supply chain management, and site management cost control in MEP projects to reduce wastage and improve output in construction. Tserng et al. [28] provides a rational planning algorithm that packages large and complex MEP systems into several smaller fabricated components using spatial planning algorithms to increase the efficiency of the installation process, reduce construction cycle time, and minimize cost.
In the operation and maintenance phase, publications include BIM-based integrated delivery [2], data-driven prediction [20], as-built industrial instrumentation [29], knowledge acquisition [30], and so on. Hu et al. [31] proposed a multi-scale BIM to address the insufficiencies of the current BIM-based facility management of MEP projects. Wang et al. [32] utilized the semantic information provided by images and geometry information provided by 3D LiDAR clouds to reconstruct as-built BIM models for MEP scenes. Son et al. [29] reconstructed 3D models of as-built industrial instrumentation from terrestrial laser-scan data and a 3D computer-aided design (CAD) database based on prior knowledge.
To sum up, there are a considerable number of studies in the field of MEP engineering. However, the technology of MEP system monitoring is considered to still be in its premature state, meaning that there is still a lack of feasible methods and tools to aid engineers. In recent years, some scholars have explored the application of Internet of Things (IoT); for example, Zhang and Bai [33] utilized radio frequency identification (RFID) to monitor structural conditions for post-hazard inspections. Zhou et al. [34] employed a cloud gateway for sensors and a natural language processing (NLP)-based sensor-BIM alignment to upgrade the traditional fire alarm system. Therefore, our proposed method, modeling a representative graph integrated with IoT, enables the development of MEP engineering monitoring to be improved.

Definitions and Overall Framework
This section presents a systematical definition about the directed representative graph. Table 1 lists notations used in this study and Section 3.3 shows the framework of our proposed scheme.

IFC (Industrial Foundation Classes)
IFC (Industry Foundation Classes) [35,36] is an industrial foundation class standard, an open international standard for exchanging and sharing among multiple participants in building-and the facility-management projects. The standard includes definitions covering the data required for buildings over their lifecycle. At the most abstract level, IFC divides all entities into rooted and non-rooted entities. Rooted entities are derived from IfcRoot and have a concept of identity (including a GUID), along with attributes for name, description, and revision control. Non-rooted entities do not have an identity, and instances exist only if referenced from a rooted instance directly or indirectly. The IfcRoot is subdivided into three abstract aspects: IfcObjectDefinition, IfcPropertyDefinition, and IfcRelationship. Figure 1 presents the entity inheritance relationships.

Terminology Definition and Problem Definition
Mechanical, electrical, and plumbing (MEP) engineering refers to the management of non-structural functions of a building [2]. It incorporates management of plumbing, Heating, Ventilation, and Air Conditioning (HVAC), electricity, energy conservation, elevator maintenance, etc. Definition 1 (MEP system) Mechanical, electrical, and plumbing (MEP) system M refers to a building system for the building equipment and the pipeline engineering, which enables the flow of a distribution media to be received, stored, maintained, or controlled.
In IFC specification, MEP systems are a subclass of IfcSystems that can be represented by IfcDistributionSystems. Figure 2 shows an instance of MEP systems.  In IFC specification, an IfcObject is a subtype of the IfcObjectDefinition. An IfcObject is the generalization of any semantically treated thing or process. An IfcProduct is a subtype of the IfcObject. The IfcProduct is an abstract representation of any object that relates to a geometric or spatial context. An IfcProduct occurs at a specific location in space if it has a geometric representation assigned. The ObjectPlacement attribute establishes the coordinate system in which all points and directions used by the geometric representation items under representation are found. The representation is provided by an IfcProductDefi-nitionShape, which can be either a geometric or a topological representation. Apart from physical products (covered by the subtype IfcElement) and spatial items, IfcProducts also includes non-physical items, which are related to a geometric or spatial context, such as a grid, port, annotation, or structural actions. The IfcElement and the IfcPort are subtypes of IfcProduct. An element is a generalization of all components that make up an AEC (architecture, engineering, and construction) product. A port provides the means for an element to connect to other elements.
The IfcGroup is another subtype of IfcObjects. The IfcGroup is a logical collection of objects. An IfcSystem is a subtype of IfcGroups, and it refers to an organized combination of related parts within an AEC product, composed for a common purpose or function or to provide a service.

Terminology Definition and Problem Definition
Mechanical, electrical, and plumbing (MEP) engineering refers to the management of non-structural functions of a building [2]. It incorporates management of plumbing, Heating, Ventilation, and Air Conditioning (HVAC), electricity, energy conservation, elevator maintenance, etc. Definition 1. (MEP system) Mechanical, electrical, and plumbing (MEP) system M refers to a building system for the building equipment and the pipeline engineering, which enables the flow of a distribution media to be received, stored, maintained, or controlled.
In IFC specification, MEP systems are a subclass of IfcSystems that can be represented by IfcDistributionSystems. Figure 2 shows an instance of MEP systems.

Terminology Definition and Problem Definition
Mechanical, electrical, and plumbing (MEP) engineering refers to the management of non-structural functions of a building [2]. It incorporates management of plumbing, Heating, Ventilation, and Air Conditioning (HVAC), electricity, energy conservation, elevator maintenance, etc. Definition 1 (MEP system) Mechanical, electrical, and plumbing (MEP) system M refers to a building system for the building equipment and the pipeline engineering, which enables the flow of a distribution media to be received, stored, maintained, or controlled.
In IFC specification, MEP systems are a subclass of IfcSystems that can be represented by IfcDistributionSystems. Figure 2 shows an instance of MEP systems. Definition 2 (MEP element) An MEP element e is a physically existent object that participates in the MEP system, which facilitates the distribution of energy or matter such as air, water, or power. An MEP element often relates to a geometric or spatial context. Therefore, an MEP element usually incorporates two parts: a 3D geometric shape g and its semantic attribute a. Thus, e = (ge, ae).ge is represented by at least one of the following models: boundary representation (Brep), non-uniform rational B-splines (NURBS), constructive solid geometry (CSG), or swept solid model (SweptSolid). However, the use of hybrid 3D geometric representations also brings disadvantages because these 3D representation models cannot be directly rendered. Moreover, the triangle is widely accepted as a general 3D data model that can be directly rendered in most software. In this scenario, triangle t is used to describe the geometric shape of an MEP element, ge = {t1, t2, t3, ⋯, tn}, where n is the number of t. t contains three points, and a point of t is p(t) = (x, y, z). The semantic attribute ae incorporates the relationship information and the attribute information. According to the IFC specification, relations contain topological connection relationships among MEP elements and the direction

Definition 2. (MEP element)
An MEP element e is a physically existent object that participates in the MEP system, which facilitates the distribution of energy or matter such as air, water, or power. An MEP element often relates to a geometric or spatial context. Therefore, an MEP element usually incorporates two parts: a 3D geometric shape g and its semantic attribute a. Thus, e = (g e , a e ).g e is represented by at least one of the following models: boundary representation (Brep), non-uniform rational B-splines (NURBS), constructive solid geometry (CSG), or swept solid model (SweptSolid). However, the use of hybrid 3D geometric representations also brings disadvantages because these 3D representation models cannot be directly rendered. Moreover, the triangle is widely accepted as a general 3D data model that can be directly rendered in most software. In this scenario, triangle t is used to describe the geometric shape of an MEP element, g e = {t 1 , t 2 , t 3 , · · · , t n }, where n is the number of t. t contains three points, and a point of t is p(t) = (x, y, z). The semantic attribute a e incorporates the relationship information and the attribute information. According to the IFC specification, relations contain topological connection relationships among MEP elements and the direction relationship of an MEP element. In addition, a e describes the entity's own information, including name, type, and so on.    An MEP port has the characteristic that indicates the direction of the connection. For example, an elbow has two MEP ports that have opposite flow directions (one side being a SOURCE and the other being a SINK). Thus, s = (s c , s k ) and s ∈ e. MEP ports are similar to openings in that they do not have any visible geometry. Figure 4 presents an example of MEP elements. Definition 3 (MEP port) An MEP port s is an inlet or outlet of an M through which a particular substance may flow. According to IFC s ports are defined by the IfcDistributionPort. An MEP port has the characteristic that indicates the direction For example, an elbow has two MEP ports that have opposite flow d being a SOURCE and the other being a SINK). Thus, s = (sc, sk) and s ∈ similar to openings in that they do not have any visible geometry. Figure 4 presents an example of MEP elements.

Definition 4 (Representative edge(s))
A representative edge is a line the spatial location and the shape of the MEP element. A representative edge is constituted by two points (e.g., p1, p2) representative edge p is denoted as the representative point. Undo element with unchanged normal vectors has only one representativ whose normal vectors change has multiple representative edges. Hen requires extracting two representative points and connecting them method appears unsuitable for the latter.

Definition 4. (Representative edge(s))
A representative edge is a line representation of the spatial location and the shape of the MEP element.
A representative edge is constituted by two points (e.g., p 1 , p 2 ) and a point of the representative edge p is denoted as the representative point. Undoubtedly, the MEP element with unchanged normal vectors has only one representative edge, while one whose normal vectors change has multiple representative edges. Hence, only the former requires extracting two representative points and connecting them. Apparently, this method appears unsuitable for the latter. We have, where m is the number of representative points, and µ represents relations between representative points. Specifically, the relation E refers to the edge direction and there are two types of directional relationships.

Overall Framework
To monitor MEP systems intelligently, this study develops a directed representative graph using BIM data. This scheme incorporates two modules, the representative edge extraction and the direction identification. Figure 5 shows the overall framework of our proposed scheme. are two types of directional relationships.

Overall Framework
To monitor MEP systems intelligently, this study develops a directed representative graph using BIM data. This scheme incorporates two modules, the representative edge extraction and the direction identification. Figure 5 shows the overall framework of our proposed scheme.   Figure 5b shows the first module, which is the process of representative edge extraction. Representative edge extraction contains two parts. For the first part, MEP elements are first converted into triangular meshes because triangles can be rendered directly in most browsers. We utilize Lawson Bowyer's pointby-point interpolation algorithm for Delaunay triangulation. Firstly, triangles with discrete points are generated on the surface of an MEP element to obtain an initial grid. Subsequently, the empty circle property of Delaunay triangulation is used to form more new grids, and eventually a triangulated MEP element is obtained. For the second part, boundary points are identified from the triangulated MEP element. Then, Equation (3) is used to extract the center point O1 of the representative set (namely boundary points) Q1. Further, boundary points are deleted to obtain the representative Q2 and the center point O2. This method is iterated to extract all center points in sequence. As the center point enables the spatial position of an MEP element to be represented, the center point is called the representative point. Finally, all these representative points are connected to generate representative edges. Figure 5c illustrates the procedure of direction identification. This module consists of two parts. In the first part, the semantic information of MEP elements is extracted from an IFC file. In the second part, we employ the IfcDistributionPort of an MEP port to obtain the connection direction on an MEP element and utilize the IfcRelconncetsPorts to obtain the topological connection relationships between two MEP elements. Finally, the flow direction of an MEP element and topological connection relationships between two elements are used to obtain representative edge directions.
Furthermore, a simulated system is designed to visualize monitored data using IoT integration technology. Figure 5d presents an intelligent MEP system. The directed representative graph utilizes changeable arrows to represent the monitor data (e.g., temperature, velocity, flow rate) and visualizes MEP systems in real time.   Figure 5b shows the first module, which is the process of representative edge extraction. Representative edge extraction contains two parts. For the first part, MEP elements are first converted into triangular meshes because triangles can be rendered directly in most browsers. We utilize Lawson Bowyer's point-by-point interpolation algorithm for Delaunay triangulation. Firstly, triangles with discrete points are generated on the surface of an MEP element to obtain an initial grid. Subsequently, the empty circle property of Delaunay triangulation is used to form more new grids, and eventually a triangulated MEP element is obtained. For the second part, boundary points are identified from the triangulated MEP element. Then, Equation (3) is used to extract the center point O 1 of the representative set (namely boundary points) Q 1 . Further, boundary points are deleted to obtain the representative Q 2 and the center point O 2 . This method is iterated to extract all center points in sequence. As the center point enables the spatial position of an MEP element to be represented, the center point is called the representative point. Finally, all these representative points are connected to generate representative edges. Figure 5c illustrates the procedure of direction identification. This module consists of two parts. In the first part, the semantic information of MEP elements is extracted from an IFC file. In the second part, we employ the IfcDistributionPort of an MEP port to obtain the connection direction on an MEP element and utilize the IfcRelconncetsPorts to obtain the topological connection relationships between two MEP elements. Finally, the flow direction of an MEP element and topological connection relationships between two elements are used to obtain representative edge directions.
Furthermore, a simulated system is designed to visualize monitored data using IoT integration technology. Figure 5d presents an intelligent MEP system. The directed representative graph utilizes changeable arrows to represent the monitor data (e.g., temperature, velocity, flow rate) and visualizes MEP systems in real time.

Directed Representative Graph Generation
The directed representative graph generation incorporates two parts, the representative edge extraction and the direction identification. They are explained in detail in the ensuing sub-sections.

Representative Edge Extraction
This section aims to extract representative edges using boundary points. Usually, triangulations can be rendered directly in most browsers, and thereby all MEP elements are first transformed into triangular meshes [5]. Subsequently, boundary points are extracted to obtain representative points. Finally, representative points are connected to generate the representative edge (or edges). As the MEP element with unchanged cross-section normal vectors is a special case of the one whose normal vectors of the cross-section change in the process of representative edge extraction, this study takes the latter as an example for discussion, as illustrated in Figure 6.
triangulations can be rendered directly in most browsers, and thereby all MEP elements are first transformed into triangular meshes [5]. Subsequently, boundary points are extracted to obtain representative points. Finally, representative points are connected to generate the representative edge (or edges). As the MEP element with unchanged crosssection normal vectors is a special case of the one whose normal vectors of the crosssection change in the process of representative edge extraction, this study takes the latter as an example for discussion, as illustrated in Figure 6. Among these triangulation techniques, the Delaunay algorithm is suitable to generate triangular meshes because Delaunay triangulations have good regularity and are easy to generalize in three-dimensional (3D) problems. The point-by-point insertion algorithm, Bowyer-Watson, is used to generate Delaunay triangulation. Figure 7 shows the process of the Delaunay algorithm. Firstly, a triangle with discrete points is formed. Secondly, points are given to generate an initial grid and new points are added to this grid. Thirdly, all triangles whose circumcircle contains newly added points are found, and these triangles are removed to form cavities. Further, newly added points are connected to obtain vertices of the cavity to form new Delaunay triangular meshes. Finally, this process is iterated until all vertices are added to generate triangle meshes.  Among these triangulation techniques, the Delaunay algorithm is suitable to generate triangular meshes because Delaunay triangulations have good regularity and are easy to generalize in three-dimensional (3D) problems. The point-by-point insertion algorithm, Bowyer-Watson, is used to generate Delaunay triangulation. Figure 7 shows the process of the Delaunay algorithm. Firstly, a triangle with discrete points is formed. Secondly, points are given to generate an initial grid and new points are added to this grid. Thirdly, all triangles whose circumcircle contains newly added points are found, and these triangles are removed to form cavities. Further, newly added points are connected to obtain vertices of the cavity to form new Delaunay triangular meshes. Finally, this process is iterated until all vertices are added to generate triangle meshes.
triangulations can be rendered directly in most browsers, and thereby all MEP elements are first transformed into triangular meshes [5]. Subsequently, boundary points are extracted to obtain representative points. Finally, representative points are connected to generate the representative edge (or edges). As the MEP element with unchanged crosssection normal vectors is a special case of the one whose normal vectors of the crosssection change in the process of representative edge extraction, this study takes the latter as an example for discussion, as illustrated in Figure 6. Among these triangulation techniques, the Delaunay algorithm is suitable to generate triangular meshes because Delaunay triangulations have good regularity and are easy to generalize in three-dimensional (3D) problems. The point-by-point insertion algorithm, Bowyer-Watson, is used to generate Delaunay triangulation. Figure 7 shows the process of the Delaunay algorithm. Firstly, a triangle with discrete points is formed. Secondly, points are given to generate an initial grid and new points are added to this grid. Thirdly, all triangles whose circumcircle contains newly added points are found, and these triangles are removed to form cavities. Further, newly added points are connected to obtain vertices of the cavity to form new Delaunay triangular meshes. Finally, this process is iterated until all vertices are added to generate triangle meshes.  Additionally, initial triangles with discrete points are first generated on an MEP element, then Bowyer-Watson algorithm is used to integrate all the points into Delaunay meshes. The process of triangulation is illustrated in Figure 8. Additionally, initial triangles with discrete points are first generated on an MEP el ement, then Bowyer-Watson algorithm is used to integrate all the points into Delaunay meshes. The process of triangulation is illustrated in Figure 8. In fact, triangular points of an MEP element are divided into two types. One type is the boundary point, and another is the interior point. Boundary points are located on the contour curve where MEP ports are located, and internal points are located on the con In fact, triangular points of an MEP element are divided into two types. One type is the boundary point, and another is the interior point. Boundary points are located on the contour curve where MEP ports are located, and internal points are located on the contour curve of an MEP element other than MEP ports. To facilitate description, an MEP element is divided into k cross-sections in order. The contour curve of a cross-section is represented by C i (1 ≤ I ≤ k). The cross-section curve of an MEP element is depicted in Figure 9. Though triangular meshes on the MEP element are randomly generated, these cross-sectional curves do not actually exist. Consequently, the polygon with finite (n) triangle points can be represented as the cross-section, and the set of n triangle points is termed as the representative set Q i . That is, p im is a triangle point, where i represents the i-th representative set, m is the m-th point on the representative set, and k is the number of the representative set.
tour curve of an MEP element other than MEP ports. element is divided into k cross-sections in order. The c represented by Ci (1 ≤ I ≤ k). The cross-section curve o Figure 9. Though triangular meshes on the MEP eleme cross-sectional curves do not actually exist. Consequen angle points can be represented as the cross-section, a termed as the representative set Qi. That is, Because center points of representative sets repres element, this study utilizes the center point as the rep generality, the MEP element with unchanged cross-sect sentative points (the center points) of two outer crosssentative edge. The element with mutative cross-sectio ing representative points of each cross-section curve to es). In fact, representative points of outer cross-section ing boundary points of triangular meshes.
To facilitate the description of boundary extraction jacent triangle mesh and the adjacent points [35]. Take the triangle where p is located is the adjacent triangle o angle points is the edge of a triangle, these triangle poi that is, ge = {t|p ∈ t, where t is the triangular mesh and the set of adjacent points is denoted as W, W = {q|t, p∈ Because center points of representative sets represent the spatial position of an MEP element, this study utilizes the center point as the representative point. Without loss of generality, the MEP element with unchanged cross-section normal vectors utilizes representative points (the center points) of two outer cross-section curves to build the representative edge. The element with mutative cross-section normal vectors requires extracting representative points of each cross-section curve to obtain representative edge (edges). In fact, representative points of outer cross-section curves can be obtained by extracting boundary points of triangular meshes.
To facilitate the description of boundary extraction, it is imperative to define the adjacent triangle mesh and the adjacent points [35]. Take any point p of an MEP element, the triangle where p is located is the adjacent triangle of p. If a line between any two triangle points is the edge of a triangle, these triangle points are defined as adjacent points; that is, g e = {t|p ∈ t, where t is the triangular mesh and p is the triangle point}. Moreover, the set of adjacent points is denoted as W, W = {q|t, p∈t &&q∈t, where q is the point different from p on the triangle}. The set W is used to determine whether the triangle point p is the boundary point. If all adjacent points of p can be connected by edges of triangles to form a closed curve, then p is an interior triangle point; otherwise, p is a boundary point. Figure 10 presents ten triangles. Take p 6 as an example; W p6 = {p 1 , p 2 , p 3 , p 7 } and p 1 p 2 , p 2 p 3 , p 3 p 7 , p 1 p 7 constitute a closed curve. Therefore, p 6 is not the boundary point. Similarly, p 7, p 8 , and p 9 are not the boundary point.
to form a closed curve, then p is an interior triangle point; otherwise, p is a bo point. Figure 10 presents ten triangles. Take p6 as an example; Wp6 = {p1, p2, p3, p7} a p2p3, p3p7, p1p7 constitute a closed curve. Therefore, p6 is not the boundary point. ly, p7, p8, and p9 are not the boundary point. Take the elbow as an example. All triangle points can be identified using bo points because points are distributed randomly on the MEP element surface boundary point has a clear characteristic. Moreover, according to the spatial d tion, these points are located in C1 and Ck regularly; thus, sets where these point cated are represented by Q1 and Qk. Consequently, points are obtained using E (3), termed as the representative points O1 and O2, where Oi = (xi, yi, zi). If O1 an connected, then the representative edge of an MEP element with unchanged section normal vectors is obtained. However, this method is not suitable for M ments with mutative cross-section normal vectors. The process of the repres edge extraction of an MEP element with unchanged cross-section normal vectors trated in Figure 11. Take the representative set Q1 as the start, and then delete boundary points will appear, and the new representative set is denoted as Q2. L the representative point O2 is obtained from Q2. Iterating these steps, all repres sets are extracted in turn, namely {Q1, Q2, ⋯, Qk}. Correspondingly, representativ are acquired using Equation (3), namely {O1, O2, ⋯, Ok}. Representative edges ar ated by connecting these points.  Take the elbow as an example. All triangle points can be identified using boundary points because points are distributed randomly on the MEP element surface and the boundary point has a clear characteristic. Moreover, according to the spatial distribution, these points are located in C 1 and C k regularly; thus, sets where these points are located are represented by Q 1 and Q k . Consequently, points are obtained using Equation (3), termed as the representative points O 1 and O 2 , where O i = (x i , y i , z i ). If O 1 and O k are connected, then the representative edge of an MEP element with unchanged cross-section normal vectors is obtained. However, this method is not suitable for MEP elements with mutative cross-section normal vectors. The process of the representative edge extraction of an MEP element with unchanged cross-section normal vectors is illustrated in Figure 11. Take the representative set Q 1 as the start, and then delete Q 1 ; new boundary points will appear, and the new representative set is denoted as Q 2 . Likewise, the representative point O 2 is obtained from Q 2 . Iterating these steps, all representative sets are extracted in turn, namely {Q 1 , Q 2 , · · · , Q k }. Correspondingly, representative points are acquired using Equation (3), namely {O 1 , O 2 , · · · , O k }. Representative edges are generated by connecting these points.
the set of adjacent points is denoted as W, W = {q|t, p∈t &&q∈t, where q is the point different from p on the triangle}. The set W is used to determine whether the triangle point p is the boundary point. If all adjacent points of p can be connected by edges of triangles to form a closed curve, then p is an interior triangle point; otherwise, p is a boundary point. Figure 10 presents ten triangles. Take p6 as an example; Wp6 = {p1, p2, p3, p7} and p1p2, p2p3, p3p7, p1p7 constitute a closed curve. Therefore, p6 is not the boundary point. Similarly, p7, p8, and p9 are not the boundary point. Take the elbow as an example. All triangle points can be identified using boundary points because points are distributed randomly on the MEP element surface and the boundary point has a clear characteristic. Moreover, according to the spatial distribution, these points are located in C1 and Ck regularly; thus, sets where these points are located are represented by Q1 and Qk. Consequently, points are obtained using Equation (3), termed as the representative points O1 and O2, where Oi = (xi, yi, zi). If O1 and Ok are connected, then the representative edge of an MEP element with unchanged crosssection normal vectors is obtained. However, this method is not suitable for MEP elements with mutative cross-section normal vectors. The process of the representative edge extraction of an MEP element with unchanged cross-section normal vectors is illustrated in Figure 11. Take the representative set Q1 as the start, and then delete Q1; new boundary points will appear, and the new representative set is denoted as Q2. Likewise, the representative point O2 is obtained from Q2. Iterating these steps, all representative sets are extracted in turn, namely {Q1, Q2, ⋯, Qk}. Correspondingly, representative points are acquired using Equation (3), namely {O1, O2, ⋯, Ok}. Representative edges are generated by connecting these points. Algorithm 1 summarizes the whole process of representative edge extraction from the MEP system. Line 3 acquires triangular meshes based on the Delaunay algorithm. Lines 17-26 extract boundary points on a triangulated MEP element. Lines 4-14 extract all representative points using representative sets. Line 10 obtains each representative point using Equation (3). Iterating lines 2-16, all representative points are extracted. Line 17 generates representative edges by connecting these representative points.
Distribute Q into two parts according to spatial positions of boundary points 8.
Take Q i as the start 10.
Obtain O i using Equation (3)

Direction Identification
This section aims to automatically generate the direction of MEP elements. The IFC file includes the semantic information on MEP elements and topological connection relationships between adjacent MEP elements [35]. Figure 12 presents the framework of the direction identification. Firstly, the semantic and relationship data are extracted from an IFC file. Secondly, the internal relation of an MEP element and relations between adjacent elements are extracted. Finally, representative points are connected using representative arrows to generate the graph direction.

Semantic Information Extraction
BIM data contain the geometric and semantic information of a building. It is a digital expression of the physical and functional characteristics of a building. BIM establishes a unified data format for the whole process by constructing the IFC standard and realizes the unified format storage and sharing of the whole-process BIM data. In IFC specifications, each element corresponds to an instance of the IFC class, namely the object. Likewise, each IFC instance describes an MEP element and forms a computer object that corresponds to the knowledge in the BIM definition.
MEP systems based on IFC are analyzed into six types of entities, namely the IfcDistributionControlElement, the IfcFlowController, the IfcFlowSegment, the IfcFlow-Fitting, the IfcFlowTerminal, and the IfcBuildingElementPoxy (including the IfcEner-

Semantic Information Extraction
BIM data contain the geometric and semantic information of a building. It is a digital expression of the physical and functional characteristics of a building. BIM establishes a unified data format for the whole process by constructing the IFC standard and realizes the unified format storage and sharing of the whole-process BIM data. In IFC specifications, each element corresponds to an instance of the IFC class, namely the object. Likewise, each IFC instance describes an MEP element and forms a computer object that corresponds to the knowledge in the BIM definition.
MEP systems based on IFC are analyzed into six types of entities, namely the IfcDis-tributionControlElement, the IfcFlowController, the IfcFlowSegment, the IfcFlowFitting, the IfcFlowTerminal, and the IfcBuildingElementPoxy (including the IfcEnergyConversion-Device, the IfcFlowMovingDevice, the IfcFlowStorageDevice, and the IfcFlowTreatment-Device). The IfcDistributionControlElement defines the occurrence elements of a building automation control system that are used to impart control over elements of an MEP system. The IfcFlowController defines the occurrence of elements of an MEP system that are used to regulate flow through an MEP system. The IfcFlowSegment refers to the occurrence of a segment of a flow MEP system. The IfcFlowFitting refers to the occurrence of a junction or transition in a flow MEP system such as an elbow or a tee. Both the IfcFlowSegment and the IfcFlowFitting are the occurrence of an MEP system, and they provide a similar function; therefore, these two types of entities are considered one type entity. The IfcFlowTerminal is the occurrence of a permanently attached element that acts as a terminus or the beginning of an MEP system (such as an air outlet, drain, water closet, or sink). The IfcBuildingEle-mentPoxy refers to the occurrence of a device used to provide a service or function in an MEP system, for example, the conveyance of fluids, temporary storage, energy conversion, or heat transfer, and removing unwanted matter. Table 2 presents six types of entities in the MEP system. IfcRelationship is the abstract generalization of all objectified relationships of an MEP system. It is typically used to extract the topological connection relationship by adjacent elements. Moreover, the IfcRelationship has five subtypes, namely IfcRelAssigns, IfcRelAssociates, IfcRelConnects, IfcRelDecomposes, and IfcRelDefines. The IfcRelConnects is usually used to determine the flow direction in the subclasses of IFC, which includes IfcRelConnectsPorts, IfcRelConnectsElements, and IfcRelFlowControlElements. Generally, the IfcPort is used to identify the flow direction of the interior of an MEP element. In the IFC specification, an IfcPort is associated with an IfcElement, and it belongs to through the objectified relationship IfcRelNests if the port is fixed, or IfcRelConnectsPortToElement if the port is dynamically attached. The internal direction of an MEP element is from s c to s k . Exactly two ports, belonging to two different elements, are connected through the objectified relationship IfcRelConnectsPorts.

Topological Connection Relationship Extraction
The IFC specification defines the topologies of an MEP system using the IfcRelConnects. The topological connection relationship is divided into two types: the control relationship and the upstream and downstream relationships. The control relationship corresponds to the topological connection relationship of the IfcRelFlowControlElements, which can be extracted directly. The upstream and downstream relationships of an MEP system are determined by the IfcDistributionPort, the IfcDistributionElement, and the relationship between them. In addition, the upstream and downstream relationships between MEP elements are presented by the IfcDistributionPort attached to the MEP element and the relationship between them. According to the topology between the MEP port and the MEP element e, the IfcDistributionPort is connected to the MEP element e using two types of relationships, the IfcRelConnectsPortToElement and the IfcRelNests. The IfcDistributionPort defines the upstream and downstream relationship using the IfcRel-ConnectsPorts, and the direction of the upstream and downstream relationship using the ConnectedFrom and ConnectedTo. Figure 13 illustrates the topological connection relationships of MEP elements. tionship and the upstream and downstream relationships. The control relationship corresponds to the topological connection relationship of the IfcRelFlowControlElements, which can be extracted directly. The upstream and downstream relationships of an MEP system are determined by the IfcDistributionPort, the IfcDistributionElement, and the relationship between them. In addition, the upstream and downstream relationships between MEP elements are presented by the IfcDistributionPort attached to the MEP element and the relationship between them. According to the topology between the MEP port and the MEP element e, the IfcDistributionPort is connected to the MEP element e using two types of relationships, the IfcRelConnectsPortToElement and the IfcRelNests. The IfcDistributionPort defines the upstream and downstream relationship using the IfcRelConnectsPorts, and the direction of the upstream and downstream relationship using the ConnectedFrom and ConnectedTo. Figure 13 illustrates the topological connection relationships of MEP elements.
tween MEP elements are presented by the IfcDistributionPort attached to the MEP element and the relationship between them. According to the topology between the MEP port and the MEP element e, the IfcDistributionPort is connected to the MEP element e using two types of relationships, the IfcRelConnectsPortToElement and the IfcRelNests. The IfcDistributionPort defines the upstream and downstream relationship using the IfcRelConnectsPorts, and the direction of the upstream and downstream relationship using the ConnectedFrom and ConnectedTo. Figure 13 illustrates the topological connection relationships of MEP elements.
RelControl RelControl Figure 13. The topological connection relationship of the IFC instance of the MEP element. Figure 14 presents an instance of the upstream and downstream relationship. Without loss in generality, an IFC instance is a concrete instance of an IFC entity. #175782 is an instance of class IfcRelConnectsPorts, and 175782 is the instance number. This instance defines the relationship that is made between two ports located in #175763 and #175777. #175763 and #175777 are both instances of class IfcDistributionPort. The text "#175763 = IFCDISTRIBUTIONPORT ('2WIZguDaDFAwt6jkbnC7eQ', #41, 'In-Port_694055', 'Flow', $, #175761, $, SINK.)" shows the identification in the first attribute (guid), and the eighth attribute is the flow direction SINK. Likewise, the text "#175777 = IFCDISTRIBUTIONPORT ('29_xxOVWr7Fg1Acq5Pm3sr', #41, 'OutPort_694210′, 'Flow', $, #175775, $, SOURCE.)" shows the flow attribute is SOURCE. Apparently, the direction of IfcRelConnectsPorts object is from #175763 to #175777.  The direction identification starts from an MEP element (such as a flow segment).
Steps of direction identification act as follows.
(1) If the topological connection relationship of the IfcRelFlowControlElements is recognized from MEP elements, it is the controlling relationship. If the entity is the IfcDistributionControlElement or IfcFlowController, the connected entity is an IfcFlowSegment or an IfcFlowFitting, and then the direction is IfcBuildingEle-mentPoxy to IfcFlowSegment or IfcFlowFitting.
Extract the relationship between the adjacency MEP elements 8. Else: 9.
Extract the attribute information (InPort or OutPort) of IfcPort 10. return the direction relations E

Experiments
This section evaluates the performance of our proposed technology. Moreover, our proposed technique has been deployed as an online service at http://www.boswinner.com/ (accessed on 6 May 2022).

Experiment Settings
Datasets. In the testing processing, we utilized extensive BIM models to evaluate the performance of our proposed framework. This study randomly selected six representative BIM models with MEP systems to illustrate the experimental results. These models con-tained many types of MEP systems, and these systems included various shapes of MEP elements, making them ideal for experimental testing. These BIM models were designed by Autodesk Revit and exported to the .ifc format. Additionally, IFC 4 was used for modeling models #1, #2, and #3, and IFC 2 × 3 was used for modeling models #4, #5, and #6. Versions of IFC had little effect on the performance of our proposed method. Figure 16 presented the shapes and IFC versions of these models. Figure 17 illustrated an example of the IFC exporting setting.

Experiment Settings
Datasets. In the testing processing, we utilized extensive BIM models to evaluate the performance of our proposed framework. This study randomly selected six representative BIM models with MEP systems to illustrate the experimental results. These models contained many types of MEP systems, and these systems included various shapes of MEP elements, making them ideal for experimental testing. These BIM models were designed by Autodesk Revit and exported to the .ifc format. Additionally, IFC 4 was used for modeling models #1, #2, and #3, and IFC 2 × 3 was used for modeling models #4, #5, and #6. Versions of IFC had little effect on the performance of our proposed method. Figure 16 presented the shapes and IFC versions of these models. Figure 17 illustrated an example of the IFC exporting setting.

Environment.
All the experiments were conducted on a computer with an 8-core

Environment.
All the experiments were conducted on a computer with an 8-core CPU and 16 GB memory. The algorithms were implemented in JavaScript and C++.

Experiment Results
We selected several MEP elements from each BIM model to extract representative

Environment.
All the experiments were conducted on a computer with an 8-core CPU and 16 GB memory. The algorithms were implemented in JavaScript and C++.

Experiment Results
We selected several MEP elements from each BIM model to extract representative edges and generate flow directions. Types of MEP elements included the pipeline, elbow, tee, square tube, and so on. To ensure clear observation, selected MEP elements were set to be transparent, and yellow arrows were employed to represent directed representative edges. Figure 18 presents these extracted directed representative edges. Figure 18a shows BIM model#1. Directed representative edges of two elbows and two pipelines are presented. Figure 18b shows representative edges of two elbows and one tee generated in model #2. As illustrated in Figure 18c, directed representative edges of two pipelines and one elbow were extracted in model #3. Figure 18e presents the directed representative edges of two elbows and one pipeline extraction in model #5. As shown in Figure 18f, directed representative edges of two elbows and one pipeline were generated in model #6. The empirical results show that our proposed method can successfully extract directed representative edges. Additionally, we randomly selected #2, #5, and #6 out of the six BIM models to evaluate the time of a directed representative graph identification. Figure 19 shows the directed representative graph of model #2. Algorithm 1 was first used to obtain the representative edges, and then Algorithm 2 was utilized to extract the flow direction relationships; finally, arrows were employed to represent the directed representative graph. Furthermore, Table 3   Additionally, we randomly selected #2, #5, and #6 out of the six BIM models to evaluate the time of a directed representative graph identification. Figure 19 shows the directed representative graph of model #2. Algorithm 1 was first used to obtain the representative edges, and then Algorithm 2 was utilized to extract the flow direction relationships; finally, arrows were employed to represent the directed representative graph. Furthermore, Table 3 compares the extraction results of directed representative graphs on three random BIM models. on three random BIM models. The extracting time of the directed representative graph includes the time of the representative edge extraction and the time of the flow direction identification. In model #2, the memory was 5.76 Mbyte, the number of MEP elements was 272, and the time was 0.76 min. The time of model #5 was 2.67 min when the memory was 21.82 Mbyte and the numbers of MEP elements were 7134. Model #6 had an extracting time of 4.12 min with 222.66 Mbyte memory and 17160 MEP elements. Meanwhile, the accuracy of all three models reached 100%. Figure 19. Directed representative graph of model 2#. Figure 19. Directed representative graph of model 2#. As discussed above, our method successfully generated the directed representative graph. Although the performance of our proposed scheme had been verified for only six BIM models, it was anticipated that this scheme would have similar performances with more BIM models.

Simulation Systems
Our proposed directed representative graph model integrated with IoT realized the intelligent monitoring. The intelligent monitoring system incorporated two main components: the sensing system and the BIM model. The sensing system was mainly used to communicate the flow of MEP elements, with automatic data collection and wireless transmission function. More precisely, the sensing system collected the temperature, velocity, and flow rate of the medium using a flow sensor and a temperature sensor. First, several sensors were installed on MEP elements to collect the sensing data (e.g., temperature, velocity, and flow rate). Then, the sensing data were linked to the BIM system model. Finally, directed representative graphs with the sensing data were visualized to monitor MEP systems in real-time. Take the China Construction Library as an example; we demonstrated the application of an MEP intelligent monitoring system. This library included various of MEP systems (e.g., the pumping system, the fire-fighting system, and the HVAC system) and more than 10,000 MEP elements. Additionally, it had a cube shape and covered an area of 35,635 square meters. All of these factors made the China Construction Library available in our experiments.
Sensing devices were not placed in the library; therefore, this study utilized the OPC Server to generate the simulated data to represent the data monitored by sensors. In the experiments, we firstly employed the OPC Server to generate two sets of data. One set was used at the start of the experiment, and another was applied at the end. The simulated data mainly included the temperature, velocity, and flow rate of the medium, as shown in Table 4. Moreover, the directed representative graph was represented by numerous arrows. Arrows with encoded information (e.g., color, density, and size) represented the simulated data and visualized to display on the MEP monitoring system. For instance, the arrow's color referred to the type of the MEP system, the arrow's density was the velocity of the medium, and the arrow's size represented the flow rate.  Figure 20a was a top view of the second floor of the library. MEP systems on the second floor contained 3310 MEP elements and three types of MEP systems (e.g., the fire-fighting system, the domestic water supply system, and the HVAC ventiduct system). Figure 20b was a top view of MEP systems of the library. The directed representative graph was composed of numerous arrows. The red arrows represented the firefighting system, the blue arrows represented the domestic water supply system, and the yellow arrows referred to the HVAC ventiduct system. Likewise, directions of arrows represented flow directions of MEP systems. The flow at the start of the experiment is shown in Figure 20c,d, illustrating the flow at the end of the experiment. Obviously, as the velocity and the flow rate increased, the density and the size of arrows became large. MEP systems on the second floor contained 3310 MEP elements and three types of MEP systems (e.g., the fire-fighting system, the domestic water supply system, and the HVAC ventiduct system). Figure 20b was a top view of MEP systems of the library. The directed representative graph was composed of numerous arrows. The red arrows represented the firefighting system, the blue arrows represented the domestic water supply system, and the yellow arrows referred to the HVAC ventiduct system. Likewise, directions of arrows represented flow directions of MEP systems. The flow at the start of the experiment is shown in Figure 20c,d, illustrating the flow at the end of the experiment. Obviously, as the velocity and the flow rate increased, the density and the size of arrows became large. Overall, the simulated system realized the intelligent of MEP systems using IoT integration technology and allowed managers to interact with the visualized MEP system in real time. Overall, the simulated system realized the intelligent of MEP systems using IoT integration technology and allowed managers to interact with the visualized MEP system in real time.

Conclusions
The complicated spatial structure, large scale, and unintuitive drawings all pose a tremendous challenge to monitoring MEP systems. However, there is still a lack of feasible monitoring methods in MEP engineering. To address this issue, this study modeled a directed representative graph using BIM data and integrated the graph with IoT to monitor MEP systems. The directed representative graph uses the representative points to represent the vertices and the lines between two adjacency representative points to indicate the edges. Firstly, representative edges were extracted on triangulated BIM elements. Then, the semantic information of MEP elements based on IFC file was obtained to generate flow directions of MEP elements. Finally, our proposed method was validated on six BIM models in Revit. The designed simulated system shows the application of IoT on a directed representative graph to monitor MEP systems intelligently.
The innovation of this study involves a directed representative graph using BIM data to monitor MEP systems. The extraction of representative edges is a major difficulty in our scheme, especially for MEP elements with changed cross-section normal vectors. To achieve representative edge extraction, boundary points were identified in sequence to obtain representative points so that these points are connected to form representative edges. Furthermore, we integrated BIM and IoT to monitor the dynamic MEP system using changeable arrows, which have good performance in visualizations.
The limitation of our study is that it requires high modeling quality of the MEP system to extract the topological connection relationships. Therefore, our next study will focus on repairing the topological connection relationships based on IFC. Additionally, this research will continue to explore the O & M management of MEP systems to provide reliable shared information for various decisions in the whole lifecycle of buildings.