# Ontology-Based Representation and Reasoning in Building Construction Cost Estimation in China
## 4 Implementation of the Building Construction Cost Estimation Ontology  
### Software Environment  
The construction of the cost estimation ontology is implemented by the ontology editor. This research uses Protege, a free and open-source platform that enables the development of  
Figure 8: Overall framework for the automated reasoning of cost estimation.  
domain models and knowledge-based applications with ontologies [55], to build the ontology [55; 56]. The Protege 3.4.8 (Protege, hereafter), proposed by Stanford University, provides the environment for creating, editing, saving, and using ontologies. It is convenient to build the class and subclass to specify the class, its hierarchy, and semantic relationships.  
The implementation of reasoning rules of this research has been realized by SWRL rules, which are a plug-in tag in Protege 3.4.8. All related semantic rules are defined by the SWRL rules plugin. However, SWRL is a language that is independent of any inference engine and, hence, cannot be used directly without inference tools. OWL and SWRL need to be translated into a rule language that can be inferred. In this research, the reasoning process is conducted through the Jess rule engine. Jess (Java Expert Shell System) is used in Protege as an inference engine, and it consists of a fact base and a rule base [57]. Jess's reasoning is based on a list of known facts and a set of rules that are used to match these facts in the knowledge base [50]. Jess is currently the most mature SWRL engine, has been implemented in many knowledge-based systems, and is capable of dealing with reasoning rules that are written by SWRL. Jess can be embedded into Java applications and provides a flexible mutual runtime communication between Jess rules and Java. The reasoning is carried out in the Jess inference engine by matching facts with the rules in the rule base, as the extensions to Protege, SWRLJessTab, and JessTab are successful implementations of Jess through SWRLJessBridge.  
Based on the defined classes and properties, Protege automatically generates a graphical user interface (GUI), as shown in Figure 9.  
In this research, the Jess rule engine converts the combination of OWL and SWRL into Jess facts. Because a Jess interpreter can only interpret Jess code, the RDF and OWL formats need to be transformed into Jess code. The proposed XSLT-based transformers, i.e., OWL2 Jess and SWRL2 Jess, can satisfy the integration of heterogeneous information among OWL, SWRL, and Jess. The flowchart of cost estimation inference is shown in Figure 10, the source language is shown at the top of each arrow, and the target language is shown at the bottom of each arrow. First, after the cost estimation knowledge is extracted, the hierarchy of cost concepts is defined according to, e.g., the Chinese national mandatory specification, the classification standard from CSI. The cost estimation model, including  
Figure 9: Graphical user interface of Protege.  
the concept model ontology, work item ontology, and construction condition ontology, is determined, and the related concepts and their relationships are built. Second, the above-listed ontologies are all expressed by OWL/RDF, and the reasoning rules among different hierarchies are encoded in SWRL. Third, OWL and SWRL-based knowledge is transformed into facts and rules that are expressed in the rule language of Jess. Thus, the knowledge about cost estimation can be deduced automatically by Jess.