diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java index 0c0bb4fb51cf8f92da4950ee4a2b80abdc496eed..00e0da2cd840c0b08fc2f5d57319b427317d5408 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALAlignment.java @@ -24,6 +24,7 @@ package fr.inrialpes.exmo.align.impl.edoal; import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; +import java.util.Hashtable; import java.util.Set; import java.net.URI; @@ -47,11 +48,22 @@ import fr.inrialpes.exmo.align.impl.Extensions; */ public class EDOALAlignment extends BasicAlignment { + /* + * An eventual initial alignment + * + */ protected EDOALAlignment init = null; + /* + * The list of variables in declared in this alignment + * //EDOALPattern + */ + protected Hashtable<String,Variable> variables; + public EDOALAlignment() { setLevel("2EDOAL"); setXNamespace( Namespace.EDOAL.shortCut, Namespace.EDOAL.prefix ); + variables = new Hashtable<String,Variable>(); } public void init( Object onto1, Object onto2 ) throws AlignmentException { diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Expression.java b/src/fr/inrialpes/exmo/align/impl/edoal/Expression.java index 00b371a40f682b116ee0bf0149e66f987647cb58..fb3aae6afd94160b0aef16a5ce72c7940b30b2d5 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Expression.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Expression.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.7 - 2007 - * Copyright (C) INRIA, 2009 + * Copyright (C) INRIA, 2009-2010 * * 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 @@ -60,10 +60,17 @@ import org.semanticweb.owl.align.AlignmentVisitor; public abstract class Expression implements Cloneable, Visitable { + // should not be reasonable to have several variables + // This would cost too much + protected Variable variable; + protected Expression() {} public void accept(AlignmentVisitor visitor) throws AlignmentException { visitor.visit(this); } + public Variable getVariable() { return variable; } + public void setVariable( Variable v ) { variable = v; } + } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java b/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java new file mode 100644 index 0000000000000000000000000000000000000000..b8d89edc5dc8e0d9be981d577a24decff44f0f46 --- /dev/null +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java @@ -0,0 +1,73 @@ +/* + * $Id$ + * + * Copyright (C) INRIA, 2010 + * + * 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; + +import java.util.Set; +import java.util.HashSet; + +/** + * A simple Id to represent a Instance. + * + * @author richi + * + */ + +public class Variable { + + private String name; + + private Set<Expression> occurences; + + /** + * Constructs a InstanceId. + * + * @param id + * the id of the class + */ + public Variable( final String name ) { + if ( name == null ) throw new NullPointerException("The name must not be null"); + this.name = name; + occurences = new HashSet<Expression>(); + } + + public String name() { return name; } + + /** + * Returns the Id. + * + * @return the id. + */ + public String plainText() { + return toString(); + } + + + /** + * <p> + * Returns a simple description of this object. <b>The format of the + * returned String is undocumented and subject to change.</b> + * </p> + */ + public String toString() { + return "variable: " + name; + } + +}