RuleML Use Case WineOnto
The Wine Ontology

Monika Machunik, Harold Boley, Meng Luan

Version History, 2010-12-28: First Version-Version 0.1 Version History, 2011-01-15: Second Version

Version History, 2015-04-04: Current Version


The well-known Wine Ontology is made available as a sizeable RuleML Use Case in Web rule conversion, upgrading, and normalization.

The WineOnto is a use case of RuleML knowledge bases generated from a non-XML source. Wine Ontology is a publicly available, complex ontology, which was used in OpenRuleBench as a benchmark data set for testing reasoning engines. OpenRuleBench is an open benchmarking project for rule engines. The Wine Ontology contains information about wines - their names, origin and type.

Contents

Overview

The Wine Ontology (WineOnto) use case is the result of generating RuleML 1.0 from data stored in Prolog files. These files can be accessed from pages of SemWebCentral, a portal with open source tools for the Semantic Web. These files are also linked from OpenRuleBench web page. The Wine Ontology data is stored in two main files, one containing data/facts (can be found here), and the other containing rules (can be found here).

WineOnto is realized in five steps, where the last step is optional. Firstly, the Prolog source is converted into POSL format, by using the Prolog-POSL Converter. Next, the POSL version is converted into RuleML 0.91 format, in one of the two alternative ways. One way is converting from POSL to RuleML 0.89 format by using the OO jDREW POSL-RuleML Translator Application (linked from here), and then manually modifying the resulting RuleML 0.89 file to make it valid against RuleML 0.91 schema. The other, shorter way, is converting the POSL files straight to RuleML 0.91 format, by using the OO jDREW Version 0.93 POSL-RuleML Translator Application (linked from here). As a next step, the ontology data is converted from RuleML 0.91 to RuleML 1.0 format by using the XSLT-based RuleML 0.91-1.0 Upgrader. Next, the RuleML 1.01 version is obtained by converting RuleML 1.0 format to implicit-closure-free form. At this step the RuleML 1.01 version is also translated into the TPTP format by using the RuleML2TPTP translator. Finally, the RuleML 1.0 files can be normalized, by using the XSLT-based RuleML 1.0 Normalizer.

Once more direct tools are available, the above desribed migration path of the Wine Ontology could be simplified and shortened even more. For example, data stored in POSL format could be translated straight to RuleML 1.0 format. Also upgrading from RuleML 0.89 to RuleML 0.91 could be done automatically, once a XSLT-based 0.89-0.91 Upgrader is available.

The RuleML 1.0 result was then used in the Java-based RuleML implementation of Object-Oriented jDREW to test Wine Ontology queries. The examples of queries are presented at the bottom of this document.

Step 1: Prolog -> POSL Conversion

This step was performed using the Prolog-POSL Converter. The original Prolog files, as well as their corresponding POSL files, are presented below:

Original Documents:

Converted Documents:

Step 2: POSL -> RuleML 0.91 Conversion - alternative 1 (POSL -> RuleML 0.89 -> RuleML 0.91)

By using the OO jDREW POSL-RuleML Translator Application the POSL files were converted to RuleML 0.89 format. Additionally, because the translator does not include XSL Schema information, the following attributes were manually added to the root Assert XML element:

         
    <Assert
      xmlns="http://www.ruleml.org/0.89/xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.ruleml.org/0.89/xsd http://www.ruleml.org/0.89/xsd/datalog.xsd">
      
The POSL files and their corresponding RuleML 0.89 files are shown below:

Input Documents:

Converted Documents:

Next, a conversion from RuleML 0.89 to RuleML 0.91 was needed. Because of current lack of a XSLT-based RuleML 0.89-0.91 Upgrader, the RuleML 0.89 -> RuleML 0.91 conversion had to be performed manually. Only one modification was required, though:

The RuleML 0.89 and their corresponding RuleML 0.91 files can be viewed here:

Input Documents:

Converted Documents:

Step 2: POSL -> RuleML 0.91 Conversion - alternative 2 (POSL -> RuleML 0.91)

By using the OO jDREW Version 0.93 POSL-RuleML Translator Application the POSL files could be converted straight to RuleML 0.91 format. Additionally, because the translator does not include XSL Schema information, the following attributes should be manually added to the root Assert XML element:

         
    <Assert
      xmlns="http://www.ruleml.org/0.91/xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.ruleml.org/0.91/xsd http://www.ruleml.org/0.91/xsd/datalog.xsd">
      

The POSL files and their corresponding RuleML 0.91 files can be viewed here:

Input Documents:

Converted Documents:

Step 3: RuleML 0.91 - RuleML 1.0 Conversion

The conversion from RuleML 0.91 to RuleML 1.0 was done by using the XSLT-Based RuleML 0.91-1.0 Upgrader and inserting the root element <RuleML> manually (namespace declarations and the schema location are also moved to this root element). The RuleML 0.91 and their corresponding RuleML 1.0 files are presented below:

Input Documents:

Converted Documents:

Step 4: RuleML 1.0 - RuleML 1.01 Conversion

RuleML 1.01 is backward compatible with Version 1.0. Therefore, no upgrade is actually needed. However, a utility XSLT convertor specifically composed for this use case is applied to obtain the implicit-closure-free form (the schema location for Version 1.0 is removed by this utility tool, and the schema location for Version 1.01 is added manually). The result RuleML 1.01 documents without the closure attribute can then be tranlated into the TPTP language by using the RuleML2TPTP translator. The RuleML 1.0, RuleML 1.01 and their corresponding TPTP files are presented below:

Input Documents:

Converted Documents:

TPTP Documents:

Step 5: Stripe-Skipped - Fully-Striped RuleML 1.01 Normalization (Optional)

The last, optional step, consists of normalizing the RuleML 1.01 files. The normalized version has all skipped role tags reconstructed to a fully-expanded, normal form. This conversion was performed using the XSLT-Based RuleML 1.01 Normalizer. The original, stripe-skipped RuleML 1.01 files and their corresponding normalized RuleML 1.01 files are presented below:

Input Documents:

Final Documents:

OO jDREW Query Examples

The RuleML facts and rules can be executed with the OO jDREW Engine. Please note that at the time of this writing, OO jDREW is supporting the POSL, RuleML 0.89, and RuleML 0.91 formats only. However, the above Wine Ontology is already an early use case for RuleML 1.0.

Below, examples of queries with reasonable run times are presented, along with their description and results:

Examples of own rules added on top of WineOnto

New user-defined rules can be added to the exisiting Wine Ontology. Below a rule defining European wine together with corresponding query, its description and results are presented:


Site Contact: Harold Boley. Page Version: 2011-04-04


"Practice what you preach": XML source of this homepage at index.xml;
transformed to HTML via the adaptation of Michael Sintek's SliML XSLTstylesheet at homepage.xsl(View | Page Source)