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.
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 four 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. 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.
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:
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:
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:
The conversion from RuleML 0.91 to RuleML 1.0 was done by using the XSLT-Based RuleML 0.91-1.0 Upgrader. The RuleML 0.91 and their corresponding RuleML 1.0 files are presented below:
Input Documents:
Converted Documents:
The last, optional step, consists of normalizing the RuleML 1.0 files. The normalized version has all skipped role tags reconstructed to a fully-expanded, normal form. This conversion was be performed using the XSLT-Based RuleML 1.0 Normalizer. The original, stripe-skipped RuleML 1.0 files and their corresponding normalized RuleML 1.0 files are presented below:
Input Documents:
Final Documents:
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:
drywine(?X)
This query enumerates dry wines in the ontology. The first few results of this query are shown below:
?X = mariettacabernetsauvignon
?X = pagemillwinerycabernetsauvignon
?X = santacruzmountainvineyardcabernetsauvignon
?X = formancabernetsauvignon
...
In OO jDREW, for each dry wine a proof tree can be shown explaining the way the query was answered. Below is an example of the proof tree for mariettacabernetsauvignon wine:
drywine(mariettacabernetsauvignon):-q46(mariettacabernetsauvignon),wine(mariettacabernetsauvignon).
- q46(mariettacabernetsauvignon):-q31(mariettacabernetsauvignon).
- q31(mariettacabernetsauvignon):-cabernetsauvignon(mariettacabernetsauvignon).
- cabernetsauvignon(mariettacabernetsauvignon):-cabernetsauvignon_aux(mariettacabernetsauvignon).
- cabernetsauvignon_aux(mariettacabernetsauvignon).
- wine(mariettacabernetsauvignon):-cabernetsauvignon(mariettacabernetsauvignon).
- cabernetsauvignon(mariettacabernetsauvignon):-cabernetsauvignon_aux(mariettacabernetsauvignon).
- cabernetsauvignon_aux(mariettacabernetsauvignon).
drywine(mariettacabernetsauvignon)
This query asks whether the mariettacabernetsauvignon wine is a dry wine. The result of the query is a proof tree showing why the mariettacabernetsauvignon wine is a dry wine:
drywine(mariettacabernetsauvignon):-q46(mariettacabernetsauvignon),wine(mariettacabernetsauvignon).
- q46(mariettacabernetsauvignon):-q31(mariettacabernetsauvignon).
- q31(mariettacabernetsauvignon):-cabernetsauvignon(mariettacabernetsauvignon).
- cabernetsauvignon(mariettacabernetsauvignon):-cabernetsauvignon_aux(mariettacabernetsauvignon).
- wine(mariettacabernetsauvignon):-cabernetsauvignon(mariettacabernetsauvignon).
- cabernetsauvignon(mariettacabernetsauvignon):-cabernetsauvignon_aux(mariettacabernetsauvignon).
- cabernetsauvignon_aux(mariettacabernetsauvignon).
locatedin(?X, centraltexasregion)
This query enumerates wines which are located in central Texas region. The first few results of this query are shown below:
?X = stgenevievetexaswhite
?X = stgenevievetexaswhite
?X = stgenevievetexaswhite
?X = stgenevievetexaswhite
...
Because in the ontology there are several rules leading to a conclusion that stgenevievetexaswhite is a central Texas wine, we got multiple identical results. However, their proof trees differ. For each stgenevievetexaswhite wine, a proof tree can be shown explaining the way the query was answered. Below is an example of the proof tree for the first two stgenevievetexaswhite wines:
locatedin(stgenevievetexaswhite, centraltexasregion):-locatedin_aux(stgenevievetexaswhite, centraltexasregion).
- locatedin_aux(stgenevievetexaswhite, centraltexasregion).
locatedin(stgenevievetexaswhite, centraltexasregion):-locatedin(stgenevievetexaswhite, centraltexasregion),kaon2equal(stgenevievetexaswhite, stgenevievetexaswhite).
- locatedin(stgenevievetexaswhite, centraltexasregion):-locatedin_aux(stgenevievetexaswhite, centraltexasregion).
- locatedin_aux(stgenevievetexaswhite, centraltexasregion).
- kaon2equal(stgenevievetexaswhite, stgenevievetexaswhite):-kaon2hu(stgenevievetexaswhite).
- kaon2hu(stgenevievetexaswhite):-kaon2namedobjects(stgenevievetexaswhite).
- kaon2namedobjects(stgenevievetexaswhite).
burgundy(chateaudemeursaultmeursault)
This query checks if the chateaudemeursaultmeursault wine is a burgundy wine. The result of the query is a proof tree showing that in fact the chateaudemeursaultmeursault wine is a burgundy wine:
burgundy(chateaudemeursaultmeursault):-whiteburgundy(chateaudemeursaultmeursault).
- hiteburgundy(chateaudemeursaultmeursault):-meursault(chateaudemeursaultmeursault).
- meursault(chateaudemeursaultmeursault):-meursault_aux(chateaudemeursaultmeursault).
- meursault_aux(chateaudemeursaultmeursault).
bordeaux(chateaulafiterothschildpauillac)
This query checks if the chateaulafiterothschildpauillac wine is a bordeaux wine. The result of the query is a proof tree showing that in fact the chateaulafiterothschildpauillac wine is a bordeaux wine:
bordeaux(chateaulafiterothschildpauillac):-medoc(chateaulafiterothschildpauillac).
- medoc(chateaulafiterothschildpauillac):-pauillac(chateaulafiterothschildpauillac).
- pauillac(chateaulafiterothschildpauillac):-pauillac_aux(chateaulafiterothschildpauillac).
pauillac_aux(chateaulafiterothschildpauillac).
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:
europeanwine(?X):-locatedin(?X, germanregion). europeanwine(?X):-locatedin(?X, frenchregion). europeanwine(?X):-locatedin(?X, italianregion).
European wine is a wine or region located in either the German, French or Italian region. The query executing this rule is the following:
europeanwine(?X)
This enumerates European wines in the ontology, using the additional rule described above. The first few results of this query are shown below:
?X = loireregion
?X = bordeauxregion
?X = alsaceregion
?X = bourgogneregion
...
For each European region, a proof tree showing the way this conclusion was obtained is shown. Below is an example of the proof tree for loireregion region:
europeanwine(loireregion):-locatedin(loireregion, frenchregion).
- locatedin(loireregion, frenchregion):-locatedin_aux(loireregion, frenchregion).
- locatedin_aux(loireregion, frenchregion).
Site Contact:
Harold Boley. Page Version: 2011-01-15
"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)