<dd><ahref="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA Grenobe Rhône-Alpes& LIG
</dd>
</dd>
</dl>
</dl>
...
@@ -59,16 +59,16 @@ div.logic {
...
@@ -59,16 +59,16 @@ div.logic {
interpreter available. We wil call it <tt>java</tt>.</p>
interpreter available. We wil call it <tt>java</tt>.</p>
<p>Download the last version of the Alignment <abbr>API</abbr> from <ahref="http://gforge.inria.fr/frs/?group_id=117">http://gforge.inria.fr/frs/?group_id=117</a>. Unzip it and go to the created directory:</p>
<p>Download the last version of the Alignment <abbr>API</abbr> from <ahref="http://gforge.inria.fr/frs/?group_id=117">http://gforge.inria.fr/frs/?group_id=117</a>. Unzip it and go to the created directory:</p>
<divclass="fragment"><pre>
<divclass="fragment">
$ mkdir alignapi
$ mkdir alignapi
$ cd alignapi
$ cd alignapi
$ unzip align*.zip
$ unzip align*.zip
</pre></div>
</div>
<p>You can check that everything works by only typing:</p>
<p>You can check that everything works by only typing:</p>
@@ -99,25 +99,25 @@ Alignment API implementation 3.2 ($Id$)
...
@@ -99,25 +99,25 @@ Alignment API implementation 3.2 ($Id$)
<p>You can <ahref="../align.html">modify the Alignment <abbr>API</abbr> and its implementation</a>. In this tutorial, we will simply learn how to use it.</p>
<p>You can <ahref="../align.html">modify the Alignment <abbr>API</abbr> and its implementation</a>. In this tutorial, we will simply learn how to use it.</p>
<p>You will then go to the tutorial directory by doing:</p>
<p>You will then go to the tutorial directory by doing:</p>
<divclass="fragment"><pre>
<divclass="fragment">
$ cd html/tutorial
$ cd html/tutorial
</pre></div>
</div>
<p>You can clean up previous trials by:</p>
<p>You can clean up previous trials by:</p>
<divclass="fragment"><pre>
<divclass="fragment">
$ rm results/*
$ rm results/*
</pre></div>
</div>
<p>The goal of this tutorial is only to help you realize the possibilities of the Alignment <abbr>API</abbr> and implementation. It can be played by invoking each command line from the command-line interpreter. In this example we use the <tt>tcsh</tt> syntax but the main specific syntax is the first one:</p>
<p>The goal of this tutorial is only to help you realize the possibilities of the Alignment <abbr>API</abbr> and implementation. It can be played by invoking each command line from the command-line interpreter. In this example we use the <tt>tcsh</tt> syntax but the main specific syntax is the first one:</p>
<divclass="fragment"><pre>
<divclass="fragment">
$ setenv CWD `pwd`
$ setenv CWD `pwd`
</pre></div>
</div>
<p>which puts in variable <tt>$CWD</tt> the name of the current directory.</p>
<p>which puts in variable <tt>$CWD</tt> the name of the current directory.</p>
<p>Beside a Java interpreter, if one wants to generate the <abbrtitle="HyperText Markup Language">HTML</abbr> translations of the alignments, this can be done with the help of an <abbrtitle="XML Stylesheet Language Trasnformation">XSLT</abbr> 1.0 processor like <tt>xsltproc</tt>. Hence:</p>
<!--p>Beside a Java interpreter, if one wants to generate the <abbr title="HyperText Markup Language">HTML</abbr> translations of the alignments, this can be done with the help of an <abbr title="XML Stylesheet Language Trasnformation">XSLT</abbr> 1.0 processor like <tt>xsltproc</tt>. Hence:</p>
and opening the <ahref="results/equals.html">results/equals.html</a>
in a browser.
</p>
<p>See the output in <ahref="results/equal.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/equal.html"><abbr>HTML</abbr></a>.</p>
<p>See the output in <ahref="results/equal.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/equal.html"><abbr>HTML</abbr></a>.</p>
<p>The result is expressed in the Alignment format. This format, in <abbr>RDF</abbr>/<abbr>XML</abbr>, is made of a header containing "metadata" about the alignment:
<p>The result is expressed in the Alignment format. This format, in <abbr>RDF</abbr>/<abbr>XML</abbr>, is made of a header containing "metadata" about the alignment:
<p>each correspondence is made of two references to the aligned entities, the relation holding between the entities (<tt>=</tt>) and a confidence measure (<tt>1.0</tt>) in this correspondence. Here, because the default method that has been used for aligning the ontologies is so simple (it only compares the labels of the entities and find that there is a correspondence if their labels are equal), the correspondences are always that simple. But it is too simple so we will use a more sophisticated method based on an edit distance:</p>
<p>each correspondence is made of two references to the aligned entities, the relation holding between the entities (<tt>=</tt>) and a confidence measure (<tt>1.0</tt>) in this correspondence. Here, because the default method that has been used for aligning the ontologies is so simple (it only compares the labels of the entities and find that there is a correspondence if their labels are equal), the correspondences are always that simple. But it is too simple so we will use a more sophisticated method based on an edit distance:</p>
<p>See the output in <ahref="results/levenshtein.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/levenshtein.html"><abbr>HTML</abbr></a>.</p>
<p>See the output in <ahref="results/levenshtein.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/levenshtein.html"><abbr>HTML</abbr></a>.</p>
<p>We can see that the correspondences now contain confidence factors different than <tt>1.0</tt>, they also match strings which are not the same and indeed far more correspondences are available.</p></div>
<p>We can see that the correspondences now contain confidence factors different than <tt>1.0</tt>, they also match strings which are not the same and indeed far more correspondences are available.</p></div>
<p>We do the same with another measure (smoaDistance):</p>
<p>We do the same with another measure (smoaDistance):</p>
<divclass="logic"><p><b>More work:</b> you can apply other available alignments classes. Look in the <ahref="../../src/fr/inrialpes/exmo/align/impl/method">../../src/fr/inrialpes/exmo/align/impl/method</a> directory for more simple alignment methods. Also look in the <tt>StringDistances</tt> class the possible values for <tt>stringFunction</tt> (they are the names of methods).</p></div>
<divclass="logic"><p><b>More work:</b> you can apply other available alignments classes. Look in the <ahref="../../src/fr/inrialpes/exmo/align/impl/method">../../src/fr/inrialpes/exmo/align/impl/method</a> directory for more simple alignment methods. Also look in the <tt>StringDistances</tt> class the possible values for <tt>stringFunction</tt> (they are the names of methods).</p></div>
<divclass="logic"><p><b>Advanced:</b> You can also look at the
<divclass="logic"><p><b>Advanced:</b> You can also look at the
instructions for installing WordNet and its Java interface and use
instructions for installing WordNet and its Java interface and use
a WordNet based distance provided with the <abbr>API</abbr>
a WordNet based distance provided with the <abbr>API</abbr>
implementation by ($WNDIR is the directory where wordnet is installed):</p>
implementation by ($WNDIR is the directory where wordnet is installed):</p>
<p>See the output in <ahref="jwnl.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="jwnl.html"><abbr>HTML</abbr></a>.</p></div>
<p>See the output in <ahref="jwnl.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="jwnl.html"><abbr>HTML</abbr></a>.</p></div>
<h2>Manipulating</h2>
<h2>Manipulating</h2>
<p>As can be seen there are some correspondences that do not really make sense. Fortunately, they also have very low confidence values. It is thus interesting to use a threshold for eliminating these values. Let's try a threshold of <tt>.33</tt> over the alignment (with the <tt>-t</tt> switch):</p>
<p>As can be seen there are some correspondences that do not really make sense. Fortunately, they also have very low confidence values. It is thus interesting to use a threshold for eliminating these values. Let's try a threshold of <tt>.33</tt> over the alignment (with the <tt>-t</tt> switch):</p>
<p>See the output in <ahref="results/levenshtein33.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/levenshtein33.html"><abbr>HTML</abbr></a>.</p>
<p>See the output in <ahref="results/levenshtein33.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/levenshtein33.html"><abbr>HTML</abbr></a>.</p>
<divclass="explain"id="qu4"><p>This operation has contributed eliminating a number of innacurate correspondences like Journal-Conference or Composite-Conference. However, there remains some unaccurate correspondences like Institution-InCollection and Published-UnPublished!</p></div>
<divclass="explain"id="qu4"><p>This operation has contributed eliminating a number of innacurate correspondences like Journal-Conference or Composite-Conference. However, there remains some unaccurate correspondences like Institution-InCollection and Published-UnPublished!</p></div>
<p>We can also apply this treatment to other methods available:</p>
<p>We can also apply this treatment to other methods available:</p>
<p>See the output in <ahref="results/AOMS5.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/AOMS5.html"><abbr>HTML</abbr></a>. The results is an alignment from the source to the target. Inverting alignment is only the exchange of the order of the elements in the alignment file. This can be useful when you have an alignment of <i>A</i> to <i>B</i>, an alignment from <i>C</i> to <i>B</i> and you want to go from <i>A</i> to <i>C</i>. The solution is then to invert the second alignment and to compose them.</p>
<p>See the output in <ahref="results/AOMS5.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <ahref="results/AOMS5.html"><abbr>HTML</abbr></a>. The results is an alignment from the source to the target. Inverting alignment is only the exchange of the order of the elements in the alignment file. This can be useful when you have an alignment of <i>A</i> to <i>B</i>, an alignment from <i>C</i> to <i>B</i> and you want to go from <i>A</i> to <i>C</i>. The solution is then to invert the second alignment and to compose them.</p>
<divclass="logic"><p><b>More work:</b> There is another switch (<tt>-T</tt>) in Procalign that specifies the way a threshold is applied (hard|perc|prop|best|span) the default being "hard". The curious reader can apply these and see the difference in results. How they work is explained in the Alignment <abbr>API</abbr> documentation.</p></div>
<divclass="logic"><p><b>More work:</b> There is another switch (<tt>-T</tt>) in Procalign that specifies the way a threshold is applied (hard|perc|prop|best|span) the default being "hard". The curious reader can apply these and see the difference in results. How they work is explained in the Alignment <abbr>API</abbr> documentation.</p></div>
<p>Once a good alignment has been found, only half of the work has been done. In order to actually use our result it is necessary to transform it into some processable format. For instance, if one wants to merge two OWL ontologies, the alignment can be changed into as set of <acronym>OWL</acronym> "bridging" axioms. This is achieved by "rendering" the alignment in <acronym>OWL</acronym> (through the <tt>-r</tt> switch):</p>
<p>Once a good alignment has been found, only half of the work has been done. In order to actually use our result it is necessary to transform it into some processable format. For instance, if one wants to merge two OWL ontologies, the alignment can be changed into as set of <acronym>OWL</acronym> "bridging" axioms. This is achieved by "rendering" the alignment in <acronym>OWL</acronym> (through the <tt>-r</tt> switch):</p>
@@ -324,13 +334,13 @@ $ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter re
...
@@ -324,13 +334,13 @@ $ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter re
</pre></div>
</pre></div>
<p>Exchanging data can also be achieved more simply through <abbr>XSLT</abbr> transformations which will transform the <acronym>OWL</acronym> instance files from one ontology to another:</p>
<p>Exchanging data can also be achieved more simply through <abbr>XSLT</abbr> transformations which will transform the <acronym>OWL</acronym> instance files from one ontology to another:</p>
<p>We will evaluate alignments by comparing them to some reference alignment which is supposed to express what is expected from an alignment of these two ontologies. The reference alignment is <ahref="refalign.rdf">refalign.rdf</a> (or <ahref="results/refalign.html"><abbr>HTML</abbr></a>).</p>
<p>We will evaluate alignments by comparing them to some reference alignment which is supposed to express what is expected from an alignment of these two ontologies. The reference alignment is <ahref="refalign.rdf">refalign.rdf</a> (or <ahref="results/refalign.html"><abbr>HTML</abbr></a>).</p>
<p>For evaluating we use another class than <tt>Procalign</tt>. It is called <tt>EvalAlign</tt> we should specify this to <tt>java</tt>. By default, it computes precision, recall and associated measures. It can be invoked this way:</p>
<p>For evaluating we use another class than <tt>Procalign</tt>. It is called <tt>EvalAlign</tt> we should specify this to <tt>java</tt>. By default, it computes precision, recall and associated measures. It can be invoked this way:</p>
<divclass="explain"id="qu5"><p>Since it returns more correspondences by loosening the constraints for being a correspondence, it is expected that the recall will increase at the expense of precision.</p></div>
<divclass="explain"id="qu5"><p>Since it returns more correspondences by loosening the constraints for being a correspondence, it is expected that the recall will increase at the expense of precision.</p></div>
<p>It is possible to summarize these results by comparing them to each others. This can be achieved by the <tt>GroupEval</tt> class. This class can output several formats (by default html) and takes all the alignments in the subdirectories of the current directory. Here we only have the <tt>results</tt> directory:</p>
<p>It is possible to summarize these results by comparing them to each others. This can be achieved by the <tt>GroupEval</tt> class. This class can output several formats (by default html) and takes all the alignments in the subdirectories of the current directory. Here we only have the <tt>results</tt> directory:</p>
<divclass="logic"><p><b>More work:</b> As you can see, the <tt>PRecEvaluator</tt> does not only provide precision and recall but also provides F-measure. F-measure is usually used as an "absolute" trade-off between precision and recall (i.e., the optimum F-measure is considered the best precision and recall). Can you establish this point for <acronym>SMOA</acronym> and levenshtein and tell which algorithm is more adapted?</p></div>
<divclass="logic"><p><b>More work:</b> As you can see, the <tt>PRecEvaluator</tt> does not only provide precision and recall but also provides F-measure. F-measure is usually used as an "absolute" trade-off between precision and recall (i.e., the optimum F-measure is considered the best precision and recall). Can you establish this point for <acronym>SMOA</acronym> and levenshtein and tell which algorithm is more adapted?</p></div>
<p>Of course, the goal of this <abbr>API</abbr> is not to be used at the command line level (even if it can be very useful). So if you are ready for it, you can develop in Java your own application that takes advantage of the <abbr>API</abbr>.</p>
<p>Of course, the goal of this <abbr>API</abbr> is not to be used at the command line level (even if it can be very useful). So if you are ready for it, you can develop in Java your own application that takes advantage of the <abbr>API</abbr>.</p>
<p>A skeleton of program using the Alignment <abbr>API</abbr> is <ahref="Skeleton.java">Skeleton.java</a>. It can be compiled by invoking:</p>
<p>A skeleton of program using the Alignment <abbr>API</abbr> is <ahref="Skeleton.java">Skeleton.java</a>. It can be compiled by invoking:</p>
<p>Now considering the <abbr>API</abbr> (that can be consulted through its thin <ahref="../../javadoc/org/semanticweb/owl/align/Alignment.html">Javadoc</a> for instance), can you modify the Skeleton program in order for it performs the following:</p>
<p>Now considering the <abbr>API</abbr> (that can be consulted through its thin <ahref="../../javadoc/org/semanticweb/owl/align/Alignment.html">Javadoc</a> for instance), can you modify the Skeleton program in order for it performs the following:</p>