Mentions légales du service

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

- introduction of variables for EDOALPattern

parent 1a12a5e6
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
......@@ -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; }
}
/*
* $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;
}
}
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