diff --git a/lib/procalign.jar b/lib/procalign.jar index b74a65d0af8c1f8910ba33c77d2330e787f1a973..24d9fa908228e13b185d7fa715b7613e7a83509f 100644 Binary files a/lib/procalign.jar and b/lib/procalign.jar differ diff --git a/src/fr/inrialpes/exmo/align/impl/rel/SubsumeRelation.java b/src/fr/inrialpes/exmo/align/impl/rel/SubsumeRelation.java index 260f33d2f914fed3482a64dd3248662a4927847b..0ee50e5e0b393f3eaf29f0cd345e8f9b150ba55c 100644 --- a/src/fr/inrialpes/exmo/align/impl/rel/SubsumeRelation.java +++ b/src/fr/inrialpes/exmo/align/impl/rel/SubsumeRelation.java @@ -43,7 +43,7 @@ public class SubsumeRelation extends BasicRelation /** Creation **/ public SubsumeRelation(){ - super("<"); + super(">"); } } diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java index 0453115f0495577d03554ea22bc24a64ea812b17..759ac79793bb08741c49090d898b7bfe392dc93f 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java @@ -117,6 +117,18 @@ public class COWLMappingRendererVisitor implements AlignmentVisitor writer.print(" </cowl:Into>\n"); } catch (OWLException e) { throw new AlignmentException("getURI problem", e); }; } + public void visit( SubsumedRelation rel ) throws AlignmentException { + try { + writer.print(" <cowl:Onto>\n"); + writer.print(" <cowl:source>\n"); + printObject(((OWLEntity)cell.getObject1()).getURI(),(OWLOntology)alignment.getOntology1()); + writer.print(" </cowl:source>\n"); + writer.print(" <cowl:target>\n"); + printObject(((OWLEntity)cell.getObject2()).getURI(),(OWLOntology)alignment.getOntology2()); + writer.print(" </cowl:target>\n"); + writer.print(" </cowl:Onto>\n"); + } catch (OWLException e) { throw new AlignmentException("getURI problem", e); }; + } public void visit( IncompatRelation rel ) throws AlignmentException { try { writer.print(" <cowl:INCOMPATIBLE>\n"); @@ -140,6 +152,9 @@ public class COWLMappingRendererVisitor implements AlignmentVisitor } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation")}); + } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation").isInstance(rel) ) { + mm = this.getClass().getMethod("visit", + new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation")}); } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation")}); diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java index f71170f96a4902ddb2fc0420a910083854ac0c46..bc016c064e917c3a5da5576e4d6374e53ed308f9 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/OWLAxiomsRendererVisitor.java @@ -82,11 +82,20 @@ public class OWLAxiomsRendererVisitor implements AlignmentVisitor writer.print("</rdf:RDF>\n"); } + public void visit( Cell cell ) throws AlignmentException { this.cell = cell; - OWLOntology onto1 = (OWLOntology)alignment.getOntology1(); + OWLOntology onto1 = null; + URI entity1URI = null; try { - URI entity1URI = ((OWLEntity)cell.getObject1()).getURI(); + // Not very good but we failed to think subsumed from the first shot. + if ( Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation").isInstance(cell.getRelation()) ) { + onto1 = (OWLOntology)alignment.getOntology2(); + entity1URI = ((OWLEntity)cell.getObject2()).getURI(); + } else { + onto1 = (OWLOntology)alignment.getOntology1(); + entity1URI = ((OWLEntity)cell.getObject1()).getURI(); + } if ( (OWLEntity)onto1.getClass( entity1URI ) != null ) { // A class writer.print(" <owl:Class rdf:about=\""+entity1URI.toString()+"\">\n"); cell.getRelation().accept( this ); @@ -105,7 +114,9 @@ public class OWLAxiomsRendererVisitor implements AlignmentVisitor writer.print(" </owl:Thing>\n"); } writer.print("\n"); - } catch (OWLException e) { throw new AlignmentException("getURI problem", e); }; + } + catch (OWLException e) { throw new AlignmentException("getURI problem", e); } + catch (ClassNotFoundException e) { throw new AlignmentException("Class no found", e); }; } public void visit( EquivRelation rel ) throws AlignmentException { OWLOntology onto2 = (OWLOntology)alignment.getOntology2(); @@ -137,6 +148,19 @@ public class OWLAxiomsRendererVisitor implements AlignmentVisitor } } catch (OWLException e) { throw new AlignmentException("getURI problem", e); }; } + public void visit( SubsumedRelation rel ) throws AlignmentException { + OWLOntology onto1 = (OWLOntology)alignment.getOntology1(); + try { + URI entity1URI = ((OWLEntity)cell.getObject1()).getURI(); + if ( (OWLEntity)onto1.getClass( entity1URI ) != null ) { // A class + writer.print(" <rdfs:subClassOf rdf:resource=\""+entity1URI.toString()+"\"/>\n"); + } else if ( (OWLEntity)onto1.getDataProperty( entity1URI ) != null ) { // A Dataproperty + writer.print(" <rdfs:subPropertyOf rdf:resource=\""+entity1URI.toString()+"\"/>\n"); + } else if ( (OWLEntity)onto1.getObjectProperty( entity1URI ) != null ) { // An ObjectProperty + writer.print(" <rdfs:subPropertyOf rdf:resource=\""+entity1URI.toString()+"\"/>\n"); + } + } catch (OWLException e) { throw new AlignmentException("getURI problem", e); }; + } public void visit( IncompatRelation rel ) throws AlignmentException { OWLOntology onto2 = (OWLOntology)alignment.getOntology2(); try { @@ -155,6 +179,9 @@ public class OWLAxiomsRendererVisitor implements AlignmentVisitor } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation")}); + } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation").isInstance(rel) ) { + mm = this.getClass().getMethod("visit", + new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation")}); } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation")}); diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java index 1cbddc4069f1a9a1e2078c5499713506c07e5311..6eaaeb290d666c32c8e1b4c57d523b277c8d1182 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java @@ -145,6 +145,7 @@ public class SWRLRendererVisitor implements AlignmentVisitor } public void visit( SubsumeRelation rel ){}; + public void visit( SubsumedRelation rel ){}; public void visit( IncompatRelation rel ){}; public void visit( Relation rel ) throws AlignmentException { @@ -158,6 +159,9 @@ public class SWRLRendererVisitor implements AlignmentVisitor } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation")}); + } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation").isInstance(rel) ) { + mm = this.getClass().getMethod("visit", + new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation")}); } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation")}); diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java index e57acea1906b9bbfc77d4f87ab52474b7b035580..938ade1bfe8f88161271558c04934ec66929e70e 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java @@ -114,6 +114,7 @@ public class XSLTRendererVisitor implements AlignmentVisitor } public void visit( SubsumeRelation rel ){}; + public void visit( SubsumedRelation rel ){}; public void visit( IncompatRelation rel ){}; public void visit( Relation rel ) throws AlignmentException { @@ -127,6 +128,9 @@ public class XSLTRendererVisitor implements AlignmentVisitor } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumeRelation")}); + } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation").isInstance(rel) ) { + mm = this.getClass().getMethod("visit", + new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.SubsumedRelation")}); } else if (Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation").isInstance(rel) ) { mm = this.getClass().getMethod("visit", new Class [] {Class.forName("fr.inrialpes.exmo.align.impl.rel.IncompatRelation")});