Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8f65411e authored by Jérôme David's avatar Jérôme David
Browse files

GetSourceAlignments and getTargetingAlignment now return emptySet (instead of...

GetSourceAlignments and getTargetingAlignment now return emptySet (instead of null) in the case of unknown ontologies
parent 1e9bb4c0
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ package fr.inrialpes.exmo.align.impl; ...@@ -22,6 +22,7 @@ package fr.inrialpes.exmo.align.impl;
import java.lang.Cloneable; import java.lang.Cloneable;
import java.lang.Iterable; import java.lang.Iterable;
import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
...@@ -38,7 +39,7 @@ import org.semanticweb.owl.align.OntologyNetwork; ...@@ -38,7 +39,7 @@ import org.semanticweb.owl.align.OntologyNetwork;
/** /**
* Represents a distributed system of aligned ontologies or network of ontologies. * Represents a distributed system of aligned ontologies or network of ontologies.
* *
* @author Jrme Euzenat * @author J�r�me Euzenat
* @version $Id$ * @version $Id$
*/ */
...@@ -89,9 +90,11 @@ public class BasicOntologyNetwork implements OntologyNetwork { ...@@ -89,9 +90,11 @@ public class BasicOntologyNetwork implements OntologyNetwork {
return ontologies.keySet(); // ?? return ontologies.keySet(); // ??
}; };
public Set<Alignment> getTargetingAlignments( URI onto ){ public Set<Alignment> getTargetingAlignments( URI onto ){
if (!ontologies.containsKey(onto)) return Collections.emptySet();
return ontologies.get( onto ).targettingAlignments; return ontologies.get( onto ).targettingAlignments;
}; };
public Set<Alignment> getSourceAlignments( URI onto ){ public Set<Alignment> getSourceAlignments( URI onto ){
if (!ontologies.containsKey(onto)) return Collections.emptySet();
return ontologies.get( onto ).sourceAlignments; return ontologies.get( onto ).sourceAlignments;
}; };
......
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