DLML | Operators | Logics | Transformations | Transformation flow

Case study for applying the familly of languages approach (with Heiner Stuckenschmidt)

This example merge two ontologies written in DAML-ONT and in OIL and transforms them into SHIQ which is a language that the FaCT reasonner can handle.

Overall description

It follows the process:

This flow can be written in Transmorpher by: <tm:process name="assemble-onto" in="i1 i2" out="o"> <tm:apply-external type="xslt" name="daml2ldaml" file="daml2ldaml.xsl" in="i1" out="o1"/> <tm:apply-external type="xslt" name="oil2loil" file="oil2loil.xsl" in="i2" out="o2"/> <tm:merger type="simple" name="ldaml+ldaml" in="o1 o2" out="o3"/> <tm:apply-external type="xslt" name="domain2allinv" file="domain2allinv.xsl" in="o3" out="o4"/> <tm:apply-external type="xslt" name="oneof2or" file="oneof2or.xsl" in="o4" out="o5"/> <tm:repeat in="o5" channel="o5:o6" out="o6"> <tm:apply-external type="xslt" name="cexcl2not" file="cexcl2not.xsl" in="o5" out="o6"/> </tm:repeat> <tm:apply-external type="xslt" name="zzz2shiq" file="zzz2shiq.xsl" in="o6" out="o"/> </tm:process>

Importing from other languages

My source files (I have no DTD: oil.dtd):

Note that I infered many things. In particular some of the namespaces have been totally invented by myself (no time).

The transformations:

The manipulations are mainly achieved by designing an XSLT stylesheet which transform a source document into a target document. For performing these transformations with the XT engine (so far, the version 19991105), type the command lines:

$ setenv CLASSPATH xp.jar:xt.jar:sax.jar:$CLASSPATH $ java com.jclark.xsl.sax.Driver source.xml stylesheet.xsl target.whatever i.e. $ java com.jclark.xsl.sax.Driver oil-printer.xml oil2loil.xsl loil-printer.xml $ sed "s:\$:\\\$:g" > /tmp/loil-printer.xml $ mv tmp/loil-printer.xml loil-printer.xml $ java com.jclark.xsl.sax.Driver loil-printer.xml ../tex/dlml2tex.xsl loil-printer.tex $ latex loil-printer.tex $ dvips loil-printer.dvi -o loil-printer.ps

The result is:

Merging

The two files are put together in order to produce only one file zzz.xml. This can be done through:

$ java com.jclark.xsl.sax.Driver incspec.xml loilldaml2zzz.xsl zzz.xml $ java com.jclark.xsl.sax.Driver zzz.xml ../tex/dlml2tex.xsl zzz.tex

Semantic preserving transformations

Then, zzz (corresponding to LG) has to be transformed in LSHIQ. This is the interesting transformation: zzz2lshiq.xsl which produces lshiq2.xml. The resulting shiq.tex can be seen below as an xdvi layout. The TeX file can be edited and used in a paper.

Getting rid of domain

Use the domain2allinv.xsl transformation which produces z1.xml.

$ java com.jclark.xsl.sax.Driver zzz.xml domain2allinv.xsl z1.xml

It is noteworthy, like for all the other transformations, that z1 is NOT a complete transformation for translating any language with domain to any language without it. This for two reasons:

The second clause would require the following constraints: (all (domain C) C') ==> (or (not C) (and C (all anyrelation C'))) (catleast n (domain C) C') ==> (and C (catleast n anyrelation C')) (catmost n (domain C) C') ==> (or (not C) (and C (catleast n anyrelation C'))) csome and some can be deduced from that (catleast n (inv (domain C)) C') ==> (catleast n anyrelation (and C C')) (catmost n (inv (domain C)) C') ==> (catmost n anyrelation (and C C')) csome and some can be deduced from that (all (inv (domain C)) C') ==> (all anyrelation (or (not C) C'))

Converting oneof

Use the oneof2ornot.xsl transformation which produces z2.xml. $ java com.jclark.xsl.sax.Driver z1.xml oneof2ornot.xsl z2.xml

Transforming cexcl

Use the cexcl2not.xsl transformation which produces lshiq.xml. Note that this transformation must be applied until it is not applicable anymore (i.e. input is output). $ java com.jclark.xsl.sax.Driver z2.xml cexcl2not.xsl lshiq.xml

The resulting ontology (in LaTeX)

$ java com.jclark.xsl.sax.Driver lshiq2.xml ../tex/dlml2tex.xsl lshiq2.tex $ latex lshiq2.tex And the result:

Exporting to SHIQ

This is not yet strictly implemented, but maybe the aluni2fact.xsl transformation will work


DLML | Operators | Logics | Transformations | Transformation flow

http://co4.inrialpes.fr/xml/dlml/flex/

Jerome . Euzenat À inrialpes . fr $Id: index.html,v 1.1 2003/08/21 20:39:26 euzenat Exp $