diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Linkkey.java b/src/fr/inrialpes/exmo/align/impl/edoal/Linkkey.java index 2fe0842ff7744d1c108b3b8616fff098096ee4ec..f0358ae3581dec0568f5138dc584911425703d14 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Linkkey.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Linkkey.java @@ -1,7 +1,7 @@ /* - * $Id: BasicCell.java 1878 2014-01-29 14:52:55Z euzenat $ + * $Id$ * - * Copyright (C) INRIA, 2003-2005, 2007-2010 + * Copyright (C) INRIA, 2015 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -82,4 +82,14 @@ public class Linkkey implements Extensible { return (String)null; } }; + + public Linkkey inverse() { + Linkkey lk = new Linkkey(); + for ( LinkkeyBinding bind : bindings ) { + lk.addBinding( bind.inverse() ); + } + if ( extensions != null ) lk.setExtensions( extensions ); + return lk; + }; + } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyBinding.java b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyBinding.java index 8ecb9d093afbf07123da95181a910f236df5c753..bb85d697846f23fe288e607a19bd6af18cc99e72 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyBinding.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyBinding.java @@ -1,7 +1,22 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * $Id$ + * + * Copyright (C) INRIA, 2015 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. */ package fr.inrialpes.exmo.align.impl.edoal; @@ -14,12 +29,12 @@ import org.semanticweb.owl.align.AlignmentException; */ public abstract class LinkkeyBinding { - private PathExpression expression1; - private PathExpression expression2; + protected PathExpression expression1; + protected PathExpression expression2; - public LinkkeyBinding(PathExpression expression1, PathExpression expression2) throws AlignmentException { - this.expression1 = expression1; - this.expression2 = expression2; + public LinkkeyBinding( PathExpression expr1, PathExpression expr2 ) { + expression1 = expr1; + expression2 = expr2; } @@ -32,4 +47,5 @@ public abstract class LinkkeyBinding { public abstract void accept( EDOALVisitor visitor ) throws AlignmentException; + public abstract LinkkeyBinding inverse(); } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyEquals.java b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyEquals.java index c52ed8bae85f5df3e62d7b20f973730e0f42ea11..759edf9262323f5caa8752277f3cb1df4ccb666d 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyEquals.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyEquals.java @@ -1,7 +1,22 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * $Id$ + * + * Copyright (C) INRIA, 2015 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. */ package fr.inrialpes.exmo.align.impl.edoal; @@ -14,11 +29,15 @@ import org.semanticweb.owl.align.AlignmentException; */ public class LinkkeyEquals extends LinkkeyBinding{ - public LinkkeyEquals(PathExpression expression1, PathExpression expression2) throws AlignmentException { - super(expression1, expression2); + public LinkkeyEquals( PathExpression expression1, PathExpression expression2 ) { + super( expression1, expression2 ); } public void accept( EDOALVisitor visitor ) throws AlignmentException { visitor.visit( this ); } + + public LinkkeyEquals inverse() { + return new LinkkeyEquals( expression1, expression2 ); + } } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyIntersects.java b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyIntersects.java index 13fc58fbdda065b6e56ddd3d99099dba0d211290..be47e0864f076b18cbb552f5d7601f639d0a0d4e 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyIntersects.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/LinkkeyIntersects.java @@ -1,7 +1,22 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * $Id$ + * + * Copyright (C) INRIA, 2015 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. */ package fr.inrialpes.exmo.align.impl.edoal; @@ -12,13 +27,18 @@ import org.semanticweb.owl.align.AlignmentException; * * @author Nicolas Guillouet <nicolas@meaningengines.com> */ -public class LinkkeyIntersects extends LinkkeyBinding{ + +public class LinkkeyIntersects extends LinkkeyBinding { - public LinkkeyIntersects(PathExpression expression1, PathExpression expression2) throws AlignmentException { - super(expression1, expression2); + public LinkkeyIntersects( PathExpression expression1, PathExpression expression2 ) { + super( expression1, expression2 ); } public void accept( EDOALVisitor visitor ) throws AlignmentException { visitor.visit( this ); } + + public LinkkeyIntersects inverse() { + return new LinkkeyIntersects( expression1, expression2 ); + } }