diff --git a/html/relnotes.html b/html/relnotes.html index ace02b93b447930986217038314fbd34599abb75..af21a7aea88ed8a6edf2c8953ef3c2aa7be78c53 100644 --- a/html/relnotes.html +++ b/html/relnotes.html @@ -39,14 +39,13 @@ Currently the development and maintainance of 3 versions continue. <p><ul compact="1"> <li>Integration of SKOS API (ontowrap)</li> <li>Implement full OWL rendering of EDOAL (impl)</li> -<li>Adding type checking to EDOAL paser (parser)</li> +<li>Adding type checking to EDOAL parser (parser)</li> <li>Implement fully relaxed precision and recall (impl)</li> <li>Implement database store for EDOAL (server)</li> <li>Integrate some basic reasoning.</li> -<li>Complete tutorial4 with reasoning.</li> +<li>Complete tutorial4 with distributed reasoning.</li> <li>Genericize evaluators in <tt>GraphEvaluator</tt> and <tt>GenPlot</tt> (eval)</li> <li>Implementation of a provenance metadata tag (server/impl)</li> -<li>Online evaluation (server)</li> <li>Providing a <tt>DiffAlign( al1, al2 )</tt> operation and interface (util)</li> <li>Replace <tt>DistanceAlignment</tt> with a version more in line @@ -68,6 +67,8 @@ Currently the development and maintainance of 3 versions continue. <!--h2>Version 4.1 (1xxx): xx/09/2009 - Tring</h2--> <p><ul compact="1"> +<li>Added a getResult() method to Evaluator (api)</li> +<li>Implemented online evaluation (server)</li> <li>Upgraded to <span style="color: green">Pellet 2.1</span> (lib)</li> <li>Added tutorial 4 Pellet action (tutorial)</li> <li>Fixed path errors in tutorials (tutorial)</li> diff --git a/html/tutorial/tutorial1/server.html b/html/tutorial/tutorial1/server.html index 424adcd785b9b17137487a29b412347bed790dc7..99317cdf9d6bc11c1a70abbf010841917dc68126 100644 --- a/html/tutorial/tutorial1/server.html +++ b/html/tutorial/tutorial1/server.html @@ -32,7 +32,7 @@ div.logic { </head> <body style="background-color: #FFFFFF;"> -<h1>Manipulating alignments through a web client: a tutorial companion for the Alignment server</h1> +<h1>Manipulating alignments through a web client:<br /> a tutorial companion for the Alignment server</h1> <dl> <dt>This version:</dt> @@ -238,7 +238,15 @@ following interface: <h2>Evaluating</h2> -<p><b>This part is not yet available through the server</b></p> +<p> +An alignment can be evaluated against a reference alignment through an +Evaluator class: +<center><img src="server/eval1.png" /></center> +which returns the measures provided by the evaluator (here precision, +recall and derivative measures): +<center><img src="server/evalresult1.png" width="100%" /></center> +</p> +</p> <h2>Further exercises</h2> diff --git a/html/tutorial/tutorial1/server/eval1.png b/html/tutorial/tutorial1/server/eval1.png new file mode 100644 index 0000000000000000000000000000000000000000..ef13c4c074e0371af8f5361d2b7d6ec5859ceaea Binary files /dev/null and b/html/tutorial/tutorial1/server/eval1.png differ diff --git a/html/tutorial/tutorial1/server/evalresult1.png b/html/tutorial/tutorial1/server/evalresult1.png new file mode 100644 index 0000000000000000000000000000000000000000..0d702e54b96a4cd51d9a7c3e4ee33bb699596755 Binary files /dev/null and b/html/tutorial/tutorial1/server/evalresult1.png differ diff --git a/html/tutorial/tutorial1/server/interf.png b/html/tutorial/tutorial1/server/interf.png index ca137b2be8cdf581c786732cf91bd463a39e5f54..acb2ed74a098f7f0d499e6d72bf5b5e73a45c6ed 100644 Binary files a/html/tutorial/tutorial1/server/interf.png and b/html/tutorial/tutorial1/server/interf.png differ diff --git a/html/tutorial/tutorial1/server/load1.png b/html/tutorial/tutorial1/server/load1.png index a6e0f2fc762d1db206b0e24bf2d596113ea7ce73..5df6ed58bb377b795e5ad881a49c7459d924f158 100644 Binary files a/html/tutorial/tutorial1/server/load1.png and b/html/tutorial/tutorial1/server/load1.png differ diff --git a/html/tutorial/tutorial1/server/result2.png b/html/tutorial/tutorial1/server/result2.png index 5700205dd83ea319e022de034706fad504a0da2d..4f882a1ad1dcbc884491a98cd92dda49bd71e4e7 100644 Binary files a/html/tutorial/tutorial1/server/result2.png and b/html/tutorial/tutorial1/server/result2.png differ diff --git a/html/tutorial/tutorial1/server/trim1.png b/html/tutorial/tutorial1/server/trim1.png index f2c6cd15ede2d14330af7ad6cf1588436bcd4d32..f44c0e52e9a1687e2704c1a8ab6ced746756fb27 100644 Binary files a/html/tutorial/tutorial1/server/trim1.png and b/html/tutorial/tutorial1/server/trim1.png differ diff --git a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java index f525867415aa439bc56591c3d2ba5711b9cbbd0b..ae32daa5267601af06ffa1086a5b61faaab3437a 100644 --- a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java +++ b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java @@ -28,6 +28,7 @@ import fr.inrialpes.exmo.align.impl.BasicParameters; import fr.inrialpes.exmo.align.impl.BasicAlignment; import fr.inrialpes.exmo.align.impl.URIAlignment; import fr.inrialpes.exmo.align.impl.ObjectAlignment; +import fr.inrialpes.exmo.align.util.DiffAlign; import fr.inrialpes.exmo.ontowrap.OntologyFactory; import fr.inrialpes.exmo.ontowrap.Ontology; @@ -181,6 +182,10 @@ public class AServProtocolManager { return myId; } + public String argline(){ + return commandLineParams.getProperty( "argline" ); + } + /********************************************************************* * Basic protocol primitives *********************************************************************/ @@ -588,6 +593,36 @@ public class AServProtocolManager { catch (AlignmentException e) { return new ErrorMsg(newId(),mess,myId,mess.getSender(),"dummy//",(Properties)null); } + // Could also be EvaluationId if we develop a more elaborate evaluation description + return new EvalResult(newId(),mess,myId,mess.getSender(),classname,eval.getResults()); + } + + public Message diff( Message mess ){ + Properties params = mess.getParameters(); + // Retrieve the alignment + String id1 = params.getProperty("id1"); + Alignment al1 = null; + try { + al1 = alignmentCache.getAlignment( id1 ); + } catch (Exception e) { + return new UnknownAlignment(newId(),mess,myId,mess.getSender(),"unknown/Alignment/"+id1,(Properties)null); + } + // Retrieve the reference alignment + String id2 = params.getProperty("id2"); + Alignment al2 = null; + try { + al2 = alignmentCache.getAlignment( id2 ); + } catch (Exception e) { + return new UnknownAlignment(newId(),mess,myId,mess.getSender(),"unknown/Alignment/"+id2,(Properties)null); + } + // Set the comparison method + // Should be rewritted with diff -- no choice + DiffAlign eval = new DiffAlign( al1, al2 ); + // Compare it + try { eval.eval( params ); } + catch (AlignmentException e) { + return new ErrorMsg(newId(),mess,myId,mess.getSender(),"dummy//",(Properties)null); + } // Return it, not easy StringWriter sw = new StringWriter(); try { diff --git a/src/fr/inrialpes/exmo/align/service/EvalResult.java b/src/fr/inrialpes/exmo/align/service/EvalResult.java index 7aa90f324ef66379fcd3c5b8fd5ea55cb33ff1b9..5f67f255b6696ab187a552a9fb7c27b259be5efe 100644 --- a/src/fr/inrialpes/exmo/align/service/EvalResult.java +++ b/src/fr/inrialpes/exmo/align/service/EvalResult.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA, 2006-2009 + * Copyright (C) INRIA, 2006-2010 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -32,15 +32,20 @@ public class EvalResult extends Success { super( surr, rep, from, to, cont, param ); } public String HTMLString(){ - // This can only rely on a HTML output of the Evaluator - return "Alignment ID: <a href=\"../html/retrieve?method=fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor&id="+getContent()+"\">"+getContent()+"</a>"; + String results = "Alignment method: "+getContent()+"\n<ul>\n"; + for ( String key : getParameters().stringPropertyNames() ) { + results += "<li>"+key+" : "+getParameters().getProperty( key )+"</li>\n"; + } + results += "</ul>\n"; + return results; } public String RESTString(){ - // This can only rely on a XML output of the Evaluator - // We have one through the write( PrintWriter ) method - // This should go to content - //return "<id>"+surrogate+"</id>"+"<sender>"+sender+"</sender>" + "<receiver>"+receiver+"</receiver>" + "<in-reply-to>" + inReplyTo+ "</in-reply-to>" + "<alid>" + content + "</alid>"; - return "<alid>"+content+"</alid>"; + String results = "<EvaluationResults>"; + for ( String key : getParameters().stringPropertyNames() ) { + results += "<"+key+">"+getParameters().getProperty( key )+"</"+key+">"; + } + results += "</EvaluationResults>"; + return results; } } diff --git a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java index 6d3c603c7de857d614e1c042718b88c29eb2fffc..30a27c1069f899049c4842d4a04880872d8a74f3 100644 --- a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java +++ b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java @@ -421,6 +421,8 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else { msg = "Error: the server does not have Web service capabilities (use -W switch)"; } + } else if ( perf.equals("argline") ){ + msg = "<h1>Command line arguments</h1>\n<pre>\n"+manager.argline()+"\n<pre>\n"; } else if ( perf.equals("prmsqlquery") ){ msg = "<h1>SQL query</h1><form action=\"sqlquery\">Query:<br /><textarea name=\"query\" rows=\"20\" cols=\"80\">SELECT \nFROM \nWHERE </textarea> (sql)<br /><small>An SQL SELECT query</small><br /><input type=\"submit\" value=\"Query\"/></form>"; } else if ( perf.equals("sqlquery") ){ @@ -776,6 +778,8 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else { msg = "<h1>Evaluation results</h1>"; msg += displayAnswer( answer, params ); + // This should be nice here to provide the oportunity to diff them + // This needs to pass arguments... and to get them on the other side. } } else if ( perf.equals("saveeval") ) { } else if ( perf.equals("prmgrpeval") ) { @@ -783,6 +787,36 @@ public class HTMLAServProfile implements AlignmentServiceProfile { } else if ( perf.equals("savegrpeval") ) { } else if ( perf.equals("prmresults") ) { } else if ( perf.equals("getresults") ) { + } else if ( perf.equals("prmdiff") ) { + msg ="<h1>Compare alignments</h1><form action=\"diff\">"; + msg += "First alignment: "; + msg += "<select name=\"id1\">"; + for( Alignment al: manager.alignments() ){ + String id = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.ID); + String pid = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.PRETTY ); + if ( pid == null ) pid = id; else pid = id+" ("+pid+")"; + msg += "<option value=\""+id+"\">"+pid+"</option>"; + } + msg += "</select><br />"; + msg +="Second alignment: "; + msg += "<select name=\"id2\">"; + for( Alignment al: manager.alignments() ){ + String id = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.ID); + String pid = al.getExtension( Namespace.ALIGNMENT.uri, Annotations.PRETTY ); + if ( pid == null ) pid = id; else pid = id+" ("+pid+")"; + msg += "<option value=\""+id+"\">"+pid+"</option>"; + } + msg += "</select><br />"; + msg += "<br /><input type=\"submit\" name=\"action\" value=\"Compare\"/>\n"; + msg += "</form>\n"; + } else if ( perf.equals("diff") ) { + Message answer = manager.diff( new Message(newId(),(Message)null,myId,serverId,"", params) ); + if ( answer instanceof ErrorMsg ) { + msg = testErrorMessages( answer, params ); + } else { + msg = "<h1>Comparison results</h1>"; + msg += displayAnswer( answer, params ); + } } else if ( perf.equals("") ) { msg = "<h1>Alignment server commands</h1>"; msg += "<form action=\"../html/listalignments\"><button title=\"List of all the alignments stored in the server\" type=\"submit\">Available alignments</button></form>"; @@ -793,6 +827,7 @@ public class HTMLAServProfile implements AlignmentServiceProfile { msg += "<form action=\"prminv\"><button title=\"Swap the two ontologies of an alignment\" type=\"submit\">Invert alignment</button></form>"; msg += "<form action=\"prmstore\"><button title=\"Persistently store an alignent in this server\" type=\"submit\" >Store alignment</button></form>"; msg += "<form action=\"prmretrieve\"><button title=\"Render an alignment in a particular format\" type=\"submit\">Render alignment</button></form>"; + msg += "<form action=\"prmeval\"><button title=\"Evaluation of an alignment\" type=\"submit\">Evaluate alignment</button></form>"; msg += "<form action=\"../admin/\"><button style=\"background-color: lightpink;\" title=\"Server management functions\" type=\"submit\">Server management</button></form>"; } else { msg = "Cannot understand command "+perf;