Mentions légales du service

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

- Revised implementation (SymMean was incorrect)

parent d3735946
No related branches found
No related tags found
No related merge requests found
...@@ -254,14 +254,19 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -254,14 +254,19 @@ public class ExtPREvaluator extends BasicEvaluator {
writer.println(" <map:intutA rdf:resource=\""+((OWLOntology)(align1.getOntology1())).getURI()+"\">"); writer.println(" <map:intutA rdf:resource=\""+((OWLOntology)(align1.getOntology1())).getURI()+"\">");
writer.println(" <map:inputB rdf:resource=\""+((OWLOntology)(align1.getOntology2())).getURI()+"\">"); writer.println(" <map:inputB rdf:resource=\""+((OWLOntology)(align1.getOntology2())).getURI()+"\">");
} catch (OWLException e) { e.printStackTrace(); }; } catch (OWLException e) { e.printStackTrace(); };
// Other missing items (easy to get)
// writer.println(" <map:falseNegative>");
// writer.println(" <map:falsePositive>");
writer.print(" <map:symmetricprecision>"); writer.print(" <map:symmetricprecision>");
writer.print(symprec); writer.print(symprec);
writer.print("</map:symmetricprecision>\n <map:symmetricrecall>"); writer.print("</map:symmetricprecision>\n <map:symmetricrecall>");
writer.print(symrec); writer.print(symrec);
writer.print("</map:symmetricrecall>\n </map:output>\n</rdf:RDF>\n"); writer.print("</map:symmetricrecall>\n <map:effortbasedprecision>");
writer.print(effprec);
writer.print("</map:effortbasedprecision>\n <map:effortbasedrecall>");
writer.print(effrec);
writer.print("</map:effortbasedrecall>\n <map:orientedprecision>");
writer.print(orientprec);
writer.print("</map:orientedprecision>\n <map:orientedrecall>");
writer.print(orientrec);
writer.print("</map:orientedrecall>\n </map:output>\n</rdf:RDF>\n");
} }
} }
......
...@@ -84,21 +84,13 @@ public class SymMeanEvaluator extends BasicEvaluator ...@@ -84,21 +84,13 @@ public class SymMeanEvaluator extends BasicEvaluator
for (Enumeration e = align1.getElements() ; e.hasMoreElements() ;) { for (Enumeration e = align1.getElements() ; e.hasMoreElements() ;) {
Cell c1 = (Cell)e.nextElement(); Cell c1 = (Cell)e.nextElement();
if ( c1.getObject1() instanceof OWLClass ) nbClassCell++;
else if ( c1.getObject1() instanceof OWLProperty ) nbPropCell++;
else nbIndCell++;
Set s2 = (Set)align2.getAlignCells1((OWLEntity)c1.getObject1()); Set s2 = (Set)align2.getAlignCells1((OWLEntity)c1.getObject1());
if( s2 != null ){ if( s2 != null ){
// should be put to the length...of the set
if ( c1.getObject1() instanceof OWLClass )
nbClassCell = nbClassCell + s2.size() ;
else if ( c1.getObject1() instanceof OWLProperty )
nbPropCell = nbPropCell + s2.size();
else nbIndCell = nbIndCell + s2.size();
for( Iterator it2 = s2.iterator(); it2.hasNext() && c1 != null; ){ for( Iterator it2 = s2.iterator(); it2.hasNext() && c1 != null; ){
Cell c2 = (Cell)it2.next(); Cell c2 = (Cell)it2.next();
//try {
//URI uri1 = ((OWLEntity)c1.getObject2()).getURI();
//URI uri2 = ((OWLEntity)c2.getObject2()).getURI();
// if (c1.getobject2 == c2.getobject2)
//if (uri1.toString().equals(uri2.toString())) {
if ( c1.getObject2() == c2.getObject2() ) { if ( c1.getObject2() == c2.getObject2() ) {
if ( c1.getObject2() instanceof OWLClass ) { if ( c1.getObject2() instanceof OWLClass ) {
classScore = classScore + 1 - Math.abs(c2.getStrength() - c1.getStrength()); classScore = classScore + 1 - Math.abs(c2.getStrength() - c1.getStrength());
...@@ -109,34 +101,27 @@ public class SymMeanEvaluator extends BasicEvaluator ...@@ -109,34 +101,27 @@ public class SymMeanEvaluator extends BasicEvaluator
for (Enumeration e = align2.getElements() ; e.hasMoreElements() ;) { for (Enumeration e = align2.getElements() ; e.hasMoreElements() ;) {
Cell c2 = (Cell)e.nextElement(); Cell c2 = (Cell)e.nextElement();
Set s1 = (Set)align1.getAlignCells2((OWLEntity)c2.getObject1()); if ( c2.getObject1() instanceof OWLClass ) nbClassCell++ ;
if( s1 != null ){ else if ( c2.getObject1() instanceof OWLProperty ) nbPropCell++;
// should be put to the length...of the set else nbIndCell++;
if ( c2.getObject1() instanceof OWLClass ) //Set s1 = (Set)align1.getAlignCells2((OWLEntity)c2.getObject1());
nbClassCell = nbClassCell + s1.size() ; //if( s1 != null ){
else if ( c2.getObject1() instanceof OWLProperty ) // for( Iterator it1 = s1.iterator(); it1.hasNext() && c2 != null; ){
nbPropCell = nbPropCell + s1.size(); // Cell c1 = (Cell)it1.next();
else nbIndCell = nbIndCell + s1.size(); // if ( c2.getObject1() == c1.getObject1() ) {
for( Iterator it1 = s1.iterator(); it1.hasNext() && c2 != null; ){ // if ( c2.getObject1() instanceof OWLClass ) {
Cell c1 = (Cell)it1.next(); // classScore = classScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());
//try { // } else if ( c2.getObject1() instanceof OWLProperty ) {
//URI uri2 = ((OWLEntity)c2.getObject1()).getURI(); // propScore = propScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());
//URI uri1 = ((OWLEntity)c1.getObject1()).getURI(); // } else {
// if (c2.getobject1 == c1.getobject1) // indScore = indScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());}}}}
//if (uri2.toString().equals(uri1.toString())) { }
if ( c2.getObject1() == c1.getObject1() ) {
if ( c2.getObject1() instanceof OWLClass ) {
classScore = classScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());
} else if ( c2.getObject1() instanceof OWLProperty ) {
propScore = propScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());
} else {
indScore = indScore + 1 - Math.abs(c1.getStrength() - c2.getStrength());}}}}}
// Beware, this must come first // Beware, this must come first
result = (classScore+propScore+indScore) / (nbClassCell+nbPropCell+nbIndCell); result = 2*(classScore+propScore+indScore) / (nbClassCell+nbPropCell+nbIndCell);
classScore = classScore / nbClassCell; classScore = 2*classScore / nbClassCell;
propScore = propScore / nbPropCell; propScore = 2*propScore / nbPropCell;
indScore = indScore / nbIndCell; indScore = 2*indScore / nbIndCell;
return(result); return(result);
} }
......
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