Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0ca4e772 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- reengineered the tutorial part

parent 438ed6bb
No related branches found
No related tags found
No related merge requests found
Showing
with 553 additions and 687 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title>A small tutorial on the Alignment API</title> <title>Tutorials on the Alignment API</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Contributor" content="Antoine Zimmermann" /> <meta name="Contributor" content="Antoine Zimmermann" />
<link rel="stylesheet" type="text/css" href="../base.css" /> <link rel="stylesheet" type="text/css" href="../base.css" />
...@@ -33,31 +33,72 @@ div.logic { ...@@ -33,31 +33,72 @@ div.logic {
</head> </head>
<body style="background-color: #FFFFFF;"> <body style="background-color: #FFFFFF;">
<h1>A small tutorial on the Alignment <abbr title="Application Programming Interface">API</abbr></h1> <h1>Tutorials and documentation on the Alignment <abbr title="Application Programming Interface">API</abbr> and server</h1>
<dl> <dl>
<dt>This version:</dt> <dt>This version:</dt>
<dd>http://alignapi.gforge.inria.fr/tutorial/</dd> <dd>http://alignapi.gforge.inria.fr/tutorial/</dd>
<dt>Author:</dt> <dt>Author:</dt>
<dd><a href="http://exmo.inrialpes.fr/people/euzenat">J&eacute;r&ocirc;me Euzenat</a>, INRIA &amp; LIG <dd><a href="http://exmo.inrialpes.fr/people/euzenat">J&eacute;r&ocirc;me Euzenat</a>, INRIA &amp; LIG
</dd> </dd>
</dl> </dl>
<p style="border-bottom: 2px solid #AAAAAA; border-top: 2px solid <p style="border-top: 2px solid
#AAAAAA; padding-top: 15px; padding-bottom: 15px;">Here is a #AAAAAA; padding-top: 15px; padding-bottom: 15px;">
small tutorial for the alignment <abbr>API</abbr>. Most of the tutorial is based on command-lines invocations. Of course, it is not the natural way to use this <abbr>API</abbr>: it is made for being embedded in some application programme and we are working towards implementing an alignment server that can help programmes to use the <abbr>API</abbr> remotely. The complete tutorial is also available as a self-contained <a href="script.sh" title="script for UNIX systems">script.sh</a> or <a href="script.bat" title="script for Windows systems">script.bat</a>. We have developed a series a tutorials so that any kind of user can
We make no garantee on the MS-DOS script, it is only here for helping. take advatage of that API:
<dl>
<dt><a href="tutorial1/index.html">Using the Alignment API</a></dt>
<dd>Explains how to use the API as a user for matching ontologies and
manipulating alignments. It is based on a command line interface.</dd>
<dt><a href="tutorial1/server.html">Manipulating alignments through a Web client</a></dt>
<dd>Does most of what is done in the former tutorial but through an
Web (HTTP) client using the Alignment server only.</dd>
<dt><a href="tutorial2/index.html">Manipulating alignments in Java programs</a></dt>
<dd>This tutorial will learn you to:
<ul>
<li>communicate the alignment server
through its REST web service API,</li>
<li>manipulate alignments with the Alignment API in Java,</li>
<li>answer SPARQL queries based on the resulting alignment,</li>
<li>perform OWL reasoning on aligned ontologies and compose
alignments.</li>
</ul>
It is based on Java programming and using various
related APIs.</dd>
<dt><a href="tutorial3/embed.html"></a>Embedding the Alignment API
within an application <span style="color: red;">(Not ready yet)</span></dt>
<dd>Explains how an aplication
developer can embed the Alignment API within an application.</dd>
<dt><a href="tutorial3/index.html"></a>Extending the Alignment API with a new matcher <span style="color: red;">(Not ready yet)</span></dt>
<dd>Explains how an ontology matching developer can easily integrate
its matcher within the Alignment API.</dd>
</dl>
</p> </p>
<p>A small <a href="server.html">companion tutorial</a> has been designed for the Alignment <p>
Server. It follows, as much as possible, the reasoning of this We also have
tutorial but provides input and output through a web browser.</p> some <a href="http://gforge.inria.fr/docman/index.php?group_id=117&selected_doc_group_id=1812"><b>Documentation</b></a>
<small>This tutorial has been designed for the Alignment API version available. However, it is easily out of date.
2.4 (it has been updated to work with version 3.6).</small> </p>
<p>
A video presents the <a href=""></a>use of the Alignment API from the
NeOn toolkit.
</p>
<p>
Other sources of information are the example directory of the
Alignment API and the source code (with its moderately explicit
Javadoc).
</p>
<h2>Preparation</h2> <h2>Preparation</h2>
<p>This preparation phase, is common to all tutorials (but the second
one which only requires a wen browser).</p>
<p>For running the alignment <abbr>API</abbr>, you must have a Java <p>For running the alignment <abbr>API</abbr>, you must have a Java
interpreter available. We wil call it <tt>java</tt>.</p> interpreter available. We will call it <tt>java</tt>. For compiling
your application, you will also need a java compiler, hereby
called <tt>javac</tt>.</p>
<p>Download the last version of the Alignment <abbr>API</abbr> from <a href="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 <a href="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>
<div class="fragment"> <div class="fragment">
...@@ -97,7 +138,7 @@ Alignment API implementation 3.2 ($Id$) ...@@ -97,7 +138,7 @@ Alignment API implementation 3.2 ($Id$)
<p>The above command outputs the command line usage of the Procalign class. We do not detail it here, this tutorial will present it entirelly.</p> <p>The above command outputs the command line usage of the Procalign class. We do not detail it here, this tutorial will present it entirelly.</p>
<p>You can <a href="../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 <a href="../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>
<div class="fragment"> <div class="fragment">
...@@ -105,7 +146,7 @@ $ cd html/tutorial ...@@ -105,7 +146,7 @@ $ cd html/tutorial
</div> </div>
<p>You can clean up previous trials by:</p> <p>You can clean up previous trials by:</p>
<div class="fragment"> <div class="fragment">
$ rm results/* $ rm */results/*
</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>
...@@ -114,502 +155,32 @@ $ setenv CWD `pwd` ...@@ -114,502 +155,32 @@ $ setenv CWD `pwd`
</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 <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> <p>
<div class="fragment"> Now you can go back to any of the tutorials:
$ xsltproc ../form-align.xsl results/file.rdf > results/file.html
</div>
<p>generates <tt>results/file.html</tt> from the alignment file <tt>results/file.rdf</tt>.</p-->
<h2>The data</h2>
<p>Your mission, if you accept it, will be to find the best alignment between two bibliographic ontologies. They can be seen here:</p>
<dl>
<dt>edu.mit.visus.bibtex.owl</dt>
<dd>is a relatively faithfull transcription of BibTeX as an ontology. It can be seen here in <a href="edu.mit.visus.bibtex.owl"><abbr title="Ressource Description Framework">RDF</abbr>/<abbr title="eXtansible Markup Language">XML</abbr></a> or <a href="edu.mit.visus.bibtex.html"><abbr>HTML</abbr></a>.</dd>
<dt>myOnto.owl</dt>
<dd>is an extension of the previous one that contains a number of supplementary concepts. It can be seen here in <a href="myOnto.owl"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="myOnto.html"><abbr>HTML</abbr></a>.</dd>
</dl>
<p>These two ontologies have been used for a few years in the <a href="oaei.ontologymatching.org">Ontology Alignment Evaluation Initiative</a>.</p>
<h2>Matching</h2>
<p>For demonstrating the use of our implementation of the Alignment <abbr>API</abbr>, we implemented a particular processor (<tt>fr.inrialpes.exmo.align.util.Procalign</tt>) which:</p>
<ul>
<li>Reads two <acronym title="Web Ontology Language">OWL</acronym>/<abbr>RDF</abbr> ontologies;</li>
<li>Creates an alignment object;</li>
<li>Computes the alignment between these ontologies;</li>
<li>Displays the result.</li>
</ul>
<p>Let's try to match these two ontologies:</p>
<div class="fragment">
$ java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl
</div>
<p>The result is displayed on the standard output. Since the output is too long we send it to a file by using the <tt>-o</tt> switch:</p>
<div class="fragment">
$ java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/equal.rdf
</div>
<p>Additional options are available:</p>
<ul> <ul>
<li>displaying debug information (-d);</li> <li><a href="tutorial1/index.html">Using the Alignment API</a></li>
<li>controling the way of rendering the output (-r);</li> <li><a href="tutorial1/server.html">Manipulating Alignments through a Web client</a></li>
<li>deciding the implementation of the alignment method (-i);</li> <li><a href="tutorial2/index.html">Manipulating alignments in Java programs</a></li>
<li>providing an input alignment (-a) [implemented but not used by most methods].</li> <li><a href="tutorial3/embed.html"></a>Embedding the Alignment API within an application</li>
<li><a href="tutorial3/index.html"></a>Extending the Alignment API with a new matcher</li>
</ul> </ul>
<p>Hence, it is possible to display the alignment
in <abbr title="HyperText Markup Language">HTML</abbr> by using the
adequate renderer:
<div class="fragment">
$ java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/equals.html
</div>
and opening the <a href="results/equals.html">results/equals.html</a>
in a browser.
</p> </p>
<p>See the output in <a href="results/equal.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="results/equal.html"><abbr>HTML</abbr></a>.</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>
<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>
<div class="owl"><pre>
&lt;?xml version='1.0' encoding='utf-8' standalone='no'?>
&lt;rdf:RDF xmlns='http://knowledgeweb.semanticweb.org/heterogeneity/alignment#'
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:xsd='http://www.w3.org/2001/XMLSchema#'
xmlns:align='http://knowledgeweb.semanticweb.org/heterogeneity/alignment#'>
&lt;Alignment>
&lt;xml>yes&lt;/xml>
&lt;level>0&lt;/level>
&lt;type>**&lt;/type>
&lt;method>fr.inrialpes.exmo.align.impl.method.StringDistAlignment&lt;/method>
&lt;time>18&lt;/time>
&lt;onto1>
&lt;Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl">
&lt;location>file:///Java/alignapi/html/tutorial/myOnto.owl&lt;/location>
&lt;formalism>
&lt;Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/>
&lt;/formalism>
&lt;/Ontology>
&lt;/onto1>
&lt;onto2>
&lt;Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl">
&lt;location>file:///Java/alignapi/html/tutorial/edu.mit.visus.bibtex.owl&lt;/location>
&lt;formalism>
&lt;Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/>
&lt;/formalism>
&lt;/Ontology>
&lt;/onto2>
</pre></div>
<p>and the corresponding set of correspondences:</p>
<div class="owl"><pre>
&lt;map&gt;
&lt;Cell&gt;
&lt;entity1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Article"/&gt;
&lt;entity2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Article"/&gt;
&lt;measure rdf:datatype="http://www.w3.org/2001/XMLSchema#float"&gt;1.0&lt;/measure&gt;
&lt;relation&gt;=&lt;/relation&gt;
&lt;/Cell&gt;
&lt;/map&gt;
</pre></div>
<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>
<div class="fragment">
$ java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/levenshtein.rdf
</div>
<p>See the output in <a href="results/levenshtein.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="results/levenshtein.html"><abbr>HTML</abbr></a>.</p>
<p>This is achieved by specifying the class of Alignment to be used (through the <tt>-i</tt> switch) and the distance function to be used (<tt>-DstringFunction=levenshteinDistance</tt>).</p>
<p>Look at the results: how are they different from before?</p>
<div class="button">
<input type="button" onclick="show('qu1')" value="Show Discussion"/>
<input type="button" onclick="hide('qu1')" value="Hide Discussion"/>
</div>
<div class="explain" id="qu1">
<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>
<div class="fragment">
$ java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/SMOA.rdf
</div>
<div class="logic"><p><b>More work:</b> you can apply other available alignments classes. Look in the <a href="../../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>
<div class="logic"><p><b>Advanced:</b> You can also look at the
instructions for installing WordNet and its Java interface and use
a WordNet based distance provided with the <abbr>API</abbr>
implementation by ($WNDIR is the directory where wordnet is installed):</p>
<div class="fragment">
$ java -jar ../../lib/procalign.jar -Dwndict=$WNDIR -i fr.inrialpes.exmo.align.ling.JWNLAlignment file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/jwnl.rdf
</div>
<p>See the output in <a href="jwnl.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="jwnl.html"><abbr>HTML</abbr></a>.</p></div>
<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>
<div class="fragment">
$ java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.33 -o results/levenshtein33.rdf
</div>
<p>See the output in <a href="results/levenshtein33.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="results/levenshtein33.html"><abbr>HTML</abbr></a>.</p>
<p>As expected we have suppressed some of these inaccurate correspondences. But did we also suppressed accurate ones?</p>
<div class="button">
<input type="button" onclick="show('qu4')" value="Show Discussion"/>
<input type="button" onclick="hide('qu4')" value="Hide Discussion"/>
</div>
<div class="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>
<div class="fragment">
$ java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -t 0.5 -o results/SMOA5.rdf
</div>
<p>See the output in <a href="results/SMOA5.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="results/SMOA5.html"><abbr>HTML</abbr></a>.</p>
<p><b>Other manipulations:</b> It is possible to invert an alignment with the following command:</p>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter -i results/SMOA5.rdf -o results/AOMS5.rdf
</div>
<p>See the output in <a href="results/AOMS5.rdf"><abbr>RDF</abbr>/<abbr>XML</abbr></a> or <a href="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>
<div class="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>
<div class="logic"><p><b>More work:</b> Try to play with the thresholds in order to find the best values for levenshteinDistance and smoaDistance.</p></div>
<h2>Output</h2>
<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 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>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor
</div>
<p>The result is a set of OWL assertions of the form:</p>
<div class="owl"><pre>
&lt;owl:Class rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"&gt;
&lt;owl:equivalentClass rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/&gt;
&lt;/owl:Class&gt;
&lt;owl:ObjectProperty rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"&gt;
&lt;owl:equivalentProperty rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/&gt;
&lt;/owl:ObjectProperty&gt;
</pre></div>
<p>If one wants to use the alignments only for infering on instances without actually merging the classes, she can generate SWRL rules:</p>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.SWRLRendererVisitor
</div>
<p>which brings for the same assertions:</p>
<div class="owl"><pre>
&lt;ruleml:imp&gt;
&lt;ruleml:_body&gt;
&lt;swrl:classAtom&gt;
&lt;owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"/&gt;
&lt;ruleml:var&gt;x&lt;/ruleml:var&gt;
&lt;/swrl:classAtom&gt;
&lt;/ruleml:_body&gt;
&lt;ruleml:_head&gt;
&lt;swrlx:classAtom&gt;
&lt;owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/&gt;
&lt;ruleml:var>x&lt;/ruleml:var&gt;
&lt;/swrl:classAtom&gt;
&lt;/ruleml:_head&gt;
&lt;/ruleml:imp&gt;
&lt;ruleml:imp&gt;
&lt;ruleml:_body&gt;
&lt;swrl:individualPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"/&gt;
&lt;ruleml:var&gt;x&lt;/ruleml:var&gt;
&lt;ruleml:var&gt;y&lt;/ruleml:var&gt;
&lt;/swrl:individualPropertyAtom&gt;
&lt;/ruleml:_body&gt;
&lt;ruleml:_head&gt;
&lt;swrl:datavaluedPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/&gt;
&lt;ruleml:var&gt;x&lt;/ruleml:var&gt;
&lt;ruleml:var&gt;y&lt;/ruleml:var&gt;
&lt;/swrl:datavaluedPropertyAtom&gt;
&lt;/ruleml:_head&gt;
&lt;/ruleml:imp&gt;
</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>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.XSLTRendererVisitor -o results/SMOA5.xsl
</div>
<p>this transformation can be applied to the data of <a href="data.xml">data.xml</a>:</p>
<div class="fragment">
$ xsltproc results/SMOA5.xsl data.xml > results/data.xml
</div>
<p>for giving the <a href="results/data.xml">results/data.xml</a> file.</p>
<h2>Evaluating</h2>
<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 <a href="refalign.rdf">refalign.rdf</a> (or <a href="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>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://$CWD/refalign.rdf file://$CWD/results/equal.rdf
</div>
<p>The first argument is always the reference alignment, the second one is the alignment to be evaluated. The result is given here:</p>
<div class="owl"><pre>
&lt;?xml version='1.0' encoding='utf-8' standalone='yes'?>
&lt;rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:map='http://www.atl.external.lmco.com/projects/ontology/ResultsOntology.n3#'>
&lt;map:output rdf:about=''>
&lt;map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/>
&lt;map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/>
&lt;map:precision>1.0&lt;/map:precision>
&lt;map:recall>0.3541666666666667&lt;/map:recall>
&lt;fallout>0.0&lt;/fallout>
&lt;map:fMeasure>0.5230769230769231&lt;/map:fMeasure>
&lt;map:oMeasure>0.3541666666666667&lt;/map:oMeasure>
&lt;time>22&lt;/time>
&lt;result>0.3541666666666667&lt;/result>
&lt;/map:output>
&lt;/rdf:RDF>
</pre></div>
<p>Of course, since that method only match objects with the same name, it is accurate, yielding a high precision. However, it has poor recall.</p>
<p>We can now evaluate the edit distance. What to expect from the evaluation of this alignment?</p>
<div class="button">
<input type="button" onclick="show('qu5')" value="Show Discussion"/>
<input type="button" onclick="hide('qu5')" value="Hide Discussion"/>
</div>
<div class="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>We can see the results of:</p>
<div class="fragment">
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://$CWD/refalign.rdf file://$CWD/results/levenshtein33.rdf
</div>
<div class="button">
<input type="button" onclick="show('qu6')" value="Show result"/>
<input type="button" onclick="hide('qu6')" value="Hide result"/>
</div>
<div class="explain" id="qu6"><pre>
&lt;?xml version='1.0' encoding='utf-8' standalone='yes'?>
&lt;rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:map='http://www.atl.external.lmco.com/projects/ontology/ResultsOntology.n3#'>
&lt;map:output rdf:about=''>
&lt;map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/>
&lt;map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/>
&lt;map:precision>0.6153846153846154&lt;/map:precision>
&lt;map:recall>1.0&lt;/map:recall>
&lt;fallout>0.38461538461538464&lt;/fallout>
&lt;map:fMeasure>0.761904761904762&lt;/map:fMeasure>
&lt;map:oMeasure>0.375&lt;/map:oMeasure>
&lt;time>28&lt;/time>
&lt;result>1.625&lt;/result>
&lt;/map:output>
&lt;/rdf:RDF>
</pre></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>
<div class="fragment">
$ cp refalign.rdf results
$ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.GroupEval -r refalign.rdf -l "refalign,equal,SMOA,SMOA5,levenshtein,levenshtein33" -c -f prm -o results/eval.html
</div>
<p>The results are displayed in the <a href="results/eval.html">results/eval.html</a> file whose main content is the table:</p>
<center style="font-size: 82%;">
<table border='2' frame='sides' rules='groups'>
<colgroup align='center' />
<colgroup align='center' span='3' />
<colgroup align='center' span='3' />
<colgroup align='center' span='3' />
<colgroup align='center' span='3' />
<colgroup align='center' span='3' />
<colgroup align='center' span='3' />
<thead valign='top'><tr><th>algo</th>
<th colspan='3'>refalign</th>
<th colspan='3'>equal</th>
<th colspan='3'>SMOA</th>
<th colspan='3'>SMOA5</th>
<th colspan='3'>levenshtein</th>
<th colspan='3'>levenshtein33</th>
</tr></thead><tbody><tr><td>test</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
<td>Prec.</td>
<td>Rec.</td>
<td>FMeas.</td>
</tr></tbody><tbody>
<tr>
<td>results</td>
<td>1.00</td>
<td>1.00</td>
<td>1.00</td>
<td>1.00</td>
<td>0.35</td>
<td>0.52</td>
<td>0.53</td>
<td>0.96</td>
<td>0.69</td>
<td>0.66</td>
<td>0.96</td>
<td>0.78</td>
<td>0.51</td>
<td>1.00</td>
<td>0.68</td>
<td>0.62</td>
<td>1.00</td>
<td>0.76</td>
</tr>
<tr bgcolor="yellow"><td>H-mean</td><td>1.00</td>
<td>1.00</td>
<td>1.00</td>
<td>1.00</td>
<td>0.35</td>
<td>0.52</td>
<td>0.53</td>
<td>0.96</td>
<td>0.69</td>
<td>0.66</td>
<td>0.96</td>
<td>0.78</td>
<td>0.51</td>
<td>1.00</td>
<td>0.68</td>
<td>0.62</td>
<td>1.00</td>
<td>0.76</td>
</tr>
</tbody></table>
</center>
<!--div class="fragment">
$ java -jar ../../lib/Procalign.jar file://$CWD/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -DprintMatrix=1 -o /dev/null > matrix.tex
</div-->
<div class="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>
<!--div class="logic"><p><b>More work:</b>If you want to compare several algorithms, there is another class, GroupAlign, that allows to run an</p></div-->
<h2>Embedding</h2>
<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 <a href="Skeleton.java">Skeleton.java</a>. It can be compiled by invoking:</p>
<div class="fragment">
$ javac -classpath ../../lib/align.jar:../../lib/procalign.jar -d results Skeleton.java
</div>
<p>and run by:</p>
<div class="fragment">
$ java -cp ../../lib/Procalign.jar:results Skeleton file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl
</div>
<p>Now considering the <abbr>API</abbr> (that can be consulted through its thin <a href="../../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>
<ul>
<li>Run two different alignment methods (e.g., ngram distance and smoa);</li>
<li>Merge the two results;</li>
<li>Trim at various thresholds;</li>
<li>Evaluate them against the reference alignment and choose the one with the best F-Measure;</li>
<li>Displays it as <acronym title="The web ontology language OWL">OWL</acronym> Rules.</li>
</ul>
<p>Of course, you can do it progressively.</p>
<div class="fragment"> <div class="fragment">
$ javac -classpath ../../lib/align.jar:../../lib/procalign.jar -d results MyApp.java $ xsltproc ../form-align.xsl results/file.rdf > results/file.html
$ java -cp ../../lib/Procalign.jar:results MyApp file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl > results/MyApp.owl
</div>
<p>Do you want to see a possible solution?</p>
<div class="button">
<input type="button" onclick="show('qu7')" value="Cheat"/>
<input type="button" onclick="hide('qu7')" value="Teacher is comming"/>
</div> </div>
<div class="explain" id="qu7"><p>The main piece of code in Skeleton.java is replaced by:</p> <p>generates <tt>results/file.html</tt> from the alignment file <tt>results/file.rdf</tt>.</p-->
<pre>
// Run two different alignment methods (e.g., ngram distance and smoa)
AlignmentProcess a1 = new StringDistAlignment();
params.setParameter("stringFunction","smoaDistance");
a1.init ( onto1, onto2 );
a1.align( (Alignment)null, params );
AlignmentProcess a2 = new StringDistAlignment();
a2.init ( onto1, onto2 );
params = new BasicParameters();
params.setParameter("stringFunction","ngramDistance");
a2.align( (Alignment)null, params );
// Merge the two results.
((BasicAlignment)a1).ingest(a2);
// Threshold at various thresholds
// Evaluate them against the references
// and choose the one with the best F-Measure
AlignmentParser aparser = new AlignmentParser(0);
// Changed by Angel for Windows
//Alignment reference = aparser.parse( "file://"+(new File ( "refalign.rdf" ) . getAbsolutePath()) );
Alignment reference = aparser.parse( (new File ( "refalign.rdf" ) ) . toURL() . toString());
Evaluator evaluator = new PRecEvaluator( reference, a1 );
double best = 0.;
Alignment result = null;
Parameters p = new BasicParameters();
for ( int i = 0; i <= 10 ; i += 2 ){
a1.cut( ((double)i)/10 );
evaluator = new PRecEvaluator( reference, a1 );
evaluator.eval( p );
System.err.println("Threshold "+(((double)i)/10)+" : "+((PRecEvaluator)evaluator).getFmeasure()+" over "+a1.nbCells()+" cells");
if ( ((PRecEvaluator)evaluator).getFmeasure() > best ) {
result = (BasicAlignment)((BasicAlignment)a1).clone();
best = ((PRecEvaluator)evaluator).getFmeasure();
}
}
// Displays it as OWL Rules
PrintWriter writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( System.out, "UTF-8" )), true);
AlignmentVisitor renderer = new OWLAxiomsRendererVisitor(writer);
a1.render(renderer);
writer.flush();
writer.close();
</pre></div>
<p>The execution provides an insight about the best threshold:
<pre>
Threshold 0.0 : 0.4693877551020408 over 148 cells
Threshold 0.2 : 0.5227272727272727 over 128 cells
Threshold 0.4 : 0.5476190476190476 over 120 cells
Threshold 0.6 : 0.6478873239436619 over 94 cells
Threshold 0.8 : 0.75 over 72 cells
Threshold 1.0 : 0.5151515151515151 over 18 cells
</pre>
<p>
<p>A full working solution is <a href="MyApp.java">MyApp.java</a>.</p>
<div class="logic"><p><b>More work:</b> Can you add a switch like the <tt>-i</tt> switch of <tt>Procalign</tt> so that the main class of the application can be passed at commant-line.</p></div>
<div class="logic"><p><b>Advanced:</b> You can develop a specialized matching algorithm by subclassing the Java programs provided in the Alignment <abbr>API</abbr> implementation (like BasicAlignment or DistanceAlignment).</p></div>
<div class="logic"><p><b>Advanced:</b> What about writing an editor for the alignment <abbr>API</abbr>?</p></div>
<h2>Further exercises</h2>
<p>More info: <a href="http://alignapi.gforge.inria.fr">http://alignapi.gforge.inria.fr</a></p>
<h2>Acknowledgements</h2> <h2>Acknowledgements</h2>
<p>The format of this tutorial has been shamelessly borrowed from Sean Bechhofer's <a href="http://owl.man.ac.uk/2005/07/sssw/"><acronym>OWL</acronym> tutorial</a>.</p> <p>The format of these tutorials has been shamelessly borrowed from Sean Bechhofer's <a href="http://owl.man.ac.uk/2005/07/sssw/"><acronym>OWL</acronym> tutorial</a>.</p>
<hr /> <hr />
<small> <address>
<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/</p> <div style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/</div>
</small>
<hr /> <hr />
<p>$Id$</p> $Id$
</address>
</body> </body>
</html> </html>
rem #####################
rem # Preparation
rem #mkdir alignapi
rem #cd alignapi
rem #unzip align*.zip
rem #java -jar lib/procalign.jar --help
rem #cd html/tutorial
rem # Angel modifications
rem #set CWD=/c:/alignapi/html/tutorial
set CWD=%cd%
set CWD=/%CWD:\=/%
set WNDIR=
rem #JE: for finding xsltproc
set path=c:\3rdparty\bin;%path%
rem #EndAngel
del results\*.*
rem #####################
rem # Matching
java -jar ../../lib/procalign.jar file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl
java -jar ../../lib/procalign.jar file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\equal.rdf
java -jar ../../lib/procalign.jar file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\equal.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\levenshtein.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\levenshtein.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\SMOA.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\SMOA.html
java -jar ../../lib/procalign.jar -Dwndict=%WNDIR% -i fr.inrialpes.exmo.align.ling.JWNLAlignment file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\jwnl.rdf
java -jar ../../lib/procalign.jar -Dwndict=%WNDIR% -i fr.inrialpes.exmo.align.ling.JWNLAlignment file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\jwnl.html
rem #####################
rem # Manipulating
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.33 file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\levenshtein33.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.33 file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\levenshtein33.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance -t 0.5 file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -o results\SMOA5.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance -t 0.5 file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\SMOA5.html
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter -i results\SMOA5.rdf -o results\AOMS5.rdf
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter -i results\SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\AOMS5.html
rem #####################
rem # Outputing
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results\SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results\SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.SWRLRendererVisitor
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results\SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.XSLTRendererVisitor -o results\SMOA5.xsl
xsltproc results\SMOA5.xsl data.xml > results\data.xml
rem #####################
rem # Evaluating
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter refalign.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results\refalign.html
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://%CWD%/refalign.rdf file://%CWD%/results/equal.rdf
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://%CWD%/refalign.rdf file://%CWD%/results/levenshtein33.rdf
rem # This is for printing distance matrix
rem #java -jar ../../lib/Procalign.jar file://%CWD%/rdf/myOnto.owl file://%CWD%/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -DprintMatrix=1 -o /dev/null > matrix.tex
copy refalign.rdf results
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.GroupEval -r refalign.rdf -l "refalign,equal,SMOA,SMOA5,levenshtein,levenshtein33" -c prf -o results\eval.html
rem #####################
rem # Embedding
javac -classpath ../../lib/align.jar;../../lib/procalign.jar;results -d results Skeleton.java
java -cp ../../lib/procalign.jar;results Skeleton file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl
javac -classpath ../../lib/align.jar;../../lib/procalign.jar -d results MyApp.java
java -cp ../../lib/procalign.jar;results MyApp file://%CWD%/myOnto.owl file://%CWD%/edu.mit.visus.bibtex.owl
#!/bin/csh
#####################
# Preparation
#mkdir alignapi
#cd alignapi
#unzip align*.zip
#java -jar lib/procalign.jar --help
#cd html/tutorial
setenv CWD `pwd`
setenv WNDIR ../../../WordNet-2.0/dict
/bin/rm results/*
#####################
# Matching
java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl
java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/equal.rdf
java -jar ../../lib/procalign.jar file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/equal.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/levenshtein.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/levenshtein.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/levenshtein.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/SMOA.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/SMOA.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/SMOA.html
java -jar ../../lib/procalign.jar -Dwndict=$WNDIR -i fr.inrialpes.exmo.align.ling.JWNLAlignment file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/jwnl.rdf
java -jar ../../lib/procalign.jar -Dwndict=$WNDIR -i fr.inrialpes.exmo.align.ling.JWNLAlignment file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/jwnl.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/jwnl.html
#####################
# Manipulating
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.33 file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/levenshtein33.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.33 file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/levenshtein33.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/levenshtein33.html
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance -t 0.5 file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/SMOA5.rdf
java -jar ../../lib/procalign.jar -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=smoaDistance -t 0.5 file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl -o results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/SMOA5.html
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -i -o results/AOMS5.rdf
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -i -o results/AOMS5.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/AOMS5.html
#####################
# Outputing
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.SWRLRendererVisitor
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter results/SMOA5.rdf -r fr.inrialpes.exmo.align.impl.renderer.XSLTRendererVisitor -o results/SMOA5.xsl
xsltproc results/SMOA5.xsl data.xml > results/data.xml
#####################
# Evaluating
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter refalign.rdf -r fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor -o results/refalign.html
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://$CWD/refalign.rdf file://$CWD/results/equal.rdf
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://$CWD/refalign.rdf file://$CWD/results/levenshtein33.rdf
# This is for printing distance matrix
#java -jar ../../lib/Procalign.jar file://$CWD/rdf/myOnto.owl file://$CWD/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -DprintMatrix=1 -o /dev/null > matrix.tex
cp refalign.rdf results
java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.util.GroupEval -r refalign.rdf -l "refalign,equal,SMOA,SMOA5,levenshtein,levenshtein33" -c prf -o results/eval.html
#####################
# Embedding
javac -classpath ../../lib/align.jar:../../lib/procalign.jar -d results Skeleton.java
java -cp ../../lib/Procalign.jar:results Skeleton file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl
javac -classpath ../../lib/align.jar:../../lib/procalign.jar -d results MyApp.java
java -cp ../../lib/Procalign.jar:results MyApp file://$CWD/myOnto.owl file://$CWD/edu.mit.visus.bibtex.owl > results/MyApp.owl
File moved
File moved
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment