Integration of Rules and Ontologies
The layered structure of the Semantic Web (see http://www.w3.org/2007/03/layerCake.png) adopted by the World Wide Web Consortium W3C includes, among others, the Ontology layer with the web ontology language OWL and the rule layer with the emerging Rule Interchange Format (RIF) http://www.w3.org/TR/rif-fld/ which allows rules to be translated between rule languages. The integration of rules and ontologies aims at developing techniques for interoperability between rules and ontologies in the Semantic Web. This is necessary for rule-based applications to access existing domain ontologies. In most of the proposals the integration is achieved by defining and implementing a new language which is a common extension of a given rule language and a given ontology language, enhancing the expressive power of each of the components. Alternatively, the integration of rules and ontologies may be achieved by designing from scratch one language sufficiently expressive to define both rules and ontologies as well as their combinations.
In the initial phase of the Semantic Web research a significant effort was devoted to defining a language for ontology modeling. In 2004, it resulted in OWL, a family of three ontology languages OWL Lite, OWL DL, and OWL Full, based on Description Logics (DL). Each of them is a subset of the next one. The first two are syntactic variants of expressive description logics with semantics given by translation to formulae of first-order logic with equality. OWL DL (hence also its subsets) is supported by several reasoners. The original intention was to define OWL as a layer on top of RDF Schema which itself can be seen as ontology language. OWL Full, designed to achieve this goal, has a non-standard semantics and is difficult to implement. On the other hand, OWL DL includes a substantial subset of RDF Schema, which is extensively used in ontology definitions.
The importance of rules for web applications is reflected by the rule layer in the Semantic Web architecture. The rules formalisms considered for this layer offer modeling primitives not expressible in OWL. Their integration with OWL would thus enhance the expressive power of the latter.
In contrast to the ontology layer, no standard has been proposed yet for the rule layer. The rule languages proposed for the Semantic Web originate mainly from logic programming (see e.g., ). In contrast to OWL DL, they usually adopt the closed world assumption. This means that if a fact cannot be derived from a knowledge base it is concluded to be false. In logic programming, the closed world assumption is implemented by the negation-as-failure rule which returns ¬p on failure to prove a fact p. This is an example of non-monotonic reasoning, not allowed in FOL.
Designing rules languages for the Semantic Web is among the objectives of the RuleML initiative (http://www.ruleml.org/). The W3C RIF Working Group is developing a core rule language as a basis for rule interchange (for more details see http://www.w3.org/2005/rules/wiki/RIF_Working_Group).
Shortcomings of OWL
The following examples show why OWL is not sufficient for some applications and motivate its extensions. OWL Ontologies include classes (e.g., Person, Woman, Man) which are unary predicates and properties (e.g., ParentOf, SisterOf) which are binary predicates, but predicates of arity larger than two are not allowed. In OWL it is not possible to formalize the statement an aunt of a person is a sister of a parent of that person. Also, the semantics of OWL does not allow to conclude that Mary is not a sister of John if the assertion SisterOf(john,mary) is not a logical consequence of the ontology. This kind of reasoning based on closed world assumption is useful in some applications. Most of the rule languages proposed for the Semantic Web do not share these shortcomings.
Rule Languages for Integration
The rule languages considered in integration proposals are usually extensions of Datalog. Generally rules have a form of “if” statements, where the predecessor, called the body of the rule, is a Boolean condition and the successor, called the head, specifies a conclusion to be drawn if the condition is satisfied.
In Datalog the condition of a rule is a conjunction of zero or more atomic formulae of the form p(t1, ..., t n ) where p is an n-ary predicate symbol and t1, ..., t n are constant symbols or variables. Hence they are a restricted kind of FOL terms (see First order logic: syntax).
- Datalog with negation, where the body may additionally include negation-as-failure (NAF) literals of the form not a where a is an atom. Intuitively a NAF literal not a is considered true if it does not follow from the program that a is true. For example, happy(john) can be concluded from the rulebase:
happy(X) ← healthy(X), not hungry(X)
Two commonly accepted formalizations of this intuition are: the well-founded semantics and the stable model semantics (see the survey ). The well-founded semantics  associates with a rulebase a unique (three-valued) Herbrand model, where each ground atom is assigned one of three logical values true, false or unknown. The stable model semantics  (called also the answer set semantics) associates with each rulebase some (possibly zero) two-valued Herbrand models. For a large class of programs relevant in practice (so called stratified programs, see e.g., ) both semantics coincide.
- Extended Datalog. This extension (see e.g., extended logic programs in ) makes it possible to state explicitly negative knowledge. This is achieved by allowing negative literals of the form ¬p, where ¬ is called the strong negation connective, in the heads of rules as well as in the bodies. For example, the rule
¬healthy(X) ← hasFever(X)
allows to draw an explicit negative conclusion. In addition, NAF literals are also allowed in the bodies.
- Rulebases with priorities. Datalog rulebases employing strong negation may be inconsistent, i.e., may allow to draw contradictory conclusions. For example, the rules
fly(X) ← bird (X)
bird(Y) ← penguin(Y)
⌐fly(X) ← penguin(X)
allow to conclude fly(tweety) and ⌐fly(tweety). In Defeasible Logic  and in Courteous Logic Programs  a priority relation on rules can be specified for a rulebase. The contradictions in the derived conclusions are then resolved by means of the defined priorities.
- Disjunctive Datalog  (see also disjunctive logic programs in ) admits disjunction of atoms in the rule heads, and conjunction of atoms and NAF literals in the bodies, e.g.,
male(X) ∨ female(X) ← person(X)
A commonly used semantics of Disjunctive Datalog rulebases is an extension of the answer set semantics.
The rule languages are supported by implementations which make it possible to query and/or to construct the models of rulebases.
Approaches to Integration
- Homogeneous Integration. The integrated language makes no distinction between the rule predicates and the ontology predicates. It includes the original rule language and the original ontology language as sublanguages. The integration is to be faithful in the sense that the sublanguages should have the same semantics as the respective original languages. The homogeneous integration is difficult to achieve since ontology languages are usually based on FOL and rule languages have different kind of semantics. Examples of the homogeneous integration include:
DLP (Description Logic Programs) , which is a language obtained by intersection of a Description Logic with Datalog rules interpreted as FOL implications. DLP has a limited expressive power, but a DLP ontology can be compiled into rules and easily integrated into a rulebase of a more expressive rule language. For example Sweet Ruleshttp://sweetrules.projects.semwebcentral.org/ combine DLP and Datalog with strong negation and priorities. The technique of compiling ontologies to rules is also used in DR-Prolog  based on Defeasible Logic.
F-logic, extending classical predicate calculus with the concepts of objects, classes, and types. It is expressive enough to represent ontologies, rules and their combinations .
SWRL (Semantic Web Rule Language)http://www.w3.org/Submission/SWRL/, extending OWL DL with rules interpreted as FOL implications. Thus, SWRL is based on FOL and does not offer non-monotonic features, such as negation-as-failure. A so-called DL-safe subset  of SWRL is supported by KAON2 system http://kaon2.semanticweb.org which also offers a support for a restricted subset of F-logic.
Hybrid MKNF Knowledge Bases , taking a modal logic as a basis of faithful integration of Description Logic with Disjunctive Datalog under the answer set semantics. A variant of this approach considering nondisjunctive hybrid MKNF knowledge bases under well-founded semantics is presented in .
Quantified Equilibrium Logic, considered in  as a unified framework which embraces classical logic as well as disjunctive logic programs, thus providing a foundation for the integration of rules and ontologies.
Heterogeneous Integration. In this approach, the distinction between the rule predicates and the ontology predicates is preserved in the integrated language. The integration of rules and ontologies is achieved by allowing the ontology predicates in the rules of the integrated language. Assume, for example, that an ontology classifies courses as project courses and lecture courses.
student(X) ← enrolled(X,Y), Lecture(Y)
student(X) ← enrolled(X,Y), Project(Y)
In addition the rulebase includes enrollment facts, e.g., enrolled(joe, cs32). The extended language allows thus to define ontologies using the constructs of the ontology language and the rulebases with rules referring to the ontologies. An extended rulebase together with an ontology is called a hybrid knowledge base. In the heterogeneous approaches implementations are often based on hybrid reasoning principle, where a reasoner of the ontology language is interfaced with a reasoner of the rule language to reason in the integrated language.
- 1.Loose coupling. In this approach the semantics of hybrid knowledge bases is based on a transformation which eliminates ontology queries from ground extended rules by querying the underlying ontology. A ground set of extended rules is thus reduced to a set of rules without ontology predicates in the following way. If the answer to a ground ontology query in a rule body is positive, the query is removed from the rule, otherwise the rule is removed from the set. The loose coupling approach applied to the example above does not allow to conclude that Joe is a student. This is because neither Lecture(cs32) nor Project(cs32) can be derived from the ontology. Examples of loose coupling include:
dl-programs , combining (disjunctive) Datalog with negation under the answer set semantics with OWL DL. So called DL-queries, querying the ontology, are allowed in rule bodies. They may also refer to a variant of the ontology, where the set of its assertions is modified by the DL-query. This enables bi-directional flow of information between rules and ontologies. A variant of the language based on the well-founded semantics is presented in .
TRIPLE , a rule language with the syntax inspired by F-logic. It admits queries to the ontology in rule bodies.
SWI Prologhttp://www.swi-prolog.org/, a logic programming system with a Semantic Web library which makes it possible to invoke RDF Schema and OWL reasoners from Prolog programs.
Tight integration. In this approach the semantics of hybrid knowledge bases is defined by combining the model-theoretic semantics of the original rule language with the FOL semantics of the ontology language. For example, tight integration of Datalog (without negation) with a Description Logic can be achieved within FOL by interpreting Datalog rules as FOL implications. In this semantics student(joe) is a logical consequence of the example hybrid knowledge base. As Course(cs32) is an assertion of the ontology, it follows by the axiom Project ⊔ Lecture = Course that in any FOL model of the ontology Project(cs32) or Lecture(cs32) is true. As enrolled(joe, cs32) is true in every model, so the premises of at least one of the implications
student(joe) ← enrolled(joe, cs32),Lecture(cs32)
student(joe) ← enrolled(joe, cs32),Project(cs32)must be true in any model. Hence student(joe) is concluded. Examples of tight integration include:
CARIN , a classical work on integrating Datalog with a family of Description Logics under the FOL semantics.
DL + log , integrating Disjunctive Datalog under the answer set semantics with OWL DL. For each FOL model of the ontology the rules of the knowledge base are reduced to rules of Disjunctive Datalog, with stable models defined by the answer set semantics.
Hybrid Rules , integrating logic programs under well-founded semantics with OWL. For each FOL model of the ontology the rules of the knowledge base are reduced to a logic program with the model defined by the well-founded semantics.
The theoretical foundations developed by studying integration of ontologies with variants of Datalog provide a basis for further extensions. This includes dealing with uncertain and inconsistent knowledge, and using integrated Datalog-based languages as condition languages for ECA-Rules.
The integration of rules and ontologies is a relatively new research topic, focused so far on developing tools and prototypes. Key applications include semantic data integration, ontology-based web search and semantic recommendation systems. Industrial applications of this kind are discussed in the video lecture . The Ontobroker system referred therein is based on F-logic. Another field of potential key applications is e-business as discussed in the tutorial video , with focus on Sweet Rules.
URL to Code
A prototype implementation of dl-programs (NLP-DL) can be accessed at http://con.fusion.at/nlpdl/.
- 3.de Bruijn J, Pearce D, Polleres A, Valverde A. Quantified equilibrium logic and hybrid rules. In: Proceedings of the 1st international conferences on Web reasoning and rule systems. 2007. p. 58–72.Google Scholar
- 4.Drabent W, Małuszyński J, Well-founded semantics for hybrid rules. In: Proceedings of the 1st international conferences on Web reasoning and rule systems. 2007. pp. 1–15.Google Scholar
- 6.Eiter T, Lukasiewicz T, Schindlauer R, Tompits H. Combining answer set programming with description logics for the semantic web. In: Proceeding of the 9th international conferences principles of knowledge representation and reasoning. 2004. p. 141–51.Google Scholar
- 7.Eiter T, Lukasiewicz T, Schindlauer R, Tompits H. Well-founded semantics for description logic programs in the semantic web. In: Proceedings of the 3rd international workshop on rules and rule markup languages for the semantic Web. 2004. p. 81–97.Google Scholar
- 8.Erdmann M. Semantic web applications. 2007, first Asian Autumn School on Semantic Web, Tutorial video at: http://rease.semanticweb.org/ubp/.
- 9.Gelfond M, Lifschitz V. The stable model semantics for logic programming. In: Proceedings of the 5th international conferences logic programming. 1988. p. 1070–80.Google Scholar
- 10.Grosof BN. Prioritized conflict handling for logic programs. In: Proceeding 14th international conferences logic programming. 1997. p. 197–211.Google Scholar
- 11.Grosof B. Semantic web rules with ontologies, and their e-Services applications. 2006, iSWC06 tutorial video at: http://videolectures.net/iswc06_grosof_swrot/.
- 12.Grosof B, Horrocks I, Volz R, Decker S. Description logic programs: combining logic programs with description logic. In: Proceedings of the 12th internaltional World Wide Web conference. 2003. p. 48–57.Google Scholar
- 13.Kifer M. In: Eisinger N, Małuszyński J, editors. Rules and ontologies in F-logic, vol. 3564. Berlin: Reasoning Web, LCNS; 2005. p. 22–34.Google Scholar
- 14.Knorr M, Alferes JJ, Hitzler P. A well-founded semantics for hybrid MKNF knowledge bases. In: Proceeding of the 20th international workshop on description logics. 2007. p. 347–54.Google Scholar
- 16.Motik B. and Rosati R. A faithful integration of description logics with logic programming. In: Proceeding of the 20th international joint conferences on AI. 2007, p. 477–82.Google Scholar
- 18.Nilsson U, Małuszyński J. Logic, Programming and Prolog. 2nd ed. New York: Wiley. 1995, now available free of charge at: http://www.ida.liu.se/ ulfni/lpp/
- 19.Nute D. Defeasible logic. In: Handbook of logic in artificial intelligence and logic programming, vol. 3. Oxford: Oxford University Press; 1994. p. 353–95.Google Scholar
- 20.Rosati R. DL+log: tight integration of description logics and disjunctive datalog. In: Proceeding of the 10th international conferences principles of knowledge representation and reasoning. p. 68–78.Google Scholar
- 21.Sintek M, Decker S. TRIPLE – a query, inference, and transformation language for the semantic web. 2002. p. 364–378Google Scholar
- 22.Gelder A, van Ross KA, Schlipf JS. Unfounded sets and well-founded semantics for general logic programs. In: Proceeding of the 7th ACM SIGACT-SIGMOD-SIGART symposium on principles of database systems. 1988. p. 221–30.Google Scholar