Mentions légales du service

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

- corrected the code of the example so that it really works

parent 4ac8d48e
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ import org.semanticweb.owl.align.Alignment; ...@@ -24,7 +24,7 @@ import org.semanticweb.owl.align.Alignment;
import org.semanticweb.owl.align.AlignmentProcess; import org.semanticweb.owl.align.AlignmentProcess;
import org.semanticweb.owl.align.AlignmentException; import org.semanticweb.owl.align.AlignmentException;
import fr.inrialpes.exmo.align.impl.BasicAlignment; import fr.inrialpes.exmo.align.impl.URIAlignment;
//import my.domain.MyMatcher; //import my.domain.MyMatcher;
...@@ -32,7 +32,7 @@ import java.lang.Double; ...@@ -32,7 +32,7 @@ import java.lang.Double;
import java.util.Properties; import java.util.Properties;
import java.net.URI; import java.net.URI;
public class MyAlignment extends BasicAlignment implements AlignmentProcess { public class MyAlignment extends URIAlignment implements AlignmentProcess {
public MyAlignment() {}; public MyAlignment() {};
...@@ -40,8 +40,8 @@ public class MyAlignment extends BasicAlignment implements AlignmentProcess { ...@@ -40,8 +40,8 @@ public class MyAlignment extends BasicAlignment implements AlignmentProcess {
public void align( Alignment alignment, Properties params ) throws AlignmentException { public void align( Alignment alignment, Properties params ) throws AlignmentException {
URI url1 = getFile1(); URI url1 = getOntology1URI();
URI url2 = getFile2(); URI url2 = getOntology2URI();
MyMatcher matcher = new MyMatcher(); MyMatcher matcher = new MyMatcher();
matcher.match( url1, url2 ); matcher.match( url1, url2 );
......
...@@ -50,7 +50,7 @@ public class MyMatcher implements Iterable<Object[]> { ...@@ -50,7 +50,7 @@ public class MyMatcher implements Iterable<Object[]> {
try { try {
al.init( u1, u2 ); al.init( u1, u2 );
// Run matcher // Run matcher
al.align( (Alignment)null, (Properties)null ); al.align( (Alignment)null, new Properties() );
// Extract result // Extract result
for ( Cell c : al ) { for ( Cell c : al ) {
Object[] r = new Object[4]; Object[] r = new Object[4];
...@@ -58,6 +58,7 @@ public class MyMatcher implements Iterable<Object[]> { ...@@ -58,6 +58,7 @@ public class MyMatcher implements Iterable<Object[]> {
r[1] = c.getObject2AsURI( al ); r[1] = c.getObject2AsURI( al );
r[2] = c.getRelation().toString(); r[2] = c.getRelation().toString();
r[3] = new Double( c.getStrength() ); r[3] = new Double( c.getStrength() );
result.add( r );
} }
} catch (AlignmentException ex) { } catch (AlignmentException ex) {
ex.printStackTrace(); ex.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment