From 74af9c376288dd9d51d3b57a08449483b6636039 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20David?=
 <Jerome.David@univ-grenoble-alpes.fr>
Date: Wed, 19 Jun 2013 15:12:02 +0000
Subject: [PATCH] Fix a bug in EDOALAlignment which did not allow to load
 ontologies when they were not

---
 .../exmo/align/impl/edoal/EDOALAlignment.java      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java
index bfdff103..095151a1 100644
--- a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java
+++ b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java
@@ -37,6 +37,7 @@ import org.semanticweb.owl.align.Relation;
 
 import fr.inrialpes.exmo.ontowrap.Ontology;
 import fr.inrialpes.exmo.ontowrap.LoadedOntology;
+import fr.inrialpes.exmo.ontowrap.OntologyFactory;
 import fr.inrialpes.exmo.ontowrap.OntowrapException;
 import fr.inrialpes.exmo.align.impl.Annotations;
 import fr.inrialpes.exmo.align.impl.Namespace;
@@ -83,8 +84,17 @@ public class EDOALAlignment extends BasicAlignment {
 	    throw new AlignmentException("The source and target ontologies must not be null");
 	if ( (onto1 instanceof Ontology && onto2 instanceof Ontology) ){
 	    super.init( onto1, onto2 );
-	} else {
-	    throw new AlignmentException("arguments must be LoadedOntology");
+	} 
+	else if ((onto1 instanceof URI && onto2 instanceof URI)) {
+	    OntologyFactory fact = OntologyFactory.getFactory();
+	    try {
+		super.init(fact.loadOntology((URI) onto1), fact.loadOntology((URI) onto2));
+	    } catch (OntowrapException e) {
+		throw new AlignmentException("Could not load ontologies",e);
+	    }
+	}
+	else {
+	    throw new AlignmentException("arguments must be LoadedOntology or deferencable URIs");
 	};
     }
 
-- 
GitLab