Application of graph databases and graph theory concepts for advancedanalysing of BIM models based on IFC standardAli Ismail, Ahmed Nahar, Raimar SchererTU Dresden, [email protected] In this paper we present a workflow for automatic transformation of IFC schema andIFC models into an IFC Meta and object graph databases. The aim of this research is to study anddemonstrate the potential of using graph theory concepts and graph databases in order to manage,visualize and analyse the huge information and complex relationships of BIM models based onIFC standard. For the validation a set data retrieval queries and advanced model analysis for modeltopology analysis and comparison of different IFC models are carried out in order to demonstratethe flexibility and advantages of the suggested approach.1. IntroductionThe very fast development in the sector of information technology has been successfullyexploited in construction and engineering field to adopt new digital methods such as BuildingInformation Modelling (BIM) for construction project managing. However, BIM models maycontain a huge amount on information with complex relationships between the model entities.This information could remain inaccessible in several cases due to the use of closed propertyformats or the absent of suitable data management tools in case of using open standardformats like Industry Foundation Classes (IFC).A lot of data retrieval queries are hard to be accomplished using currently available software’sand most of them operate on single IFC models. The rigid and complex hierarchical structureof the IFC schema prevents simple manual extraction of building information and requiresdeep understanding of the IFC object model itself. The BIM query languages introduced sofar have certain limitations, particularly with respect to the high level of knowledge about theIFC object model and about data mapping mechanisms required by the user (Tauscher,Bargstädt, & Smarsly, 2016).Evidently, graphs have shown great capabilities in understanding and accessing complex andrich datasets in many different domains. Graph models are extremely useful for representationand description of the complex relationships among building elements and data within BIMs(Isaac, Sadeghpour, & Navon, 2013), hence converting of BIM models based on the IFCstandard into an effective information retrievable model based on graph databases couldsignificantly facilitate the efforts of exploring and analysing BIM highly connected data.A graph-based schema, termed the graph data model (GDM) was presented by (Khalili &Chua, 2015). This schema can be used to employ semantic information, to extract, analyse,and present the topological relationships among 3D objects in 3D space, and to performtopological queries faster. Another generic approach towards information retrieval using theIFC object model based on graph theory was presented recently by (Tauscher, Bargstädt, &Smarsly, 2016). In this approach a directed graph was generated that serve as semantic datapools facilitating generic queries. This approach is limited to apply queries on single IFCmodels.1

This paper presents a workflow for complete and automatic transformation of IFC modelsinto a labelled property graph-based model using the world leading graph database Neo4J 1 asa graph database framework.The proposed approach targets two kinds of graph models:-IFC Meta Graph (IMG) based on the IFC EXPRESS schema-IFC Objects Graph (IOG) based on STEP Physical File (SPF) format.Beside the automatic conversation of IFC models into graph database this paper aims todemonstrate the potential of using graph databases and concepts of graph theory in order to(1) explore, check and analyse the complex relationships inside one or multiple BIM models,(2) run complex queries for information retrieval and (3) carry out advanced analysis of thebuilding topology like escape route analysis and comparing of different IFC models.2. IFC data modelIFC is a data model developed by buildingSMART International to support the exchange ofbuilding information in Architecture, Engineering and Construction (AEC) industry toimprove collaboration, scheduling, cost and delivery time activities throughout the whole lifecycle of the building project. It provides an object-oriented and semantic data model forstoring and exchanging building information. This enables actors from different disciplines toeffectively use BIM data and to fully exchange information in construction or facilitymanagement projects. IFC schema is described using EXPRESS specification language thatdefined by ISO 10303-11, as conceptual information modelling language. The specificationspecified also a graphical representation known as EXPRESS-G to provide graphical subset.The IFC data schema can be saved as Extensible Markup Language (XML) file structure perISO10303-21 or STEP Physical file (SPF) document structure following ISO10303-28.Each IFC model is composed of IFC entities built up in a hierarchical order, where each IFCentity includes a fixed number of IFC attributes, plus any number of additional IFCproperties. The IFC attributes are the main identifiers of the entities, while the names of theseattributes are fixed, having been defined by buildingSMART (buildingSMART) as part of theIFC standard code. The IFC data schema has three fundamental entity types as shown inFigure 1. These entity types are the first level structure of the IfcRoot entities hierarchical.Figure 1: Fundamental entity types derived from IfcRoot class 1IfcPropertyDefinition describes all characteristics that may attach to objects. Thus,valuable information can be shared among multiple object instances. However, it mayexpress the occurrence information of the actual object in the project context, in casethat it is attached to a single object instance.www.neo4j.com2

IfcObjectDefinition stands for all handled objects or process. Where, all physicalitems and products such as roofs, windows, and slabs that can be touched and seen areclassified as IfcObjectDefinition.IfcRelationship summarizes all the relationships among objects. This can enable userssaving relationship specific properties directly at the relationship object and avoidduplication of relationship semantics from the object attributes. The abstractobjectified relationship IfcRelationship and its subtype relationships are responsiblefor connectivity among objects, in which several properties can be attached to eachrelationship.Figure 2 demonstrates the different types of objectified relationship within the IFC (Version2x3) and their abstract super type IfcRelationship.Figure 2: IFC abstract objectified relationshipIFC classes have direct attributes attached to them which could indicate a relationship toanother object or they could just be attached as simple data type attribute, e.g. integer, string,logical, or Boolean. Therefore, IFC models distinguish between the attributes that are directlyattached to object as entity attributes, and attributes that assigned to indicate a relationship toother objects. The second of two attributes are the most adopted approach to extend viableproperties. However, as it is depicted Figure 3, each IFC class could have simple dataattributes with referenced object attributes as in the case of the IfcRoot, or referenced object3

with relationship attributes as in the case of IfcProduct, or entity attributes and relationshipattributes together as in the case of IfcObject.Figure 3 IFC Entity attributes and relationship attributesIn addition to the direct attached attributes, the objects can inherit attributes from theirsupertype classes, where, property pair can be assigned to almost any type of objects and thusto support enlarging their attributes base.3. Graph data managementGraph theory is the branch of mathematics that dealing with the study of graphs (Hughes,2016). While the concept of graphs itself is defined by graph theory as a diagrammaticrepresentation of real-world scenarios in a form of points and lines (Wilson, 1996). The pointsare called vertices or nodes, while the lines that connect them are so-called edges, arcs orrelationships. Each vertex in the graph is represented by drawing a dot or a circle, while therelationship between each pair of vertices is indicated by drawing an arc or line if they areconnected by an edge.The application of graphs has become an important technique to describe several scenarios inthe real-world. One of the applications of graphs is to provide a simplified description ofscenarios datasets in a way that produce a useful understanding of a complicated data. Thishas led to the birth of a special form of graph model, the so-called labelled property graph(Robinson, Webber , & Eifrem, 2015 "Second Edition"). Labelled property graphs are similarto simple graphs; consist of nodes and relationships which are often expressed as vertices andedges. However, labeled property graphs provide additional characteristics to facilitate graphunderstanding, where, nodes could have a single or multiple labels; in addition, they couldhave properties (key-value pairs). Relationships can also be named and contain propertieswhile connecting each two nodes as start and end node.Several graph processing systems have been developed in the last decade to meet the moderngraph modelling and analysis tasks. Doekemeijer (Doekemeijer & Varbanescu, 2014- PDS2014-003) has declared that more than 80 systems have been introduced in the period from2004 to 2014, by academia and industry sectors together. However, the currently availablesystems can be divided into two main kinds, graph databases, and graph processing. In thissection and for the objectives of the present study, we will express the concepts of graphdatabase systems in general, with a focus on Neo4j graph database system particularly insome cases. However, all these efforts in the field of graph modelling express the importance4

of graphs for real-world scenarios. Angles (Angles & Gutierrez, February 2008 ) summarizedthe advantages of using graphs as modelling mechanism for data management as following:1. Graphs enable users to model data exactly as they are represented in the real-worldscenario, this can significantly enhance the operations on data. Thus, graphs can keepall the information about an object in a single node and display the related informationby relationships connected to it.2. Queries can be developed based on the graph structure. For instance, the finding of theshortest path can be considered as sub graph from the original graph.3. Operationally, graphs can be stored efficiently within databases using special graphstorage structures, and functional graph algorithms for application of specificoperations.4. Methodology and Transformation WorkflowThe proposed methodology introduces a workflow to develop and build IFC-based graphmodels using IFC EXPRESS schema and IFC models in STEP physical file format. In thisworkflow the whole transformation is automated and done through connected web services(dynamic EXPRESS parser, IFC web data server and web-based graph database importinterface) without the need for any local tools. The transformation supports any valid IFCschema.In our approach a single graph database is used to storage various IFC models at the sametime, where each node (object) will has a special attribute to identify the belonged model. Inthis way queries and advanced analysis are not limited to one IFC model. This feature allowsto do merging queries on different disciplines BIM models (architecture, structural design,MEP) of the same project, or to compare different versions of the same model over time.Figure 4: IFC to graph database conversation workflow4.1 IFC Meta Graph ModelThe workflow starts with analysing the IFC EXPRESS schema and developing a genericapproach to generate an IFC Meta Graph Model (IMG), which represents all IFC classes, theirattributes and the relationships between them (Figure 5).IMG model will be used later in order to generate and check the relationships between IFCinstance entities and validate IFC models. It can be also used to investigate changes betweendifferent IFC versions (e.g. IFC2X3 vs IFC4) or to run filters and information retrievalqueries for a better understanding of IFC schema and analyzing its complex data connectivity.5

