Mentions légales du service

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

- prepared full implementation of the different evaluations

parent 55e420ac
No related branches found
No related tags found
No related merge requests found
...@@ -123,7 +123,9 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -123,7 +123,9 @@ public class ExtPREvaluator extends BasicEvaluator {
URI uri2 = onto2.getEntityURI( c2.getObject2() ); URI uri2 = onto2.getEntityURI( c2.getObject2() );
// if (c1.getobject2 == c2.getobject2) // if (c1.getobject2 == c2.getobject2)
if ( uri1.toString().equals(uri2.toString()) ) { if ( uri1.toString().equals(uri2.toString()) ) {
symsimilarity = symsimilarity + 1.; symsimilarity += 1.;
effsimilarity += 1.;
orientsimilarity += 1.;
c1 = null; // out of the loop. c1 = null; // out of the loop.
} }
} }
...@@ -133,7 +135,10 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -133,7 +135,10 @@ public class ExtPREvaluator extends BasicEvaluator {
// running the Hungarian method... // running the Hungarian method...
Enumeration e2 = align2.getElements(); Enumeration e2 = align2.getElements();
if ( c1 != null ) { if ( c1 != null ) {
symsimilarity = symsimilarity + computeSymSimilarity(c1,e2); // Add guards
symsimilarity += computeSymSimilarity(c1,e2);
effsimilarity += computeEffSimilarity(c1,e2);
orientsimilarity += computeOrientSimilarity(c1,e2);
} }
} }
} }
...@@ -179,6 +184,24 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -179,6 +184,24 @@ public class ExtPREvaluator extends BasicEvaluator {
return Math.pow( symALPHA, minval ); return Math.pow( symALPHA, minval );
} }
/**
* This computes similarity depending on structural measures:
* the similarity is symALPHA^minval, symALPHA being lower than 1.
* minval is the length of the subclass chain.
*/
protected double computeEffSimilarity( Cell c1, Enumeration s2 ){
return 0.;
}
/**
* This computes similarity depending on structural measures:
* the similarity is symALPHA^minval, symALPHA being lower than 1.
* minval is the length of the subclass chain.
*/
protected double computeOrientSimilarity( Cell c1, Enumeration s2 ){
return 0.;
}
protected int relativePosition( Object o1, Object o2, HeavyLoadedOntology<Object> onto ) throws AlignmentException { protected int relativePosition( Object o1, Object o2, HeavyLoadedOntology<Object> onto ) throws AlignmentException {
if ( onto.isClass( o1 ) && onto.isClass( o2 ) ){ if ( onto.isClass( o1 ) && onto.isClass( o2 ) ){
isSuperClass( o2, o1, onto ); // This is the level isSuperClass( o2, o1, onto ); // This is the level
...@@ -196,7 +219,7 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -196,7 +219,7 @@ public class ExtPREvaluator extends BasicEvaluator {
} }
public boolean isSuperProperty( Object prop1, Object prop2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException { public boolean isSuperProperty( Object prop1, Object prop2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException {
return ontology.getSuperProperties( prop2, OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ).contains( prop1 ); return ontology.getSuperProperties( prop2, OntologyFactory.DIRECT, OntologyFactory.ANY, OntologyFactory.ANY ).contains( prop1 );
} }
...@@ -219,7 +242,7 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -219,7 +242,7 @@ public class ExtPREvaluator extends BasicEvaluator {
public int isSuperClass( Object class1, Object class2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException { public int isSuperClass( Object class1, Object class2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException {
URI uri1 = ontology.getEntityURI( class1 ); URI uri1 = ontology.getEntityURI( class1 );
Set<Object> bufferedSuperClasses = null; Set<Object> bufferedSuperClasses = null;
Set<Object> superclasses = ontology.getSuperClasses( class1, OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); Set<Object> superclasses = ontology.getSuperClasses( class1, OntologyFactory.DIRECT, OntologyFactory.ANY, OntologyFactory.ANY );
int level = 0; int level = 0;
while ( !superclasses.isEmpty() ){ while ( !superclasses.isEmpty() ){
...@@ -233,7 +256,7 @@ public class ExtPREvaluator extends BasicEvaluator { ...@@ -233,7 +256,7 @@ public class ExtPREvaluator extends BasicEvaluator {
if ( uri1.toString().equals(uri2.toString()) ) { if ( uri1.toString().equals(uri2.toString()) ) {
return level; return level;
} else { } else {
superclasses.addAll( ontology.getSuperClasses( entity, OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ) ); superclasses.addAll( ontology.getSuperClasses( entity, OntologyFactory.DIRECT, OntologyFactory.ANY, OntologyFactory.ANY ) );
} }
} }
} }
......
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