Mentions légales du service

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

- added addCell for the purposes of better alignment extractor

parent b1a8cf5f
No related branches found
No related tags found
No related merge requests found
...@@ -160,15 +160,20 @@ public class BasicAlignment implements Alignment { ...@@ -160,15 +160,20 @@ public class BasicAlignment implements Alignment {
/** Cell methods **/ /** Cell methods **/
public Cell addAlignCell(Object ob1, Object ob2, String relation, public Cell addAlignCell(Object ob1, Object ob2, String relation,
double measure) throws AlignmentException { double measure) throws AlignmentException {
//try { if ( !( ob1 instanceof OWLEntity && ob1 instanceof OWLEntity ) )
if ( !( ob1 instanceof OWLEntity && ob1 instanceof OWLEntity ) ) throw new AlignmentException("addAlignCell: arguments must be OWLEntities");
//if (!Class.forName("org.semanticweb.owl.model.OWLEntity").isInstance(ob1) Cell cell = (Cell) new BasicCell((OWLEntity)ob1, (OWLEntity)ob2,
//|| !Class.forName("org.semanticweb.owl.model.OWLEntity").isInstance(ob2))
throw new AlignmentException("addAlignCell: arguments must be OWLEntities");
//} catch (ClassNotFoundException e) { e.printStackTrace(); }
try {
Cell cell = (Cell) new BasicCell((OWLEntity) ob1, (OWLEntity) ob2,
relation, measure); relation, measure);
addCell( (OWLEntity)ob1, (OWLEntity)ob2, cell );
return cell;
};
public Cell addAlignCell(Object ob1, Object ob2) throws AlignmentException {
return addAlignCell( ob1, ob2, "=", 1. );
}
public void addCell( OWLEntity ob1, OWLEntity ob2, Cell cell ) throws AlignmentException {
try {
//Raph: //Raph:
//HashSet s1 = hash1.get((Object)(((OWLEntity)ob1).getURI())); //HashSet s1 = hash1.get((Object)(((OWLEntity)ob1).getURI()));
//if ( s1 == null ){ //if ( s1 == null ){
...@@ -185,14 +190,9 @@ public class BasicAlignment implements Alignment { ...@@ -185,14 +190,9 @@ public class BasicAlignment implements Alignment {
//} //}
//s2.add(cell); //s2.add(cell);
hash2.put((Object)(((OWLEntity)ob2).getURI()), cell); hash2.put((Object)(((OWLEntity)ob2).getURI()), cell);
return cell;
} catch (OWLException e) { } catch (OWLException e) {
throw new AlignmentException("getURI problem", e); throw new AlignmentException("getURI problem", e);
} }
};
public Cell addAlignCell(Object ob1, Object ob2) throws AlignmentException {
return addAlignCell( ob1, ob2, "=", 1. );
} }
// Raph: // Raph:
......
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