Mentions légales du service

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

- improved Semantic Precision and recall tests

- improved AlgTest
parent 3f93aa09
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id$ * $Id$
* *
* Copyright (C) INRIA, 2008-2010 * Copyright (C) INRIA, 2008-2010, 2013
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU Lesser General Public License as published by
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
//package test.com.acme.dona.dep;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNotNull;
...@@ -135,10 +134,9 @@ public class AlgTest { ...@@ -135,10 +134,9 @@ public class AlgTest {
assertEquals( alignment1.nbCells(), 38 ); assertEquals( alignment1.nbCells(), 38 );
assertEquals( align2.nbCells(), 10 ); assertEquals( align2.nbCells(), 10 );
// JE: big problem here:
// Apparently the compose destroys the loaded alignment!
Alignment al = alignment1.compose( align2 ); Alignment al = alignment1.compose( align2 );
new NameAndPropertyAlignment().init( new URI("file:examples/rdf/edu.umbc.ebiquity.publication.owl"), new URI("file:examples/rdf/edu.mit.visus.bibtex.owl")); assertEquals( alignment1.nbCells(), 38 );
assertEquals( align2.nbCells(), 10 );
assertEquals( al.getOntology1(), alignment1.getOntology1() ); assertEquals( al.getOntology1(), alignment1.getOntology1() );
assertEquals( al.getOntology2(), align2.getOntology2() ); assertEquals( al.getOntology2(), align2.getOntology2() );
assertEquals( al.nbCells(), 4/*4*/ ); assertEquals( al.nbCells(), 4/*4*/ );
......
...@@ -337,6 +337,41 @@ $ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.EvalAlign -i fr.inrialp ...@@ -337,6 +337,41 @@ $ java -cp lib/procalign.jar fr.inrialpes.exmo.align.cli.EvalAlign -i fr.inrialp
assertEquals( eval.getOverall(), 0.5 ); assertEquals( eval.getOverall(), 0.5 );
} }
@Test(groups = { "full", "sem" }, dependsOnMethods = {"routineEvalTest"}, expectedExceptions = fr.paris8.iut.info.iddl.IDDLRuntimeException.class)
public void semanticIDDLEvalTest() throws Exception {
AlignmentParser aparser1 = new AlignmentParser( 0 );
assertNotNull( aparser1 );
Alignment align1 = aparser1.parse( "test/output/bibref2.rdf" );
assertNotNull( align1 );
aparser1.initAlignment( null );
Alignment align2 = aparser1.parse( "test/output/bibref.rdf" );
assertNotNull( align2 );
SemPRecEvaluator eval = new SemPRecEvaluator( align1, align2 );
assertNotNull( eval );
Properties params = new Properties();
params.setProperty( "semantics", "DL" );
assertNotNull( params );
eval.eval( params ) ;
// This only output the result to check that this is possible
OutputStream stream = new NullStream();
PrintWriter writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( stream, "UTF-8" )), true);
eval.write( writer );
writer.flush();
writer.close();
// These figures are different than those of classical PR
// only because some correspondences cannot be transcribed
// author<->hasAuthor/editor<->hasEditor/firstAuthor/hasAuthor
// because Object/DataProperties
assertEquals( eval.getPrecision(), 0.6904761904761905 );
assertEquals( eval.getRecall(), 0.90625 );
assertEquals( eval.getNoise(), 0.30952380952380953 );
assertEquals( eval.getFmeasure(), 0.7837837837837837 );
assertEquals( eval.getOverall(), 0.5 );
}
@Test(groups = { "full", "impl" }, dependsOnMethods = {"routineEvalTest"}) @Test(groups = { "full", "impl" }, dependsOnMethods = {"routineEvalTest"})
public void weightedEvalTest() throws Exception { public void weightedEvalTest() throws Exception {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment