diff --git a/html/tutorial/index.html b/html/tutorial/index.html index d7406ed79d02c7c57a7e437af9b32a0d53004de6..6dff703a74354e822c566c72833148a5ddbde224 100644 --- a/html/tutorial/index.html +++ b/html/tutorial/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <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 name="Contributor" content="Antoine Zimmermann" /> <link rel="stylesheet" type="text/css" href="../base.css" /> @@ -33,31 +33,72 @@ div.logic { </head> <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> <dt>This version:</dt> <dd>http://alignapi.gforge.inria.fr/tutorial/</dd> <dt>Author:</dt> -<dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA & LIG +<dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA & LIG </dd> </dl> -<p style="border-bottom: 2px solid #AAAAAA; border-top: 2px solid - #AAAAAA; padding-top: 15px; padding-bottom: 15px;">Here is a - 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 make no garantee on the MS-DOS script, it is only here for helping. +<p style="border-top: 2px solid + #AAAAAA; padding-top: 15px; padding-bottom: 15px;"> +We have developed a series a tutorials so that any kind of user can +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>A small <a href="server.html">companion tutorial</a> has been designed for the Alignment - Server. It follows, as much as possible, the reasoning of this - tutorial but provides input and output through a web browser.</p> -<small>This tutorial has been designed for the Alignment API version - 2.4 (it has been updated to work with version 3.6).</small> - +<p> +We also have +some <a href="http://gforge.inria.fr/docman/index.php?group_id=117&selected_doc_group_id=1812"><b>Documentation</b></a> +available. However, it is easily out of date. +</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> - + +<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 - 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> <div class="fragment"> @@ -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>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> <div class="fragment"> @@ -105,7 +146,7 @@ $ cd html/tutorial </div> <p>You can clean up previous trials by:</p> <div class="fragment"> -$ rm results/* +$ rm */results/* </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> @@ -114,502 +155,32 @@ $ setenv CWD `pwd` </div> <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> -<div class="fragment"> -$ 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> +<p> +Now you can go back to any of the tutorials: <ul> -<li>displaying debug information (-d);</li> -<li>controling the way of rendering the output (-r);</li> -<li>deciding the implementation of the alignment method (-i);</li> -<li>providing an input alignment (-a) [implemented but not used by most methods].</li> +<li><a href="tutorial1/index.html">Using the Alignment API</a></li> +<li><a href="tutorial1/server.html">Manipulating Alignments through a Web client</a></li> +<li><a href="tutorial2/index.html">Manipulating alignments in Java programs</a></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> - -<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>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>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> -<?xml version='1.0' encoding='utf-8' standalone='no'?> -<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#'> -<Alignment> - <xml>yes</xml> - <level>0</level> - <type>**</type> - <method>fr.inrialpes.exmo.align.impl.method.StringDistAlignment</method> - <time>18</time> - <onto1> - <Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"> - <location>file:///Java/alignapi/html/tutorial/myOnto.owl</location> - <formalism> - <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> - </formalism> - </Ontology> - </onto1> - <onto2> - <Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"> - <location>file:///Java/alignapi/html/tutorial/edu.mit.visus.bibtex.owl</location> - <formalism> - <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> - </formalism> - </Ontology> - </onto2> -</pre></div> -<p>and the corresponding set of correspondences:</p> -<div class="owl"><pre> - <map> - <Cell> - <entity1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Article"/> - <entity2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Article"/> - <measure rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1.0</measure> - <relation>=</relation> - </Cell> - </map> -</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> - <owl:Class rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"> - <owl:equivalentClass rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/> - </owl:Class> - - <owl:ObjectProperty rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"> - <owl:equivalentProperty rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/> - </owl:ObjectProperty> -</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> - <ruleml:imp> - <ruleml:_body> - <swrl:classAtom> - <owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"/> - <ruleml:var>x</ruleml:var> - </swrl:classAtom> - </ruleml:_body> - <ruleml:_head> - <swrlx:classAtom> - <owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/> - <ruleml:var>x</ruleml:var> - </swrl:classAtom> - </ruleml:_head> - </ruleml:imp> - - <ruleml:imp> - <ruleml:_body> - <swrl:individualPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"/> - <ruleml:var>x</ruleml:var> - <ruleml:var>y</ruleml:var> - </swrl:individualPropertyAtom> - </ruleml:_body> - <ruleml:_head> - <swrl:datavaluedPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/> - <ruleml:var>x</ruleml:var> - <ruleml:var>y</ruleml:var> - </swrl:datavaluedPropertyAtom> - </ruleml:_head> - </ruleml:imp> -</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> -<?xml version='1.0' encoding='utf-8' standalone='yes'?> -<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#'> - <map:output rdf:about=''> - <map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/> - <map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/> - <map:precision>1.0</map:precision> - <map:recall>0.3541666666666667</map:recall> - <fallout>0.0</fallout> - <map:fMeasure>0.5230769230769231</map:fMeasure> - <map:oMeasure>0.3541666666666667</map:oMeasure> - <time>22</time> - <result>0.3541666666666667</result> - </map:output> -</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> -<?xml version='1.0' encoding='utf-8' standalone='yes'?> -<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#'> - <map:output rdf:about=''> - <map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/> - <map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/> - <map:precision>0.6153846153846154</map:precision> - <map:recall>1.0</map:recall> - <fallout>0.38461538461538464</fallout> - <map:fMeasure>0.761904761904762</map:fMeasure> - <map:oMeasure>0.375</map:oMeasure> - <time>28</time> - <result>1.625</result> - </map:output> -</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> +<!--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> <div class="fragment"> -$ 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 -</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"/> +$ xsltproc ../form-align.xsl results/file.rdf > results/file.html </div> -<div class="explain" id="qu7"><p>The main piece of code in Skeleton.java is replaced by:</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> +<p>generates <tt>results/file.html</tt> from the alignment file <tt>results/file.rdf</tt>.</p--> -<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> -<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 /> -<small> -<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/</p> -</small> +<address> +<div style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/</div> <hr /> -<p>$Id$</p> +$Id$ +</address> </body> </html> diff --git a/html/tutorial/script.bat b/html/tutorial/script.bat deleted file mode 100755 index 588bd32336c37a798673eada5878ec2b1c44ae3a..0000000000000000000000000000000000000000 --- a/html/tutorial/script.bat +++ /dev/null @@ -1,97 +0,0 @@ -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 - - diff --git a/html/tutorial/script.sh b/html/tutorial/script.sh deleted file mode 100644 index a40a207918d08987c693fb6c2d0a30daf994cf1d..0000000000000000000000000000000000000000 --- a/html/tutorial/script.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/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 diff --git a/html/tutorial/MyApp.java b/html/tutorial/tutorial1/MyApp.java similarity index 100% rename from html/tutorial/MyApp.java rename to html/tutorial/tutorial1/MyApp.java diff --git a/html/tutorial/data.xml b/html/tutorial/tutorial1/data.xml similarity index 100% rename from html/tutorial/data.xml rename to html/tutorial/tutorial1/data.xml diff --git a/html/tutorial/file_properties.xml b/html/tutorial/tutorial1/file_properties.xml similarity index 100% rename from html/tutorial/file_properties.xml rename to html/tutorial/tutorial1/file_properties.xml diff --git a/html/tutorial/tutorial1/index.html b/html/tutorial/tutorial1/index.html new file mode 100644 index 0000000000000000000000000000000000000000..cec3690abe282855a43d52d544ea3adc76ef00e4 --- /dev/null +++ b/html/tutorial/tutorial1/index.html @@ -0,0 +1,480 @@ +<?xml version="1.0"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<title>Using the Alignment API: a small tutorial on the Alignment API</title> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="../../base.css" /> +<link rel="stylesheet" type="text/css" href="../../style.css" /> +<script type="text/javascript"> +<!-- +function show(id) { + var element = document.getElementById(id); + element.style.display = "block"; +} +function hide(id) { + var element = document.getElementById(id); + element.style.display = "none"; +} +--> +</script> +<style type="text/css"> +<!-- +div.logic { + padding-left: 5px; + padding-right: 5px; + margin-top: 10px; + margin-bottom: 10px; +} +--> +</style> +</head> +<body style="background-color: #FFFFFF;"> + +<h1>Using the Alignment API: a small tutorial on the Alignment <abbr title="Application Programming Interface">API</abbr></h1> + +<dl> +<dt>This version:</dt> +<dd>http://alignapi.gforge.inria.fr/tutorial/tutorial1/</dd> +<dt>Author:</dt> +<dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA & LIG +</dd> +</dl> + +<p style="border-bottom: 2px solid #AAAAAA; border-top: 2px solid + #AAAAAA; padding-top: 15px; padding-bottom: 15px;"> +Here is a 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 <a href="../tutotial3/embbed.html">embedded in some application programme</a> and we are working towards implementing an <a href="server.html">alignment server</a> 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 make no garantee on the MS-DOS script, it is only here for helping. +</p> +<p>A <a href="server.html">companion tutorial</a> has been designed for the Alignment + Server. It follows, as much as possible, the reasoning of this + tutorial but provides input and output through a web browser.</p> +<div style="font-size: 75%;">This tutorial has been designed for the Alignment API version + 2.4 (it has been updated to work with version 4.0).</div> + +<h2>Preparation</h2> + +<p> +First you must download the Alignment API and check that it works +as indicated <a href="../index.html">here</a>.</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 directory of this tutorial by doing:</p> +<div class="fragment"> +$ cd tutorial1 +</div> +<p>You can clean up previous trials by:</p> +<div class="fragment"> +$ rm results/* +</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 (which +only affects the <tt>setenv</tt> command).</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> +<div class="fragment"> +$ 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 +(<tt>$CWD</tt> is a variable that <a href="../index.html">has been +set up</a> to the directory just above this one):</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> +<li>displaying debug information (-d);</li> +<li>controling the way of rendering the output (-r);</li> +<li>deciding the implementation of the alignment method (-i);</li> +<li>providing an input alignment (-a) [implemented but not used by most methods].</li> +</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>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>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> +<?xml version='1.0' encoding='utf-8' standalone='no'?> +<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#'> +<Alignment> + <xml>yes</xml> + <level>0</level> + <type>**</type> + <method>fr.inrialpes.exmo.align.impl.method.StringDistAlignment</method> + <time>18</time> + <onto1> + <Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"> + <location>file:///Java/alignapi/html/tutorial/myOnto.owl</location> + <formalism> + <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> + </formalism> + </Ontology> + </onto1> + <onto2> + <Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"> + <location>file:///Java/alignapi/html/tutorial/edu.mit.visus.bibtex.owl</location> + <formalism> + <Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> + </formalism> + </Ontology> + </onto2> +</pre></div> +<p>and the corresponding set of correspondences:</p> +<div class="owl"><pre> + <map> + <Cell> + <entity1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Article"/> + <entity2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Article"/> + <measure rdf:datatype="http://www.w3.org/2001/XMLSchema#float">1.0</measure> + <relation>=</relation> + </Cell> + </map> +</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 3.0 is installed):</p> +<div class="fragment"> +$ java -cp ../../../lib/procalign.jar:../../../lib/jwnl/jwnl.jar fr.inrialpes.exmo.align.impl.util.Procalign -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> + <owl:Class rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"> + <owl:equivalentClass rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/> + </owl:Class> + + <owl:ObjectProperty rdf:about="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"> + <owl:equivalentProperty rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/> + </owl:ObjectProperty> +</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> + <ruleml:imp> + <ruleml:_body> + <swrl:classAtom> + <owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport"/> + <ruleml:var>x</ruleml:var> + </swrl:classAtom> + </ruleml:_body> + <ruleml:_head> + <swrlx:classAtom> + <owllx:Class owllx:name="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport"/> + <ruleml:var>x</ruleml:var> + </swrl:classAtom> + </ruleml:_head> + </ruleml:imp> + + <ruleml:imp> + <ruleml:_body> + <swrl:individualPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright"/> + <ruleml:var>x</ruleml:var> + <ruleml:var>y</ruleml:var> + </swrl:individualPropertyAtom> + </ruleml:_body> + <ruleml:_head> + <swrl:datavaluedPropertyAtom swrlx:property="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright"/> + <ruleml:var>x</ruleml:var> + <ruleml:var>y</ruleml:var> + </swrl:datavaluedPropertyAtom> + </ruleml:_head> + </ruleml:imp> +</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/tutorial1/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> +<?xml version='1.0' encoding='utf-8' standalone='yes'?> +<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#'> + <map:output rdf:about=''> + <map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/> + <map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/> + <map:precision>1.0</map:precision> + <map:recall>0.3541666666666667</map:recall> + <fallout>0.0</fallout> + <map:fMeasure>0.5230769230769231</map:fMeasure> + <map:oMeasure>0.3541666666666667</map:oMeasure> + <time>22</time> + <result>0.3541666666666667</result> + </map:output> +</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/tutorial1/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> +<?xml version='1.0' encoding='utf-8' standalone='yes'?> +<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#'> + <map:output rdf:about=''> + <map:input1 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/myOnto.owl"/> + <map:input2 rdf:resource="http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl"/> + <map:precision>0.6153846153846154</map:precision> + <map:recall>1.0</map:recall> + <fallout>0.38461538461538464</fallout> + <map:fMeasure>0.761904761904762</map:fMeasure> + <map:oMeasure>0.375</map:oMeasure> + <time>28</time> + <result>1.625</result> + </map:output> +</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>Further exercises</h2> + +<p>More info: <a href="http://alignapi.gforge.inria.fr">http://alignapi.gforge.inria.fr</a></p> + +<hr /> +<small> +<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/tutorial1/</p> +</small> +<hr /> +<p>$Id$</p> +</body> +</html> diff --git a/html/tutorial/results/refalign.rdf b/html/tutorial/tutorial1/refalign.rdf similarity index 100% rename from html/tutorial/results/refalign.rdf rename to html/tutorial/tutorial1/refalign.rdf diff --git a/html/tutorial/results/AOMS5.html b/html/tutorial/tutorial1/results/AOMS5.html similarity index 100% rename from html/tutorial/results/AOMS5.html rename to html/tutorial/tutorial1/results/AOMS5.html diff --git a/html/tutorial/results/AOMS5.rdf b/html/tutorial/tutorial1/results/AOMS5.rdf similarity index 100% rename from html/tutorial/results/AOMS5.rdf rename to html/tutorial/tutorial1/results/AOMS5.rdf diff --git a/html/tutorial/results/MyApp.owl b/html/tutorial/tutorial1/results/MyApp.owl similarity index 100% rename from html/tutorial/results/MyApp.owl rename to html/tutorial/tutorial1/results/MyApp.owl diff --git a/html/tutorial/results/SMOA.html b/html/tutorial/tutorial1/results/SMOA.html similarity index 100% rename from html/tutorial/results/SMOA.html rename to html/tutorial/tutorial1/results/SMOA.html diff --git a/html/tutorial/results/SMOA.rdf b/html/tutorial/tutorial1/results/SMOA.rdf similarity index 100% rename from html/tutorial/results/SMOA.rdf rename to html/tutorial/tutorial1/results/SMOA.rdf diff --git a/html/tutorial/results/SMOA5.html b/html/tutorial/tutorial1/results/SMOA5.html similarity index 100% rename from html/tutorial/results/SMOA5.html rename to html/tutorial/tutorial1/results/SMOA5.html diff --git a/html/tutorial/results/SMOA5.rdf b/html/tutorial/tutorial1/results/SMOA5.rdf similarity index 100% rename from html/tutorial/results/SMOA5.rdf rename to html/tutorial/tutorial1/results/SMOA5.rdf diff --git a/html/tutorial/results/SMOA5.xsl b/html/tutorial/tutorial1/results/SMOA5.xsl similarity index 100% rename from html/tutorial/results/SMOA5.xsl rename to html/tutorial/tutorial1/results/SMOA5.xsl diff --git a/html/tutorial/results/data.xml b/html/tutorial/tutorial1/results/data.xml similarity index 100% rename from html/tutorial/results/data.xml rename to html/tutorial/tutorial1/results/data.xml diff --git a/html/tutorial/results/equal.html b/html/tutorial/tutorial1/results/equal.html similarity index 100% rename from html/tutorial/results/equal.html rename to html/tutorial/tutorial1/results/equal.html diff --git a/html/tutorial/results/equal.rdf b/html/tutorial/tutorial1/results/equal.rdf similarity index 100% rename from html/tutorial/results/equal.rdf rename to html/tutorial/tutorial1/results/equal.rdf diff --git a/html/tutorial/results/eval.html b/html/tutorial/tutorial1/results/eval.html similarity index 100% rename from html/tutorial/results/eval.html rename to html/tutorial/tutorial1/results/eval.html diff --git a/html/tutorial/results/jwnl.html b/html/tutorial/tutorial1/results/jwnl.html similarity index 100% rename from html/tutorial/results/jwnl.html rename to html/tutorial/tutorial1/results/jwnl.html diff --git a/html/tutorial/results/jwnl.rdf b/html/tutorial/tutorial1/results/jwnl.rdf similarity index 100% rename from html/tutorial/results/jwnl.rdf rename to html/tutorial/tutorial1/results/jwnl.rdf diff --git a/html/tutorial/results/levenshtein.html b/html/tutorial/tutorial1/results/levenshtein.html similarity index 100% rename from html/tutorial/results/levenshtein.html rename to html/tutorial/tutorial1/results/levenshtein.html diff --git a/html/tutorial/results/levenshtein.rdf b/html/tutorial/tutorial1/results/levenshtein.rdf similarity index 100% rename from html/tutorial/results/levenshtein.rdf rename to html/tutorial/tutorial1/results/levenshtein.rdf diff --git a/html/tutorial/results/levenshtein33.html b/html/tutorial/tutorial1/results/levenshtein33.html similarity index 100% rename from html/tutorial/results/levenshtein33.html rename to html/tutorial/tutorial1/results/levenshtein33.html diff --git a/html/tutorial/results/levenshtein33.rdf b/html/tutorial/tutorial1/results/levenshtein33.rdf similarity index 100% rename from html/tutorial/results/levenshtein33.rdf rename to html/tutorial/tutorial1/results/levenshtein33.rdf diff --git a/html/tutorial/results/refalign.html b/html/tutorial/tutorial1/results/refalign.html similarity index 100% rename from html/tutorial/results/refalign.html rename to html/tutorial/tutorial1/results/refalign.html diff --git a/html/tutorial/tutorial1/results/refalign.rdf b/html/tutorial/tutorial1/results/refalign.rdf new file mode 100644 index 0000000000000000000000000000000000000000..624fcbd09254f4cc8f776ca6a50602b09fc1ae66 --- /dev/null +++ b/html/tutorial/tutorial1/results/refalign.rdf @@ -0,0 +1,408 @@ +<?xml version='1.0' encoding='utf-8' standalone='no'?> +<rdf:RDF xmlns='http://knowledgeweb.semanticweb.org/heterogeneity/alignment#' + xml:base='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#'> +<Alignment> + <xml>yes</xml> + <level>0</level> + <type>11</type> + <method>Manually generated</method> + <onto1>file://localhost/JAVA/alignapi/html/tutorial/myOnto.owl</onto1> + <onto2>file://localhost/JAVA/alignapi/html/tutorial/edu.mit.visus.bibtex.owl</onto2> + <uri1>http://alignapi.gforge.inria.fr/tutorial/myOnto.owl</uri1> + <uri2>http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl</uri2> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#InProceedings'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Inproceedings'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#key'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasKey'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Entry'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Entry'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#contents'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasContents'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#lang'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasLanguage'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#keywords'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasKeywords'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#size'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasSize'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#type'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasType'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#howPublished'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#howPublished'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#volume'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasVolume'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#month'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasMonth'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#copyright'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasCopyright'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#chapter'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasChapter'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#InBook'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Inbook'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#editor'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasEditor'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#series'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasSeries'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#title'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasTitle'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Booklet'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Booklet'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#numberOrVolume'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasVolume'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Unpublished'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Unpublished'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#MastersThesis'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Mastersthesis'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>0.9230769230769231</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#inJournal'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasJournal'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <!--map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#mrNumber'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasNumber'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map--> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#pages'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasPages'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#edition'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasEdition'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#affiliation'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasAffiliation'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#year'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasYear'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#organization'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasOrganization'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#school'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasSchool'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#publisher'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasPublisher'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Misc'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Misc'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Techreport'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#institution'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasInstitution'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#abstract'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasAbstract'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#location'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasLocation'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Article'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Article'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#price'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasPrice'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Book'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Book'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#PhdThesis'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Phdthesis'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Proceedings'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Proceedings'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#number'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasNumber'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#TechReport'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Techreport'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#InCollection'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Incollection'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#author'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasAuthor'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#note'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasNote'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#humanCreator'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#humanCreator'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#pagesOrChapter'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasChapter'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#Manual'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#Manual'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> + <map> + <Cell> + <entity1 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/myOnto.owl#language'/> + <entity2 rdf:resource='http://alignapi.gforge.inria.fr/tutorial/edu.mit.visus.bibtex.owl#hasLanguage'/> + <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>1.0</measure> + <relation>=</relation> + </Cell> + </map> +</Alignment> +</rdf:RDF> diff --git a/html/tutorial/tutorial1/script.bat b/html/tutorial/tutorial1/script.bat new file mode 100755 index 0000000000000000000000000000000000000000..edac78d5249a1e12431e05ea837aafa814ad230a --- /dev/null +++ b/html/tutorial/tutorial1/script.bat @@ -0,0 +1,91 @@ +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 + +rem JE: HERE IT SHOULD BE THE PREVIOUS DIRECTORY +cd .. +set CWD=%cd% +cd tutorial1 +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 -cp ../../../lib/procalign.jar:../../../lib/jwnl/jwnl.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 -cp ../../../lib/procalign.jar:../../../lib/jwnl/jwnl.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%/tutorial1/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/tutorial1/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 + +rem JE: ?? +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 -f prm -o results\eval.html + + + diff --git a/html/tutorial/tutorial1/script.sh b/html/tutorial/tutorial1/script.sh new file mode 100644 index 0000000000000000000000000000000000000000..6c7dcfa5d5194d47e229357451c328be35cf6b6e --- /dev/null +++ b/html/tutorial/tutorial1/script.sh @@ -0,0 +1,80 @@ +#!/bin/csh + +##################### +# Preparation + +#mkdir alignapi +#cd alignapi +#unzip align*.zip +#java -jar lib/procalign.jar --help +#cd html/tutorial +cd .. +setenv CWD `pwd` +cd tutorial1 +setenv WNDIR ../../../../WordNet-3.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 -cp ../../../lib/procalign.jar:../../../lib/jwnl/jwnl.jar fr.inrialpes.exmo.align.util.Procalign -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 -cp ../../../lib/procalign.jar:../../../lib/jwnl/jwnl.jar fr.inrialpes.exmo.align.util.Procalign -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 + +##################### +# 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/tutorial1/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/tutorial1/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 -f prm -o results/eval.html + diff --git a/html/tutorial/server.html b/html/tutorial/tutorial1/server.html similarity index 95% rename from html/tutorial/server.html rename to html/tutorial/tutorial1/server.html index 0ad5c12429468b5d4a4769f4c6dd461e80789e6d..572f90d763898a532179208824aa7ed30346897e 100644 --- a/html/tutorial/server.html +++ b/html/tutorial/tutorial1/server.html @@ -3,11 +3,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> -<title>A tutorial companion for the Alignment server</title> +<title>Manipulating alignments through a web client</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> -<meta name="Contributor" content="Antoine Zimmermann" /> -<link rel="stylesheet" type="text/css" href="../base.css" /> -<link rel="stylesheet" type="text/css" href="../style.css" /> +<link rel="stylesheet" type="text/css" href="../../base.css" /> +<link rel="stylesheet" type="text/css" href="../../style.css" /> <script type="text/javascript"> <!-- function show(id) { @@ -33,11 +32,11 @@ div.logic { </head> <body style="background-color: #FFFFFF;"> -<h1>A tutorial companion for the Alignment server</h1> +<h1>Manipulating alignments through a web client: a tutorial companion for the Alignment server</h1> <dl> <dt>This version:</dt> -<dd>http://alignapi.gforge.inria.fr/tutorial/</dd> +<dd>http://alignapi.gforge.inria.fr/tutorial/tutorial1/server.html</dd> <dt>Author:</dt> <dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA Rhône-Alpes </dd> @@ -196,7 +195,7 @@ Planning: <hr /> <small> -<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/server.html</p> +<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial//tutorial1/server.html</p> </small> <hr /> <p>$Id: index.html 384 2007-02-02 11:09:40Z euzenat $</p> diff --git a/html/tutorial/server/align1.png b/html/tutorial/tutorial1/server/align1.png similarity index 100% rename from html/tutorial/server/align1.png rename to html/tutorial/tutorial1/server/align1.png diff --git a/html/tutorial/server/align2.png b/html/tutorial/tutorial1/server/align2.png similarity index 100% rename from html/tutorial/server/align2.png rename to html/tutorial/tutorial1/server/align2.png diff --git a/html/tutorial/server/align3.png b/html/tutorial/tutorial1/server/align3.png similarity index 100% rename from html/tutorial/server/align3.png rename to html/tutorial/tutorial1/server/align3.png diff --git a/html/tutorial/server/align4.png b/html/tutorial/tutorial1/server/align4.png similarity index 100% rename from html/tutorial/server/align4.png rename to html/tutorial/tutorial1/server/align4.png diff --git a/html/tutorial/server/align5.png b/html/tutorial/tutorial1/server/align5.png similarity index 100% rename from html/tutorial/server/align5.png rename to html/tutorial/tutorial1/server/align5.png diff --git a/html/tutorial/server/format1.png b/html/tutorial/tutorial1/server/format1.png similarity index 100% rename from html/tutorial/server/format1.png rename to html/tutorial/tutorial1/server/format1.png diff --git a/html/tutorial/server/format2.png b/html/tutorial/tutorial1/server/format2.png similarity index 100% rename from html/tutorial/server/format2.png rename to html/tutorial/tutorial1/server/format2.png diff --git a/html/tutorial/server/format3.png b/html/tutorial/tutorial1/server/format3.png similarity index 100% rename from html/tutorial/server/format3.png rename to html/tutorial/tutorial1/server/format3.png diff --git a/html/tutorial/server/interf.png b/html/tutorial/tutorial1/server/interf.png similarity index 100% rename from html/tutorial/server/interf.png rename to html/tutorial/tutorial1/server/interf.png diff --git a/html/tutorial/server/interf2.png b/html/tutorial/tutorial1/server/interf2.png similarity index 100% rename from html/tutorial/server/interf2.png rename to html/tutorial/tutorial1/server/interf2.png diff --git a/html/tutorial/server/invert1.png b/html/tutorial/tutorial1/server/invert1.png similarity index 100% rename from html/tutorial/server/invert1.png rename to html/tutorial/tutorial1/server/invert1.png diff --git a/html/tutorial/server/match2.png b/html/tutorial/tutorial1/server/match2.png similarity index 100% rename from html/tutorial/server/match2.png rename to html/tutorial/tutorial1/server/match2.png diff --git a/html/tutorial/server/match3.png b/html/tutorial/tutorial1/server/match3.png similarity index 100% rename from html/tutorial/server/match3.png rename to html/tutorial/tutorial1/server/match3.png diff --git a/html/tutorial/server/matching1.png b/html/tutorial/tutorial1/server/matching1.png similarity index 100% rename from html/tutorial/server/matching1.png rename to html/tutorial/tutorial1/server/matching1.png diff --git a/html/tutorial/server/result1.png b/html/tutorial/tutorial1/server/result1.png similarity index 100% rename from html/tutorial/server/result1.png rename to html/tutorial/tutorial1/server/result1.png diff --git a/html/tutorial/server/retr1.png b/html/tutorial/tutorial1/server/retr1.png similarity index 100% rename from html/tutorial/server/retr1.png rename to html/tutorial/tutorial1/server/retr1.png diff --git a/html/tutorial/server/retr2.png b/html/tutorial/tutorial1/server/retr2.png similarity index 100% rename from html/tutorial/server/retr2.png rename to html/tutorial/tutorial1/server/retr2.png diff --git a/html/tutorial/server/retr3.png b/html/tutorial/tutorial1/server/retr3.png similarity index 100% rename from html/tutorial/server/retr3.png rename to html/tutorial/tutorial1/server/retr3.png diff --git a/html/tutorial/server/roro.html b/html/tutorial/tutorial1/server/roro.html similarity index 100% rename from html/tutorial/server/roro.html rename to html/tutorial/tutorial1/server/roro.html diff --git a/html/tutorial/server/trim1.png b/html/tutorial/tutorial1/server/trim1.png similarity index 100% rename from html/tutorial/server/trim1.png rename to html/tutorial/tutorial1/server/trim1.png diff --git a/html/tutorial2/MyApp.java b/html/tutorial/tutorial2/MyApp.java similarity index 100% rename from html/tutorial2/MyApp.java rename to html/tutorial/tutorial2/MyApp.java diff --git a/html/tutorial2/Skeleton.java b/html/tutorial/tutorial2/Skeleton.java similarity index 100% rename from html/tutorial2/Skeleton.java rename to html/tutorial/tutorial2/Skeleton.java diff --git a/html/tutorial2/index.html b/html/tutorial/tutorial2/index.html similarity index 74% rename from html/tutorial2/index.html rename to html/tutorial/tutorial2/index.html index 943f3a69a697aaa8e424199d7626f21d3394f0a3..be29e235a49cc674ddbc2b33a7e3a2dce6d4c44e 100644 --- a/html/tutorial2/index.html +++ b/html/tutorial/tutorial2/index.html @@ -3,11 +3,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> -<title>Advanced tutorial on the Alignment API</title> +<title>Manipulating alignments in Java programs</title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> -<meta name="Contributor" content="Antoine Zimmermann" /> -<link rel="stylesheet" type="text/css" href="../base.css" /> -<link rel="stylesheet" type="text/css" href="../style.css" /> +<link rel="stylesheet" type="text/css" href="../../base.css" /> +<link rel="stylesheet" type="text/css" href="../../style.css" /> <script type="text/javascript"> <!-- function show(id) { @@ -33,11 +32,11 @@ div.logic { </head> <body style="background-color: #FFFFFF;"> -<h1>Advanced tutorial on the Alignment <abbr title="Application Programming Interface">API</abbr> and server</h1> +<h1>Manipulating alignments in Java programs: advanced tutorial on the Alignment <abbr title="Application Programming Interface">API</abbr> and server</h1> <dl> <dt>This version:</dt> -<dd>http://alignapi.gforge.inria.fr/tutorial2/</dd> +<dd>http://alignapi.gforge.inria.fr/tutorial/tutorial2/</dd> <dt>Author:</dt> <dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA & LIG </dd> @@ -45,9 +44,10 @@ div.logic { <p style="border-top: 2px solid #AAAAAA; padding-top: 15px; padding-bottom: 15px;"> -Here is a more advanced tutorial for the -alignment <abbr>API</abbr>. -This tutorial will learn you to: +Here is a more advanced tutorial for the +alignment <abbr>API</abbr> which explains how to interface the API +with other components. +This tutorial will show how to: <ul> <li>communicate the alignment server through its REST web service API,</li> @@ -65,28 +65,19 @@ A more <a href="../tutorial/index.html">simple tutorial</a> as well as <h2>Preparation</h2> -<p> -See the <a href="../tutorial/index.html">simple tutorial -preparation part</a>. -</p> -<p> -Looking at the last section of this tutorial can help to manipulate -the Alignment API constructs alone. In the present tutorial, we will -interface the Alignment API with other components: -<ul> -<li>The Alignment server as a web service;</li> -<li>A SPARQL reasoner (<a href=""></a>ARQ) using <a href=""></a>Jena;</li> -<li>An OWL reasoner (<a href=""></a>Pellet) using OWL API.</li> -</ul> +<p>Just: +<div class="fragment"> +$ cd tutorial2 +</div> </p> <h2>Data</h2> <p> We have two ontologies, <a href="ontology1.owl">ontology1.owl</a> -and <a href="ontology2.owl">ontology2.owl</a>, under which two half of -the summerschool participants are described. Unfortunately, the -organiser started to record participants with their own ontology +and <a href="ontology2.owl">ontology2.owl</a>, under which two sets of +students are described. Unfortunately, the +administration started to record participants with their own ontology before recogning that using <a href="http://foaf-project.org">FOAF</a> would be a better idea. We now end up with two incomplete lists of participants. @@ -94,19 +85,21 @@ participants. <p> The goal is to have a unified view of these participants. For that purpose, we will match the two ontologies and reason with the result -in order to +in order to view participants from boths ontologies under the other +ontology. This is not a difficult task, the goal here is only to show +how this could be achieved. </p> <p>For that purpose, you have to develop a program in Java. This programme can be compiled by: <div class="fragment"> -$ javac -classpath ../../lib/align.jar:../../lib/procalign.jar:../../lib/jena/jena.jar:../../lib/jena/arq.jar:../../lib/iddl/iddl.jar:../../lib/pellet/pellet.jar MyApp.java +$ javac -classpath ../../../lib/align.jar:../../../lib/procalign.jar:../../../lib/jena/jena.jar:../../../lib/jena/arq.jar:../../../lib/iddl/iddl.jar:../../../lib/pellet/pellet.jar MyApp.java </div> and run by: <div class="fragment"> -$ java -classpath .:../../lib/align.jar:../../lib/procalign.jar:../../lib/jena/jena.jar:../../lib/jena/arq.jar:../../lib/iddl/iddl.jar:../../lib/pellet/pellet.jar:../../lib/ontosim/ontosim.jar:../../lib/log4j/commons-logging.jar:../../lib/log4j/log4j.jar:../../lib/xerces/xercesImpl.jar:../../lib/jena/iri.jar:../../lib/jena/icu4j_3_4.jar:../../lib/jena/concurrent.jar:../../lib/pellet/relaxngDatatype.jar:../../lib/pellet/xsdlib.jar MyApp +$ java -classpath .:../../../lib/align.jar:../../../lib/procalign.jar:../../../lib/jena/jena.jar:../../../lib/jena/arq.jar:../../../lib/iddl/iddl.jar:../../../lib/pellet/pellet.jar:../../../lib/ontosim/ontosim.jar:../../../lib/log4j/commons-logging.jar:../../../lib/log4j/log4j.jar:../../../lib/xerces/xercesImpl.jar:../../../lib/jena/iri.jar:../../../lib/jena/icu4j_3_4.jar:../../../lib/jena/concurrent.jar:../../../lib/pellet/relaxngDatatype.jar:../../../lib/pellet/xsdlib.jar MyApp </div> -The long list of jar is boring, but at list it is explicit and you +The long list of jar is boring, but at least it is explicit and you should be safe with this one. <p> </p> @@ -144,8 +137,8 @@ and, if none is found, computes one. Alignment al = null; URI uri1 = null; URI uri2 = null; - //String u1 = "http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl"; - //String u2 = "http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl"; + //String u1 = "http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl"; + //String u2 = "http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl"; String u1 = "file:ontology1.owl"; String u2 = "file:ontology2.owl"; String method = "fr.inrialpes.exmo.align.impl.method.StringDistAlignment"; @@ -254,10 +247,13 @@ This can be done with the alignment API support. <h2>Generate the answers</h2> <p> -This can be done in two ways: +This can be done in three ways: <ul> <li>using SPARQL</li> -<li>using Pellet or something to answer these queries.</li> +<li>using a reasonner such as Pellet to answer these queries against + the merged ontologies.</li> +<li>using a "distributed" reasoner, in our case IDDL, to answer these + queries against non merged aligned ontologies.</li> </ul> </p> <p> @@ -283,13 +279,13 @@ ontologies instead of the merged one. model.read(in,"file:///tmp/myresult.owl"); in.close(); </pre> -<p>Query (please play by chaging the query)</p> +<p>Query (please play by changing the query)</p> <pre> // Create a new query String queryString = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + - "PREFIX aa: <http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl#> " + + "PREFIX aa: <http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl#> " + "SELECT ?fn ?ln ?t " + "WHERE {" + " ?student rdf:type aa:Person . " + @@ -322,16 +318,28 @@ ontologies instead of the merged one. </pre> <p>Get the instances of "Estudiantes":</p> <pre> - OWLClass estud = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl#Estudiante" ) ); - OWLClass person = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl#Person" ) ); - OWLClass student = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl#Student" ) ); + OWLClass estud = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl#Estudiante" ) ); + OWLClass person = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl#Person" ) ); + OWLClass student = manager.getOWLDataFactory().getOWLClass( URI.create( "http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl#Student" ) ); Set instances = reasoner.getIndividuals( estud, false ); System.err.println("Pellet(Merged): There are "+instances.size()+" students "+estud.getURI()); </pre> <p>Some subsumption tests:</p> <pre> - testSubClass( manager, reasoner, estud, person ); - testSubClass( manager, reasoner, estud, student ); + testPelletSubClass( manager, reasoner, estud, person ); + testPelletSubClass( manager, reasoner, estud, student ); +</pre> +<p>Such that:</p> +<pre> + public void testPelletSubClass( OWLOntologyManager manager, Reasoner reasoner, OWLDescription d1, OWLDescription d2 ) { + OWLAxiom axiom = manager.getOWLDataFactory().getOWLSubClassAxiom( d1, d2 ); + boolean isit = reasoner.isEntailed( axiom ); + if ( isit ) { + System.out.println( "Pellet(Merged): "+d1+" is subclass of "+d2 ); + } else { + System.out.println( "Pellet(Merged): "+d1+" is not necessarily subclass of "+d2 ); + } + } </pre> </div> <div class="explain" id="qu9"> @@ -352,11 +360,27 @@ ontologies instead of the merged one. System.out.println( "IDDL: the alignment network is inconsistent"); } </pre> +<p>Such that:</p> +<pre> + public void testIDDLSubClass( IDDLReasoner dreasoner, URI onto1, URI onto2, OWLDescription d1, OWLDescription d2 ) { + Alignment al2 = new ObjectAlignment(); + try { + al2.init( onto1, onto2 ); + // add the cell + al2.addAlignCell( d1, d2, "<", 1. ); + } catch (AlignmentException ae) { ae.printStackTrace(); } + if ( dreasoner.isEntailed( al2 ) ) { + System.out.println( "IDDL: "+d1+" <= "+d2+" is entailed" ); + } else { + System.out.println( "IDDL: "+d1+" <= "+d2+" is not entailed" ); + } + } +</pre> </div> The results for these execution are (for Pellet): <pre> -Pellet(Merged): There are 47 students http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl#Estudiante +Pellet(Merged): There are 47 students http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl#Estudiante Pellet(Merged): Estudiante is not necessarily subclass of Person Pellet(Merged): Estudiante is subclass of Student </pre> @@ -372,19 +396,9 @@ IDDL: Estudiante <= Student is entailed <p>Do you want to see a possible solution?</p> <p>A full working solution is <a href="MyApp.java">MyApp.java</a>.</p> - -<h2>Further exercises</h2> - -<p>More info: <a href="http://alignapi.gforge.inria.fr">http://alignapi.gforge.inria.fr</a></p> - - -<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> - <hr /> <small> -<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial2/</p> +<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/tutorial2/</p> </small> <hr /> <p>$Id$</p> diff --git a/html/tutorial/tutorial2/ontology1.owl b/html/tutorial/tutorial2/ontology1.owl new file mode 100644 index 0000000000000000000000000000000000000000..0f025f5b02f915d4f3d80f67102466b869f19e85 --- /dev/null +++ b/html/tutorial/tutorial2/ontology1.owl @@ -0,0 +1,309 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!DOCTYPE rdf:RDF [ + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY dc "http://purl.org/dc/elements/1.1/" > + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY units "http://visus.mit.edu/fontomri/0.01/units.owl#" > + <!ENTITY bibtex "http://purl.org/net/nknouf/ns/bibtex#"> + <!ENTITY dcterms "http://purl.org/dc/terms/"> + <!ENTITY dctype "http://purl.org/dc/dcmitype/"> ]> + +<rdf:RDF + xmlns="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl#" + xml:base="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl#" + xmlns:units ="&units;" + xmlns:foaf ="http://xmlns.com/foaf/0.1/" + xmlns:rdf ="&rdf;" + xmlns:xsd ="&xsd;" + xmlns:rdfs ="&rdfs;" + xmlns:owl ="http://www.w3.org/2002/07/owl#" + xmlns:wot ="http://xmlns.com/wot/0.1/" + xmlns:dc ="&dc;" + xmlns:dcterms ="&dcterms;" + xmlns:dctype ="&dctype;" + xmlns:bibtex ="&bibtex;"> + + <owl:Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl"> + <dc:creator>Jérôme Euzenat</dc:creator> + <dc:description>Example for Alignment API advanced turorial</dc:description> + <dc:date>2009-07-06</dc:date> + <rdfs:label>First ontology</rdfs:label> + <dc:title>ontology1.owl: an fake list of students</dc:title> + <dc:identifier rdf:datatype="&xsd;anyURI">http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology1.owl</dc:identifier> + </owl:Ontology> + + <owl:Class rdf:ID="Estudiante"> + <rdfs:label xml:lang="en">Estudiante</rdfs:label> + </owl:Class> + +<Estudiante> + <lastname>Fitzgerald</lastname> + <firstname>Ella</firstname> + <gender>Female</gender> + <affiliation>Vanilla University of Technology</affiliation> + <city>Vanilla</city> + <country>AT</country> + <year>1</year> + <topic>Semantic Process Mining</topic> + <supervisor>Prof. Giancarlo Cetriolo</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Blackey</lastname> + <firstname>Art</firstname> + <gender>Male</gender> + <affiliation>University of Albatra</affiliation> + <city>Albatra</city> + <country>ES</country> + <year>1</year> + <topic>Semantic Web applications</topic> + <supervisor>Paola Pomodoro</supervisor> + <supervisor>Pierluiggi Pomodoro</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Coleman</lastname> + <firstname>Ornette</firstname> + <gender>Male</gender> + <affiliation>Trinidad College Dubrovnik</affiliation> + <city>Dubrovnik</city> + <country>IE</country> + <year>1</year> + <topic>Conceptualization and Implementation of a ontology based Meta-Layer for the Management of Ontology Mapping Representations in Order to Support Sharing and Reuse of Ontology Mappings</topic> + <supervisor>Carla Cipolla</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Davis</lastname> + <firstname>Miles</firstname> + <gender>Male</gender> + <affiliation>JOHANNISBEER RESEARCH</affiliation> + <city>Guacamole</city> + <country>AT</country> + <year>1</year> + <topic>Automatic Metadata-Based Video Editing Systems</topic> + <supervisor>Univ.-Prof. Dr. Paolo Carciofo</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Coltrane</lastname> + <firstname>John</firstname> + <gender>Male</gender> + <affiliation>Estrellas</affiliation> + <city>Aroma</city> + <country>IT</country> + <topic>Semantic web applications, ontology management systems</topic> +</Estudiante> + +<Estudiante> + <lastname>Holliday</lastname> + <firstname>Billie</firstname> + <gender>Female</gender> + <affiliation>University of Soupaloignon</affiliation> + <city>Soupaloignon</city> + <country>GB</country> + <year>1</year> + <topic>Adaptive Hypermedia and Competency Model</topic> + <supervisor>Dr.Federico diGuava</supervisor> + <supervisor>Mr. Laurenzo Girafiore</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Monk</lastname> + <firstname>Thelonious</firstname> + <gender>Male</gender> + <affiliation>Madeira Instutute of Technology</affiliation> + <city>Madeira</city> + <country>PT</country> + <year>1</year> + <topic>Semantic Web Annotation and Distributed Resource Authorization</topic> + <supervisor>Stefano Zucchini</supervisor> +</Estudiante> + +<Estudiante> + <lastname>McRae</lastname> + <firstname>Carmen</firstname> + <gender>Female</gender> + <affiliation>University of the Rainforest</affiliation> + <city>Lluvianda</city> + <country>SI</country> + <year>3</year> + <supervisor>Mario Staggioni</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Bley</lastname> + <firstname>Carla</firstname> + <gender>Female</gender> + <affiliation>none</affiliation> + <city>Yves sur Gifette</city> + <country>FR</country> + <year>1</year> + <supervisor>Christina Melocoton</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Simone</lastname> + <firstname>Nina</firstname> + <gender>Female</gender> + <affiliation>Research Center of the Americas</affiliation> + <city>Florida</city> + <country>IT</country> + <year>3</year> + <topic>Legal ontologies and legal theory</topic> + <supervisor>Domenica Melanzana</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Joplin</lastname> + <firstname>Janis</firstname> + <gender>Female</gender> + <affiliation>University of Zoulouland</affiliation> + <city>Zouloucity</city> + <country>ES</country> + <year>1</year> + <topic>Semantic Web</topic> + <supervisor>Medusa Pesto</supervisor> + <supervisor>Fiorenta Pescadore</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Powell</lastname> + <firstname>Bud</firstname> + <gender>Male</gender> + <affiliation>SPAM</affiliation> + <affiliation>Cogebom</affiliation> + <city>Porto Bello</city> + <country>FR</country> + <year>1</year> + <topic>The design and the implementation of an Information resources meta-model and its services : application to the medical field</topic> + <supervisor>Giovanni Dolomitti</supervisor> +</Estudiante> + +<Estudiante> + <lastname>De Wilde</lastname> + <firstname>Laurent</firstname> + <gender>Male</gender> + <affiliation>University of Sussex</affiliation> + <city>Glouchester</city> + <country>GB</country> + <year>1</year> + <supervisor>Ugo Calamari</supervisor> + <supervisor>Simona Riccota</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Calloway</lastname> + <firstname>Cab</firstname> + <gender>Male</gender> + <affiliation>University of Shepperington</affiliation> + <city>Shepperington</city> + <country>GB</country> +</Estudiante> + +<Estudiante> + <lastname>Goodman</lastname> + <firstname>Benny</firstname> + <gender>Male</gender> + <affiliation>The Univesity of the true way</affiliation> + <city>Dehli</city> + <country>BR</country> + <year>1</year> + <topic>Semantic Integration of Information</topic> + <supervisor>Prof. Dr. Riccardo Peperoni</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Parker</lastname> + <firstname>Charlie</firstname> + <gender>Male</gender> + <affiliation>Institut Von Humboldt</affiliation> + <city>Any</city> + <country>FR</country> + <year>1</year> + <topic>semantic Web services discovery</topic> + <supervisor>Cecilia Parmiggiano</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Peterson</lastname> + <firstname>Oscar</firstname> + <gender>Male</gender> + <affiliation>Institute for Applied Boxology</affiliation> + <city>Pariggi</city> + <country>IT</country> + <year>1</year> + <topic>Collaborative building of knowledge resources for the Semantic Web</topic> + <supervisor>Dott. Antolio Bresaola</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Getz</lastname> + <firstname>Stan</firstname> + <gender>Male</gender> + <affiliation>Altacola research centre</affiliation> + <city>Cloppenburg</city> + <country>DE</country> + <year>1</year> + <topic>health informatics</topic> + <supervisor>Prof. Pierpaolo Polenta</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Zorn</lastname> + <firstname>John</firstname> + <gender>Male</gender> + <affiliation>Altacola research centre</affiliation> + <city>Cloppenburg</city> + <country>DE</country> + <year>1</year> + <topic>Complex Event Processing</topic> + <supervisor>Prof. Pierpaolo Polenta</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Tyner</lastname> + <firstname>McCoy</firstname> + <gender>Male</gender> + <affiliation>University of Soupaloignon</affiliation> + <city>Soupaloignon</city> + <country>GB</country> + <year>1</year> + <topic>Trust and the Semantic Web</topic> + <supervisor>Dr Nanni Girasole</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Hawkins</lastname> + <firstname>Coleman</firstname> + <gender>Male</gender> + <affiliation>University of South Poland</affiliation> + <city>Krakow</city> + <country>IT</country> + <year>1</year> + <topic>Markup Languages and Semantic Web</topic> + <supervisor>Pepe Frutti di Mare</supervisor> +</Estudiante> + +<Estudiante> + <lastname>Franklin</lastname> + <firstname>Aretha</firstname> + <gender>Female</gender> + <affiliation>University of Huelva</affiliation> + <city>Huelva</city> + <country>ES</country> +</Estudiante> + +<Estudiante> + <lastname>Baker</lastname> + <firstname>Chet</firstname> + <gender>Male</gender> + <affiliation>University Pie XXIII</affiliation> + <city>Orssini</city> + <country>FR</country> +</Estudiante> + +</rdf:RDF> diff --git a/html/tutorial2/ontology2.owl b/html/tutorial/tutorial2/ontology2.owl similarity index 51% rename from html/tutorial2/ontology2.owl rename to html/tutorial/tutorial2/ontology2.owl index c5824343161ab74d053382fcf71bfabddedb32d2..62f9262c192cb671dd22b0ac2b76b286baf33b29 100644 --- a/html/tutorial2/ontology2.owl +++ b/html/tutorial/tutorial2/ontology2.owl @@ -16,8 +16,8 @@ xml:base="http://xmlns.com/foaf/0.1/#" --> <rdf:RDF - xmlns="http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl#" - xml:base="http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl#" + xmlns="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl#" + xml:base="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl#" xmlns:units ="&units;" xmlns:foaf ="http://xmlns.com/foaf/0.1/" xmlns:rdf ="&rdf;" @@ -30,13 +30,13 @@ xmlns:dctype ="&dctype;" xmlns:bibtex ="&bibtex;"> - <owl:Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial2/ontology2.owl"> + <owl:Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl"> <dc:creator>Jérôme Euzenat</dc:creator> - <dc:description>Example for </dc:description> + <dc:description>Example for Alignment API advanced turorial</dc:description> <dc:date>2009-07-06</dc:date> <rdfs:label>Second ontology</rdfs:label> - <dc:title>bibtex.owl: an ontology for bibTeX entries</dc:title> - <dc:identifier rdf:datatype="&xsd;anyURI">http://visus.mit.edu/bibtex/0.01/bibtex.owl</dc:identifier> + <dc:title>ontology2.owl: another fake list of students</dc:title> + <dc:identifier rdf:datatype="&xsd;anyURI">http://alignapi.gforge.inria.fr/tutorial/tutorial2/ontology2.owl</dc:identifier> </owl:Ontology> <owl:Class rdf:ID="Student"> @@ -44,267 +44,267 @@ </owl:Class> <Student> - <name>Abdul Manaf</name> - <first-name>Nor Azlinayati</first-name> + <name>Krall</name> + <first-name>Diana</first-name> <gender>Female</gender> - <institution>University of Manchester</institution> - <city-of-study>Manchester</city-of-study> + <institution>Royal University of Worchester sauce</institution> + <city-of-study>Worchester sauce</city-of-study> <country-of-study>GB</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>OWL and SKOS: Exploring the relationship between formal and informal knowledge representation</topics-of-interest> - <phd-advisor>Dr. Robert Stevens</phd-advisor> - <phd-advisor>Sean Bechhofer</phd-advisor> + <phd-advisor>Dr. A. Verdura</phd-advisor> + <phd-advisor>C. Fragola</phd-advisor> </Student> <Student> - <name>Durao</name> - <first-name>Frederico</first-name> + <name>Gordon</name> + <first-name>Dexter</first-name> <gender>Male</gender> - <institution>Aalborg University</institution> - <city-of-study>Aalborg</city-of-study> + <institution>Eelberg University</institution> + <city-of-study>Eelberg</city-of-study> <country-of-study>DK</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Social Web Applications, Personalization, Semantic Web</topics-of-interest> - <phd-advisor>Peter Dolog</phd-advisor> + <phd-advisor>C. Pannacotta</phd-advisor> </Student> <Student> - <name>HAMDI</name> - <first-name>Fayçal</first-name> + <name>Reinhardt</name> + <first-name>Django</first-name> <gender>Male</gender> - <institution>University Paris-sud</institution> - <institution>INRIA Saclay</institution> - <city-of-study>Orsay</city-of-study> + <institution>University Pie XXIII</institution> + <institution>IRIA Saskatchevan</institution> + <city-of-study>Orssini</city-of-study> <country-of-study>FR</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Ontology Matching and Alignment</topics-of-interest> - <phd-advisor>Prof. Chantal Reynaud</phd-advisor> + <phd-advisor>Prof. Chr. Melocoton</phd-advisor> </Student> <Student> - <name>Burel</name> - <first-name>Gregoire</first-name> + <name>Miller</name> + <first-name>Glenn</first-name> <gender>Male</gender> - <institution>University of Sheffield</institution> - <city-of-study>Sheffield</city-of-study> + <institution>University of Shepperington</institution> + <city-of-study>Shepperington</city-of-study> <country-of-study>GB</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Digital Identities and Contextual Knowledge</topics-of-interest> - <phd-advisor>Professor Fabio Ciravegna</phd-advisor> + <phd-advisor>Professor G. Limone</phd-advisor> </Student> <Student> - <name>Maio</name> - <first-name>Paulo</first-name> + <name>McLean</name> + <first-name>Jackie</first-name> <gender>Male</gender> - <institution>School of Engineering, Polytechnic of Porto</institution> - <city-of-study>Porto</city-of-study> + <institution>Polytechnic of Madeira</institution> + <city-of-study>Madeira</city-of-study> <country-of-study>PT</country-of-study> <year-in-phd>3</year-in-phd> <topics-of-interest>Ontology Alignment</topics-of-interest> - <phd-advisor>Nuno Silva</phd-advisor> + <phd-advisor>S. Zucchini</phd-advisor> </Student> <Student> - <name>Wagner</name> - <first-name>Claudia</first-name> + <name>Merchant</name> + <first-name>Natalie</first-name> <gender>Female</gender> - <institution>JOANNEUM RESEARCH</institution> - <city-of-study>Graz</city-of-study> + <institution>JOHANNISBEER RESEARCH</institution> + <city-of-study>Guacamole</city-of-study> <country-of-study>AT</country-of-study> <topics-of-interest>Social Semantic Web</topics-of-interest> </Student> <Student> - <name>Priyatna</name> - <first-name>Freddy</first-name> + <name>Hampton</name> + <first-name>Lionel</first-name> <gender>Male</gender> - <institution>UPM</institution> - <city-of-study>Madrid</city-of-study> + <institution>Politecnico di Madalena</institution> + <city-of-study>Madalena</city-of-study> <country-of-study>ES</country-of-study> <topics-of-interest>ODEMapster</topics-of-interest> - <phd-advisor>Asun Gomez-Perez</phd-advisor> - <phd-advisor>Oscar Corcho</phd-advisor> + <phd-advisor>A. Gorgonzola</phd-advisor> + <phd-advisor>O. Mascarponne</phd-advisor> </Student> <Student> - <name>Milian</name> - <first-name>Krystyna</first-name> + <name>Jones</name> + <first-name>Rickie Lee</first-name> <gender>Female</gender> - <institution>Vrije Universiteit</institution> - <institution>Philips Research</institution> - <city-of-study>Amsterdam</city-of-study> + <institution>Philip Vanderbilt Universiteit</institution> + <institution>Velo Research</institution> + <city-of-study>Amsteelkoog</city-of-study> <country-of-study>NL</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>A combined approach to alignment of patient record data with a clinical context using computerized guidelines and semantic reasoning.</topics-of-interest> - <phd-advisor>Frank van Harmelen</phd-advisor> + <phd-advisor>A. Lambretta</phd-advisor> </Student> <Student> - <name>Laniado</name> - <first-name>David</first-name> + <name>Rollins</name> + <first-name>Sonny</first-name> <gender>Male</gender> - <institution>Politecnico di Milano</institution> - <city-of-study>Milano</city-of-study> + <institution>Universita di Miggliore</institution> + <city-of-study>Miggliore</city-of-study> <country-of-study>IT</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>social construction of semantic models</topics-of-interest> - <phd-advisor>Marco Colombetti</phd-advisor> + <phd-advisor>M. Pecorino</phd-advisor> </Student> <Student> - <name>Mirizzi</name> - <first-name>Roberto</first-name> + <name>Burrell</name> + <first-name>Kenny</first-name> <gender>Male</gender> - <institution>Politecnico di Bari</institution> - <city-of-study>Bari</city-of-study> + <institution>Politecnico di Belladona</institution> + <city-of-study>Belladona</city-of-study> <country-of-study>IT</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Semantic Web</topics-of-interest> - <phd-advisor>Tommaso Di Noia</phd-advisor> + <phd-advisor>S. Proscuitto</phd-advisor> </Student> <Student> - <name>JAABARI</name> - <first-name>Mohanad</first-name> + <name>Brubeck</name> + <first-name>Dave</first-name> <gender>Male</gender> - <institution>University of Namur</institution> - <city-of-study>Namur</city-of-study> + <institution>University of Namibia</institution> + <city-of-study>Nürnberg am See</city-of-study> <country-of-study>BE</country-of-study> <year-in-phd>3</year-in-phd> <topics-of-interest>Semantic Web Application: Enhancing Web Usability by Handling the Local Contexts of Web Users</topics-of-interest> - <phd-advisor>Jean-Luc HAINAUT</phd-advisor> - <phd-advisor>Philippe THIRAN</phd-advisor> + <phd-advisor>G. Belladonna</phd-advisor> + <phd-advisor>P. Tiramissu</phd-advisor> </Student> <Student> - <name>Grün</name> - <first-name>Christoph</first-name> + <name>Ellington</name> + <first-name>Duke</first-name> <gender>Male</gender> - <institution>Vienna University of Technology</institution> - <city-of-study>Vienna</city-of-study> + <institution>Vanilla University of Technology</institution> + <city-of-study>Vanilla</city-of-study> <country-of-study>AT</country-of-study> <year-in-phd>3</year-in-phd> <topics-of-interest>Context-aware Trip Planning</topics-of-interest> - <phd-advisor>Prof. Werthner</phd-advisor> + <phd-advisor>Prof. G. Cetriolo</phd-advisor> </Student> <Student> - <name>Adamou</name> - <first-name>Alessandro</first-name> + <name>Jackson</name> + <first-name>Milt</first-name> <gender>Male</gender> - <institution>ISTC-CNR</institution> - <city-of-study>Rome</city-of-study> + <institution>Escena</institution> + <city-of-study>Aroma</city-of-study> <country-of-study>IT</country-of-study> </Student> <Student> - <name>Feilmayr</name> - <first-name>Christina</first-name> + <name>Lee</name> + <first-name>Peggy</first-name> <gender>Female</gender> - <institution>Johannes Kepler University</institution> - <city-of-study>Linz</city-of-study> + <institution>University des Mitteleuropa</institution> + <city-of-study>Linden</city-of-study> <country-of-study>AT</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Ontology-driven Information Extraction</topics-of-interest> - <phd-advisor>a.Univ.Prof.DI.Dr. Birgit Pröll</phd-advisor> + <phd-advisor>a.Univ.Prof.DI.Dr. Z. Melone</phd-advisor> </Student> <Student> - <name>Garcia Castro</name> - <first-name>Leyla Jael</first-name> + <name>Gilberto</name> + <first-name>Astrud</first-name> <gender>Female</gender> - <institution>Universität der Bundeswehr</institution> - <city-of-study>Munich</city-of-study> + <institution>Universität der Gemütlichkeit</institution> + <city-of-study>Monte Bianco</city-of-study> <country-of-study>DE</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Emergent semantics</topics-of-interest> - <phd-advisor>Pr. Dr. Martin Hepp</phd-advisor> + <phd-advisor>Pr. Dr. M. Coppa</phd-advisor> </Student> <Student> - <name>Lim</name> - <first-name>Michelle Sien Niu</first-name> + <name>Rigby</name> + <first-name>Eleonore</first-name> <gender>Female</gender> - <institution>MIMOS BERHAD</institution> - <city-of-study>Kuala Lumpur</city-of-study> - <country-of-study>MY</country-of-study> + <institution>Politecnico di Bermudas</institution> + <city-of-study>Brest Litovsk</city-of-study> + <country-of-study>MX</country-of-study> </Student> <Student> - <name>Cano</name> - <first-name>Amparo Elizabeth</first-name> + <name>Black</name> + <first-name>Cilla</first-name> <gender>Female</gender> - <institution>University of Sheffield</institution> - <city-of-study>Sheffield</city-of-study> + <institution>University of Shepperington</institution> + <city-of-study>Shepperington</city-of-study> <country-of-study>GB</country-of-study> <year-in-phd>1</year-in-phd> - <phd-advisor>Prof. Fabio Ciravegna</phd-advisor> + <phd-advisor>Prof. G. Limone</phd-advisor> </Student> <Student> - <name>Elahi</name> - <first-name>Salman</first-name> + <name>Shepp</name> + <first-name>Archie</first-name> <gender>Male</gender> - <institution>Open University</institution> - <city-of-study>Milton Keynes</city-of-study> + <institution>Occarina University</institution> + <city-of-study>Paretto Yeats</city-of-study> <country-of-study>GB</country-of-study> <topics-of-interest>Personal Information Management</topics-of-interest> </Student> <Student> - <name>Nikolaou</name> - <first-name>Charalampos</first-name> + <name>Tatum</name> + <first-name>Art</first-name> <gender>Male</gender> <institution>National Kapodistrian University of Athens</institution> <city-of-study>Athens</city-of-study> <country-of-study>GR</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Query evaluation on spatial and temporal RDF databases in Semantic Web</topics-of-interest> - <phd-advisor>Manolis Koubarakis</phd-advisor> + <phd-advisor>B. Tiramisu</phd-advisor> </Student> <Student> - <name>Eisenbarth</name> - <first-name>Thomas</first-name> + <name>Corea</name> + <first-name>Chick</first-name> <gender>Male</gender> - <institution>University of Augsburg</institution> - <city-of-study>Augsburg</city-of-study> + <institution>University of Ausblick</institution> + <city-of-study>Ausblick</city-of-study> <country-of-study>DE</country-of-study> <year-in-phd>1</year-in-phd> <topics-of-interest>Semantic technologies in business processes and rules</topics-of-interest> - <phd-advisor>Prof. Dr. Bernhard Bauer</phd-advisor> + <phd-advisor>Prof. Dr. A. Belladonna</phd-advisor> </Student> <Student> - <name>Verslyppe</name> - <first-name>Bert</first-name> - <institution>Ghent University</institution> - <city-of-study>Gent</city-of-study> + <name>Bryant</name> + <first-name>Ray</first-name> + <institution>Handshuh University</institution> + <city-of-study>Handshuh</city-of-study> <country-of-study>BE</country-of-study> </Student> <Student> - <name>Ruiz</name> - <first-name>Carlos</first-name> - <institution>iSOCO</institution> - <city-of-study>Madrid</city-of-study> + <name>Zawinul</name> + <first-name>Joe</first-name> + <institution>Institute for Social Coworkers</institution> + <city-of-study>Madalena</city-of-study> <country-of-study>ES</country-of-study> </Student> <Student> - <name>Córdoba</name> - <first-name>Carmen</first-name> - <institution>iSOCO</institution> - <city-of-study>Madrid</city-of-study> + <name>Sinclair</name> + <first-name>Betty</first-name> + <institution>Institute for Social Coworkers</institution> + <city-of-study>Madalena</city-of-study> <country-of-study>ES</country-of-study> </Student> <Student> - <name>Calbimonte</name> - <first-name>Jean Paul</first-name> - <institution>UPM</institution> - <city-of-study>Boadilla del Monte</city-of-study> + <name>Aldderley</name> + <first-name>Julian</first-name> + <institution>Politecnico di Madalena</institution> + <city-of-study>Botella de Mantequilla</city-of-study> <country-of-study>ES</country-of-study> </Student> diff --git a/html/tutorial/tutorial3/MyApp.java b/html/tutorial/tutorial3/MyApp.java new file mode 100644 index 0000000000000000000000000000000000000000..9733b8108a0eaf2779541e3c0b6df18e8e2c1f21 --- /dev/null +++ b/html/tutorial/tutorial3/MyApp.java @@ -0,0 +1,124 @@ +/* + * $Id$ + * + * Copyright (C) INRIA, 2006-2009 + * + * Modifications to the initial code base are copyright of their + * respective authors, or their employers as appropriate. Authorship + * of the modifications may be determined from the ChangeLog placed at + * the end of this file. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +// Alignment API classes +import org.semanticweb.owl.align.Alignment; +import org.semanticweb.owl.align.AlignmentProcess; +import org.semanticweb.owl.align.AlignmentVisitor; +import org.semanticweb.owl.align.Parameters; +import org.semanticweb.owl.align.Evaluator; + +// Alignment API implementation classes +import fr.inrialpes.exmo.align.impl.BasicAlignment; +import fr.inrialpes.exmo.align.impl.BasicParameters; +import fr.inrialpes.exmo.align.impl.method.StringDistAlignment; +import fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor; +import fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor; +import fr.inrialpes.exmo.align.impl.eval.PRecEvaluator; +import fr.inrialpes.exmo.align.parser.AlignmentParser; + +// SAX standard classes +import org.xml.sax.SAXException; + +// Java standard classes +import java.io.PrintWriter; +import java.io.BufferedWriter; +import java.io.OutputStreamWriter; +import java.io.File; +import java.net.URI; + +/** + * MyApp + * + * Takes two files as arguments and align them. + */ + +public class MyApp { + + public static void main( String[] args ) { + URI onto1 = null; + URI onto2 = null; + Parameters params = new BasicParameters(); + + try { + // Loading ontologies + if (args.length >= 2) { + onto1 = new URI(args[0]); + onto2 = new URI(args[1]); + } else { + System.err.println("Need two arguments to proceed"); + return ; + } + + // 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 ); + // JE: I do not understand why I must create a new one! + 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(); + + } catch (Exception e) { e.printStackTrace(); }; + } +} diff --git a/html/tutorial/Skeleton.java b/html/tutorial/tutorial3/Skeleton.java similarity index 100% rename from html/tutorial/Skeleton.java rename to html/tutorial/tutorial3/Skeleton.java diff --git a/html/tutorial/tutorial3/embed.html b/html/tutorial/tutorial3/embed.html new file mode 100644 index 0000000000000000000000000000000000000000..e4ad4f2658c926243b11f5166afc4955ef5ad2b3 --- /dev/null +++ b/html/tutorial/tutorial3/embed.html @@ -0,0 +1,173 @@ +<?xml version="1.0"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<title>Embedding the Alignment API</title> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="../../base.css" /> +<link rel="stylesheet" type="text/css" href="../../style.css" /> +<script type="text/javascript"> +<!-- +function show(id) { + var element = document.getElementById(id); + element.style.display = "block"; +} +function hide(id) { + var element = document.getElementById(id); + element.style.display = "none"; +} +--> +</script> +<style type="text/css"> +<!-- +div.logic { + padding-left: 5px; + padding-right: 5px; + margin-top: 10px; + margin-bottom: 10px; +} +--> +</style> +</head> +<body style="background-color: #FFFFFF;"> + +<h1>Embedding the Alignment <abbr title="Application Programming Interface">API</abbr></h1> + +<dl> +<dt>This version:</dt> +<dd>http://alignapi.gforge.inria.fr/tutorial/tutorial3/embed.html</dd> +<dt>Author:</dt> +<dd><a href="http://exmo.inrialpes.fr/people/euzenat">Jérôme Euzenat</a>, INRIA & LIG +</dd> +</dl> + +<p style="border-bottom: 2px solid #AAAAAA; border-top: 2px solid + #AAAAAA; padding-top: 15px; padding-bottom: 15px;">Here is a + tutorial for embedding the alignment <abbr>API</abbr> within your + own applications. +</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>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"> +$ 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 +</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 class="explain" id="qu7"><p>The main piece of code in Skeleton.java is replaced by:</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> + +<hr /> +<small> +<p style="text-align: center;">http://alignapi.gforge.inria.fr/tutorial/tutorial3/embed.html</p> +</small> +<hr /> +<p>$Id: index.html 1046 2009-07-09 12:24:53Z euzenat $</p> +</body> +</html> diff --git a/html/tutorial2/ontology1.owl b/html/tutorial2/ontology1.owl deleted file mode 100644 index 147dde9ec82761ead119735fa31543cae86d8ba7..0000000000000000000000000000000000000000 --- a/html/tutorial2/ontology1.owl +++ /dev/null @@ -1,311 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!DOCTYPE rdf:RDF [ - <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > - <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > - <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > - <!ENTITY dc "http://purl.org/dc/elements/1.1/" > - <!ENTITY owl "http://www.w3.org/2002/07/owl#" > - <!ENTITY units "http://visus.mit.edu/fontomri/0.01/units.owl#" > - <!ENTITY bibtex "http://purl.org/net/nknouf/ns/bibtex#"> - <!ENTITY dcterms "http://purl.org/dc/terms/"> - <!ENTITY dctype "http://purl.org/dc/dcmitype/"> ]> - -<rdf:RDF - xmlns="http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl#" - xml:base="http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl#" - xmlns:units ="&units;" - xmlns:foaf ="http://xmlns.com/foaf/0.1/" - xmlns:rdf ="&rdf;" - xmlns:xsd ="&xsd;" - xmlns:rdfs ="&rdfs;" - xmlns:owl ="http://www.w3.org/2002/07/owl#" - xmlns:wot ="http://xmlns.com/wot/0.1/" - xmlns:dc ="&dc;" - xmlns:dcterms ="&dcterms;" - xmlns:dctype ="&dctype;" - xmlns:bibtex ="&bibtex;"> - - <owl:Ontology rdf:about="http://alignapi.gforge.inria.fr/tutorial2/ontology1.owl"> - <dc:creator>Jérôme Euzenat</dc:creator> - <dc:description>Example for </dc:description> - <dc:date>2009-07-06</dc:date> - <rdfs:label>First ontology</rdfs:label> - <dc:title>bibtex.owl: an ontology for bibTeX entries</dc:title> - <dc:identifier rdf:datatype="&xsd;anyURI">http://visus.mit.edu/bibtex/0.01/bibtex.owl</dc:identifier> - </owl:Ontology> - - <owl:Class rdf:ID="Estudiante"> - <rdfs:label xml:lang="en">Estudiante</rdfs:label> - </owl:Class> - -<Estudiante> - <lastname>Tran Thi Kim</lastname> - <firstname>Thanh</firstname> - <gender>Female</gender> - <affiliation>Vienna University of Technology</affiliation> - <city>Vienna</city> - <country>AT</country> - <year>1</year> - <topic>Semantic Process Mining</topic> - <supervisor>Prof. Hannes Werthner</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Hermida Carbonell</lastname> - <firstname>Jesus Maria</firstname> - <gender>Male</gender> - <affiliation>University of Alicante</affiliation> - <city>Alicante</city> - <country>ES</country> - <year>1</year> - <topic>Semantic Web applications</topic> - <supervisor>Andres Montoyo</supervisor> - <supervisor>Jaime Gomez</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Thomas</lastname> - <firstname>Hendrik</firstname> - <gender>Male</gender> - <affiliation>Trinity College Dublin-</affiliation> - <city>Dublin</city> - <country>IE</country> - <year>1</year> - <topic>Conceptualization and Implementation of a ontology based Meta-Layer for the Management of Ontology Mapping Representations in Order to Support Sharing and Reuse of Ontology Mappings</topic> - <supervisor>Declan O'Sullivan</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Kaiser</lastname> - <firstname>Rene</firstname> - <gender>Male</gender> - <affiliation>JOANNEUM RESEARCH</affiliation> - <city>Graz</city> - <country>AT</country> - <year>1</year> - <topic>Automatic Metadata-Based Video Editing Systems</topic> - <supervisor>Univ.-Prof. Dr. Klaus Tochtermann</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Daga</lastname> - <firstname>Enrico</firstname> - <gender>Male</gender> - <affiliation>STLab</affiliation> - <city>Rome</city> - <country>IT</country> - <topic>Semantic web applications, ontology management systems</topic> -</Estudiante> - -<Estudiante> - <lastname>Nitchot</lastname> - <firstname>Athitaya</firstname> - <gender>Female</gender> - <affiliation>University of Southampton</affiliation> - <city>Southampton</city> - <country>GB</country> - <year>1</year> - <topic>Adaptive Hypermedia and Competency Model</topic> - <supervisor>Dr.Gary Wills</supervisor> - <supervisor>Mr. Lester Gilbert</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Bettencourt</lastname> - <firstname>Nuno</firstname> - <gender>Male</gender> - <affiliation>Knowledge Engineering and Decision Support Research Center, GECAD</affiliation> - <city>Porto</city> - <country>PT</country> - <year>1</year> - <topic>Semantic Web Annotation and Distributed Resource Authorization</topic> - <supervisor>Nuno Silva</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Novalija</lastname> - <firstname>Inna</firstname> - <gender>Female</gender> - <affiliation>Jozef Stefan Institute</affiliation> - <city>Ljubljana</city> - <country>SI</country> - <year>3</year> - <supervisor>Dunja Mladenic</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Zemirline</lastname> - <firstname>Nadjet</firstname> - <gender>Female</gender> - <affiliation>none</affiliation> - <city>Gif sur Yvette</city> - <country>FR</country> - <year>1</year> - <supervisor>Chantal Reynaud</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Fernandez-Barrera</lastname> - <firstname>Meritxell</firstname> - <gender>Female</gender> - <affiliation>European University Institute</affiliation> - <city>Florence</city> - <country>IT</country> - <year>3</year> - <topic>Legal ontologies and legal theory</topic> - <supervisor>Giovanni Sartor</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Florczyk</lastname> - <firstname>Aneta</firstname> - <gender>Female</gender> - <affiliation>University of Zaragoza</affiliation> - <city>Zaragoza</city> - <country>ES</country> - <year>1</year> - <topic>Semantic Web</topic> - <supervisor>Muro Medrano</supervisor> - <supervisor>Pedro Rafael</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Vandenbussche</lastname> - <firstname>Pierre-Yves</firstname> - <gender>Male</gender> - <affiliation>SPIM</affiliation> - <affiliation>Mondeca</affiliation> - <city>PARIS</city> - <country>FR</country> - <year>1</year> - <topic>The design and the implementation of an Information resources meta-model and its services : application to the medical field</topic> - <supervisor>Jean Charlet</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Albakour</lastname> - <firstname>MDyaa</firstname> - <gender>Male</gender> - <affiliation>University of Essex</affiliation> - <city>Colchester</city> - <country>GB</country> - <year>1</year> - <supervisor>Udo Kruschwitz</supervisor> - <supervisor>Simon Lucas</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Wrigley</lastname> - <firstname>Stuart</firstname> - <gender>Male</gender> - <affiliation>University of Sheffield</affiliation> - <city>Sheffield</city> - <country>GB</country> -</Estudiante> - -<Estudiante> - <lastname>Lima</lastname> - <firstname>Tarcisio</firstname> - <gender>Male</gender> - <affiliation>Pontifical Catholic University of Rio de Janeiro</affiliation> - <city>Rio de Janeiro</city> - <country>BR</country> - <year>1</year> - <topic>Semantic Integration of Information</topic> - <supervisor>Prof. Dr. Rubens Nascimento Melo</supervisor> -</Estudiante> - -<Estudiante> - <lastname>sellami</lastname> - <firstname>mohamed</firstname> - <gender>Male</gender> - <affiliation>Institut TELECOM</affiliation> - <city>Evry</city> - <country>FR</country> - <year>1</year> - <topic>semantic Web services discovery</topic> - <supervisor>Samir Tata</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Ronzano</lastname> - <firstname>Francesco</firstname> - <gender>Male</gender> - <affiliation>Institute for Informatics and Telematics</affiliation> - <city>Pisa</city> - <country>IT</country> - <year>1</year> - <topic>Collaborative building of knowledge resources for the Semantic Web</topic> - <supervisor>Dott. Andrea Marchetti</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Zentek</lastname> - <firstname>Tom</firstname> - <gender>Male</gender> - <affiliation>Forschungszentrum Informatik</affiliation> - <city>Karlsruhe</city> - <country>DE</country> - <year>1</year> - <topic>health informatics</topic> - <supervisor>Prof. Rudi Studer</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Stühmer</lastname> - <firstname>Roland</firstname> - <gender>Male</gender> - <affiliation>Forschungszentrum Informatik</affiliation> - <city>Karlsruhe</city> - <country>DE</country> - <year>1</year> - <topic>Complex Event Processing</topic> - <supervisor>Prof. Rudi Studer</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Cobden</lastname> - <firstname>Marcus</firstname> - <gender>Male</gender> - <affiliation>University of Southampton</affiliation> - <city>Southampton</city> - <country>GB</country> - <year>1</year> - <topic>Trust and the Semantic Web</topic> - <supervisor>Dr Nicholas Gibbins</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Peroni</lastname> - <firstname>Silvio</firstname> - <gender>Male</gender> - <affiliation>University of Bologna</affiliation> - <city>Bologna</city> - <country>IT</country> - <year>1</year> - <topic>Markup Languages and Semantic Web</topic> - <supervisor>Paolo Ciancarini</supervisor> -</Estudiante> - -<Estudiante> - <lastname>Ruiz</lastname> - <firstname>Manuela</firstname> - <gender>Female</gender> - <affiliation>University of Málaga</affiliation> - <city>Malaga</city> - <country>ES</country> -</Estudiante> - -<Estudiante> - <lastname>Stankovic</lastname> - <firstname>Milan</firstname> - <gender>Male</gender> - <affiliation>University Paris-Sud XI</affiliation> - <city>Orsay</city> - <country>FR</country> -</Estudiante> - - - -</rdf:RDF>