# An Approach of Automatic SPARQL Generation for BIM Data Extraction
## 2 Related Work
### Semantic BIM Data Extraction  
Some BIM models come from BIM design software; however, this kind of software cannot store data in the RDF data format. Thus, converting the EXPRESS schema (used in IFC) into the ifcOWL schema became a required step for the semantic processing of BIM data. BuildingSMART provides some tools to implement this: the buildingSMART IfcDoc tool ([[https://github.com/buildingSMART/IfcDoc](https://github.com/buildingSMART/IfcDoc)]([https://github.com/buildingSMART/IfcDoc](https://github.com/buildingSMART/IfcDoc))) the UGent--Aalto IFC-to-RDF converter ([[https://github.com/pipauwel/IFCtoRDF](https://github.com/pipauwel/IFCtoRDF)]([https://github.com/pipauwel/IFCtoRDF](https://github.com/pipauwel/IFCtoRDF))), and the [PERSON] EXPRESS-to-OWL converter ([[http://www.terkaj.com/tools/ExpressToOwl/ExpressToOwl.zip](http://www.terkaj.com/tools/ExpressToOwl/ExpressToOwl.zip)]([http://www.terkaj.com/tools/ExpressToOwl/ExpressToOwl.zip](http://www.terkaj.com/tools/ExpressToOwl/ExpressToOwl.zip))). Certainly, there have been some other efforts for this kind of conversion [22; 31; 32; 33]. These tools and research have accelerated the application and development of semantic web technology in AEC industry [20; 24; 34]. [PERSON] et al. [35] introduced a new approach that included ontology-based feature modeling, automatic feature extraction (using XQuery query predicates), and query formulation and processing (using a feature-based model and formal query specifications) to quickly extract the construction-specific information from a given BIM model. [PERSON] et al. [36] designed an approach of ontology-based partial BIM model extraction, in which a partial model extraction algorithm was achieved through Java. More commonly, semantic BIM data are generally extracted through SPARQL or SWRL query codes. For example, a shared ontology approach was developed to improve the finding and integration of building information distributed in different knowledge bases, while SPARQL was used to search for information from knowledge bases [37]. [PERSON] et al. [38] applied RDF(S) sub-graph retrieval for a partial building view extraction and generated a graph pattern matching the query with SPARQL. [PERSON] et al. [25] utilized SWRL to extract building data from semantic BIM data to create building model views. However, due to the complexity of the IFC schema, many queries and analysis tasks are still laborious when using SPARQL in AEC industry, and many required properties and relationships, such as product geometry quantities, spatial and topological relations, etc., are difficult to retrieve [19]. To solve these issues, [PERSON] et al. [19] developed SPARQL extensions for querying ifcOWL building data, called BimSPARQL. In BimSPARQL, some new RDF vocabularies that can be used in SPARQL queries were designed through a set of extension functions, and a module for geometry-related functions was implemented to derive implicit BIM information [19]. Additionally, [PERSON] et al. [39] proposed an ontology-based semantic approach to extract construction-oriented quantity take-off (QTO) information for the purpose of construction operation planning and to allow the use of the building product ontology formalized from construction perspectives to semantically query (SPARQL query) the needed QTO data in the BIM model. As a method of data extraction, the SPARQL query language is also usually applied to the quality and regulatory checking of BIM models [40]. For example, a system based on the Semantics of Business Vocabulary and Business Rules (SBVR) and SPARQL was proposed to formalize the regulations [41]. This kind of regulation-checking application adopts SPARQL query programs as the representation of different regulations, and then executes these SPARQL codes on the semantic BIM model to implement regulations checking. This process is similar to BIM data extraction. The SPARQL filter conditions of data extraction can be viewed as detailed regulations in rule compliance checking.