Rule-based Query Answering and Reasoning framework (RuQAR)




About⇑ top

Rule-based Query Answering and Reasoning framework (RuQAR) provides the ABox reasoning and query answering with OWL 2 RL ontologies executed by forward chaining rule reasoners. The tool implements a method of transforming OWL 2 ontologies into a set of rules and a set of facts expressed in the Abstract Syntax of Rules and Facts (ASRF). The tool is developed in Java and allows to perform ABox reasoning with two state-of-the-art rule engines: Jess and Drools. RuQAR is implemented as a library which can be included in applications requiring efficient ABox reasoning.

Ontology Transformation Schema⇑ top

The transformation schema of an OWL 2 ontology into a set of rules and a set of facts expressed in ASRF is presented in Figure 1. Firstly, an OWL 2 ontology is loaded into the HermiT engine. We assume, that the ontology is consistent. Then, the TBox reasoning is executed. As a result we obtain a new classified version of the ontology (new TBox). Finally, the ontology is transformed into two sets: a set of rules and a set of facts (if it contains the assertional part). Both are expressed in the ASRF notation. In that way we separate the TBox part (set of rules) from the ABox part (set of facts). Thus, we can perform ABox reasoning with a forward chaining rule engine.


Figure 1. OWL 2 ontology transformation schema.

The transformation of an inferred TBox into a set of rules is performed in accordance with the OWL 2 RL/RDF rules. Currently supported rules are presented in Table 1.

Table 1. Currently supported OWL 2 RL/RDF entailment rules.

Abstract Syntax of Rules and Facts⇑ top

We applied the Extended Backus-Naur Form (EBNF) notation as a technique to express our Abstract Syntax of Rules and Facts. This context-free grammar is presented in Figure 2. Non-terminal symbols are inside brackets ("<" and ">") while other symbols are the terminal ones. The ASRF syntax is a first-order logic-based notation. Each fact is an atom which consists of a set of terms. Each term is a variable (preceded by '?') or a constant. Furthermore, each term is one of the following types: Subject, Predicate, Object or Argument. Similarly, each atom is one of the following types: Triple or Comparison (<, >, etc.). Each rule consists of the body B (IF part) and the head H (THEN part) of a rule (B → H). Both elements contain atoms. Variables are universally quantified. Moreover, we can use additional operators like 'or' statement to express disjunction (only in the body of a rule) which is in accordance with the OWL 2 RL Profile. Both the body and the head can contain constants and/or variables in their atoms. In contrast, it is not allowed in the facts representation. By allowing to use comparisons we support SWRL Built-ins that can be employed in order to compare values. The default meaning of the head of each rule is to assert (infer) new triple (fact). In order for a rule to be applied, all the conditional elements that occur in the body must hold.


Figure 2. The ASRF syntax in EBNF.

Our ASRF syntax is similar to the syntaxes of well-known rule languages like Jess or Clips. However, it is less powerful and is limited to expressions available in the OWL 2 RL Profile. For instance, we can not infer about inconsistencies in a knowledge base.

Current State of the RuQAR's Evaluation⇑ top

We evaluated RuQAR using test ontologies taken from the KAON2 website: Vicodi - an ontology about European history, Semintec - an ontology about financial domain and LUBM - an ontology benchmark about organizational structures of universities. We used different datasets of each ontology (Semintec_0, Semintec_1, etc.) where the higher number means bigger ABox set. Our tests were performed on a Windows 7 desktop machine with Java 1.7 update 25 while the maximum heap space was set to 1GB.
Evaluation schema for each ontology was the following. Firstly, we performed the TBox reasoning using HermiT. Then, an inferred ontology was loaded into each tested engine and the ABox reasoning was executed. In each case we recorded the reasoning time and counted size of the resulting ABox. We performed the ABox reasoning with the following engines: Jess, Drools, HermiT and Pellet. We verified that the reasoners produced identical results. However, HermiT and Pellet provided more reasoning results in the LUBM case. It is correct, since only Vicodi is within the OWL 2 RL Profile. Nevertheless, all results inferred by Jess and Drools were among the results produced by HermiT/Pellet. Generally, we obtained better performance in the ABox reasoning with Jess/Drools than with HermiT or Pellet. As we can see in Figure 3 Jess and Drools performed better than other engines. However, in the Vicodi case Pellet was on the second place. The reason for that is that Vicodi contains large number of classes - which means that the reasoning produces many new triples. Drools performs slower than Jess in creating new triples (or checking if a triple exists in the working memory) since it uses pure Java classes (while Jess uses its own classes). Nevertheless, obtained results confirm that RuQAR increases the performance of the ABox reasoning in comparison to the DL-based reasoners.


Figure 3. ABox reasoning times with tested ontologies.


Table 2 presents the details about the ABox reasoning. Column ABox denotes the number of triples in the assertional part of an ontology before the reasoning. Column Jess/Drools shows the ABox size after the reasoning while column Fired rules presents the number of rules that were fired. Numbers in these two columns were identical in both engines. Last column HermiT/Pellet provides information about the ABox size after performing reasoning with HermiT and Pellet. In all tests (except LUBM) produced sets of triples were exactly the same.

Table 2. Sizes of ABox-es before and after the reasoning.

Download⇑ top

RuQAR is available with examples and detailed documentation about RuQAR's API. You can dowload the following: RuQAR tool, examples, and JavaDoc documentation. However, you are welcome to browse JavaDoc online.
Remember, that you need to download the HermiT reasoner, Drools Expert and Jess rule engines in order to take all advantages of RuQAR.


Articles about RuQAR⇑ top

  1. Bąk J., Nowak M., Jędrzejek C., Wnioskowanie regułowe z ontologiami OWL 2 RL, Studia Informatica Volume 35, Number 2 (116), Number 2 (116), pp. 111-125, Silesian University of Technology Press Gliwice 2014. In Polish
  2. Bak J., Nowak M., Jędrzejek C., RuQAR : Reasoning Framework for OWL 2 RL Ontologies, ESWC 2014, to be published In English
  3. Bak J., Jędrzejek C., Rule-based Reasoning System for OWL 2 RL Ontologies, Computational Collective Intelligence. Technologies and Applications, Lecture Notes in Computer Science Volume 8733, 2014, pp 404-413 In English

Last update: 24 August 2014