Figure 5 Mapping IFC EXPRESS into a Meta Graph ModelThe mapping of IFC EXPRESS model into IMG is carried out through writing a specialserver script (in Ruby language) and run it on (Ismail, 2011) whichprovides a dynamic EXPRESS parser and web script console. This script generates a set ofCyber commands, which create the Meta graph inside Neo4j database, where Cypher is adeclarative, SQL-inspired language for describing patterns in graphs visually using an asciiart syntax.Figure 6 shows the scope of mapping for IFC classes, their attributes, data types and therelationships between classes. Both of IFC classes and the attributes are mapped into nodesand they are connected through various relationships like “has property” to connect a classnode with its direct attributes or “subtype of” to connect a class with its sub-classes.6

Figure 6 Mapping of classes, data types and relationships within IMG model4.2 IFC Object Graph modelThe next step in the workflow is to convert IFC models into IFC Object Graph (IOG). In thisgraph each IFC entity expect the relationships will be represented as a node and will holdinformation about the class of the entity and its basic attributes and will be connected to otherentities through named relationships.A special server script based on has been developed in order to automatethe process of extracting IFC data (objects, relationships) and creating all necessary Cyphercommands for the data import and also relationship generation. The script include someoptions to exclude certain IFC classes, for example all low level geometry classes.7

Figure 7 Creation of IFC Object GraphIFC data are extracted and saved at first in CSV format then imported into Neo4j to create thegraph-based models (Figure 7).The Cypher snippet bellow shows the import command for IfcBuilding.Load csv with headers from .ifc/IfcBuilding.csv' as line FIELDTERMINATOR ''Create (u: IfcBuilding {Model: line.Model, label: line.label, IFCID: line.IFCID,globalId: line.globalId, ownerHistory: line.ownerHistory, name:,description: line.description, objectType: line.objectType, objectPlacement:line.objectPlacement, representation: line.representation, longName:line.longName, compositionType: line.compositionType, elevationOfRefHeight:line.elevationOfRefHeight, elevationOfTerrain: line.elevationOfTerrain,buildingAddress: line.buildingAddress });After importing the IFC data and with help of the Meta graph model the relationships forreferenced, inversed and derived attributes will be created automatically. The scope ofrelationships transformation includes all IFC relationships, for example: (1) aggregation, (2)spatial and element composition, (3) spatial and element decomposition, (4) zone and groupassignment, (5) building system assignment, (6) spatial structure, (7) element and pathconnectivity and (8) element filling.The next step creates direct relationships between graph nodes and their connectedinformation and deletes all redundant relationship. For example the building element nodeswill be connected directly with their corresponding properties through RelDefinesByPropertiesandIfcRelDefinesByType can be deleted. As a result, the graph queries can be simplified bynormalizing the property sets and non-direct attributes of building elements to be assigned asdirect node attributes.A further step will be assigning each node in the graph with a set of labels of all its parentclasses and running a set of pre-defined queries for further classification and normalization ofthe building elements attributes according to their classes and property sets. For example all8

walls which have the property “Load bearing” set to true will be linked into a node “Loadbearing walls” through a relationship “is-load-bearing”.5. Validation and Case StudiesAfter converting IFC models into a graph database it can be used as an IFC data server to rundata retrieval queries and advanced analysis of BIM models taking in account the advantagesof applying graph theory concepts and algorithms like path finding and shortest path method.In the following sections we present some simple and advanced examples.5.1 Examples of Simple Queries-Retrieve the assigned property sets of a certain object: This query returns allpropery sets which are assigned to a ceartin object through its globalId cPropertySet)RETURN DISTINCT wall,rel,propertyFigure 8 getting the assigned PropertySets for a certain object-Filter objects based on material: This query returns a list of all doors and theirmaterial names. The connection between doors and material nodes is doneautomatically by the graph database engine (through IfcDoor–[*1.5]-IfcMaterialrelation command) without the need to know how both IfcDoor and IfcMaterial arerelated to each other in the IFC schema.MATCH ial:IfcMaterial)RETURN DISTINCT (material.IFCID)AS IFCID,( Material name9

-Create new relationships to assign objects to layers: This query creats therelationship “assignedItem” between defined layers in the model and theircoresponding elements.MATCH (n:IfcPresentationLayerAssignment{Model: "Office A.ifc"})UNWIND ""),",") as oMERGE (assignedItems {Model: "Office A.ifc",IFCID: replace(o,"#","")})MERGE (n)-[:assignedItems]- (assignedItems);Figure 9 Assign objects to layers5.2 Analysis of BIMs for Emergency RoutesIn this example we used the graph database to do a simplified topology analysis of BIMmodels in order to analyse and generate emergency routes. The construction of possibleescape paths is done in 2 steps:(1) Through the relationship “BoundedBy” between IfcSpace and IfcDoor entities(2) Through the relationship “RelatingSpace” between 2 IfcSpace neighbour objects.MATCH p :BoundedBy] (s:IfcSpace)RETURN pUNIONMATCH p -(d1:IfcDoor)-[r2:BoundedBy]-(s2:IfcSpace)WHERE s1.IFCID s2.IFCIDRETURN pUNIONMATCH p (s1:IfcSpace {Model:'Muster003.ifc'}) atingSpace]- (s2:IfcSpace)WHERE s1.IFCID s2.IFCID RETURN p10

Figure 10 Creation of escape routes through graph query5.3 Compare Different IFC ModelsThe following example compares 2 versions of IFC models for the same building and returns a list ofall windows which have been added in the second model.MATCH (W30 { Model: 'Week30.ifc' }),(W37 { Model: 'Week37.ifc' })WHERE W30.tag W37.tagWITH collect(distinct W30.tag) as tagsMATCH (new) WHERE new.tag "" AND NOT new.tag IN tagsAND new.label "IfcWindow"RETURN distinct new.label as Class, new.globalId, new.IFCID asSTEPID,, new.tag ORDER BY new.tagFigure 11 Compare IFC models using graph query11

6. Conclusions and Future WorkThis paper presented a workflow for automatic transformation of IFC schema and models intoa property graph database. The suggested approach have been applied on many IFCschema/models in order to explore the capabilities of the IFC-based graph models for dataquery and advanced analysis of the BIM models.The current scope of transformation and queries doesn’t take in account the geometryinformation or the process of creating geometry objects based on parameters or Booleanoperations. A future research is needed in order to include the geometry information to be apart of the pre-defined queries by developing an interface between the graph database and anIFC geometry engine.Future research could involve developing a user friendly web application for editing theinformation of graph database and developing an IFC export interface for sub-models ormerging models. The future work will include also developing special stored procedureswhich allow accessing the Java API of Neo4j directly and running the import and dataretrieval queries much faster compared with solely using of Cypher commands and followedwith a benchmark to compare the performance with other existing query approaches.Graph models can be considered a satisfactory tool to manage building information. However,writing user-defined queries for users without IFC and graph skills still quite challengingwhere advanced queries should be written by IFC and graph DB experts. This research can beconsidered as an initial step in the direction of IFC-based graph models formationmanagement.ReferencesAngles, R., & Gutierrez, C. (2008 ). Survey of Graph Database Models. ACM Computing Surveys, 40(1).Doekemeijer, N., & Varbanescu, A. (2014). A Survey of Parallel Graph Processing Frameworks. Delft: Paralleland Distributed Systems Group- Delft University of Technology.Hughes, J. (2016). ECE 3020 Mathematical Foundations of Computer Engineering. Atlanta: Lecture notes fromGeorgia Institute of Technology.Isaac, S., Sadeghpour, F., & Navon, R. (2013). Analyzing Building Information using Graph Theory.International Association for Automation and Robotics in Construction (IAARC)- 30th ISARC, (S. 1013-1020).Montreal.Ismail, A. (2011). IFCWebServer. IFC Data model server and online viewer: http://ifcwebserver.orgKhalili, A., & Chua, D. (2015). IFC-Based Graph Data Model for Topological Queries on Building Elements .American Society of Civil Engineers, Vol.29 Issue3.Robinson, I., Webber , J., & Eifrem, E. (2015). Graph Databases. Sebastopol: O’Reilly Media.Tauscher, E., Bargstädt, H.-J., & Smarsly, K. (2016). Generic BIM queries based on the IFC object model usinggraph theory. The 16th International Conference on Computing in Civil and Building Engineering. Osaka,Japan.Wilson, R. (1996). Introduction to Graph Theory (Fourth edition Ausg.). Harlow- England: Longman Group Ltd.12

Application of graph databases and graph theory concepts for advanced analysing of BIM models based on IFC standard Ali Ismail, Ahmed Nahar, Raimar Scherer TU Dresden, Germany [email protected] Abstract. In this paper we present a workflow for automatic transformation of IFC schema and IFC models into