diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Apply.java b/src/fr/inrialpes/exmo/align/impl/edoal/Apply.java index be2e2c020d3c642af9e29893b75c8c0d407ff25f..0b49ed15cc024cad9d08187e04955b1da713adfc 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Apply.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Apply.java @@ -32,16 +32,18 @@ import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor; /** * <p> - * Id to represent a simple valuestring. + * Apply is the application of a function to arguments. + * </p> + * <p> + * In the specification a {@code op} is a local transformaion + * function/service. The {@code args} specifies the parameters needed for the + * function to compute the transformaion. * </p> * <p> * $Id$ * </p> - * - * @author richi - * @version $Revision: 1.2 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ */ + public class Apply implements ValueExpression { /** Holds the operation to apply */ @@ -58,8 +60,6 @@ public class Apply implements ValueExpression { * its list of argumenst * @throws NullPointerException * if the value is {@code null} - * @throws IllegalArgumentException - * if the value isn't longer than 0 */ public Apply( final URI op, final List<ValueExpression> args ) { if ( op == null) { diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/ClassDomainRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/ClassDomainRestriction.java index 7b697c26127609fac380bb0e11b084830fd4cdd0..1ed5f92de0df47c2142e659cea1c3b899cdeb168 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/ClassDomainRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/ClassDomainRestriction.java @@ -29,10 +29,10 @@ public class ClassDomainRestriction extends ClassRestriction implements Cloneabl /** * Constructs a typeCondition with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param p + * the PathExpression to which the restriction applies + * @param cl + * the ClassExpression restricting the domain * @throws NullPointerException * if the restriction is null */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/ClassOccurenceRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/ClassOccurenceRestriction.java index a8221823354bdb07ab73eec01a638d3895c6c2b7..a5dabd9cea20145f67edce8f3f2bee85158cf9e2 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/ClassOccurenceRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/ClassOccurenceRestriction.java @@ -45,12 +45,14 @@ public class ClassOccurenceRestriction extends ClassRestriction implements Clone int occurence = 1; /** - * Constructs a attributeOccurenceRestriction with the given restriction. + * Constructs a ClassOccurenceRestriction with the given restriction. * - * @param attribute - * the attribute on which the restriction should be applied - * @param restriction - * the restriction for the domain + * @param p + * the constrained PathExpression + * @param c + * the restriction Comparator + * @param n + * the number of occurence compared * @throws NullPointerException * if the restriction is null */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/ClassTypeRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/ClassTypeRestriction.java index b0608833bd146b563e7225cbaab68ccf4b723e1e..b8159167677b18505633f962d0e0126967e711b9 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/ClassTypeRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/ClassTypeRestriction.java @@ -43,12 +43,12 @@ public class ClassTypeRestriction extends ClassRestriction implements Cloneable Datatype type = null; /** - * Constructs a typeCondition with the given restriction. + * Constructs a ClassTypeRestriction with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param p + * the restricted PathExpression + * @param t + * the Datatype to which this path is restricted * @throws NullPointerException * if the restriction is null */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/ClassValueRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/ClassValueRestriction.java index bdf7c567c3a921cfab9c7d3b694b75e2fa216aa7..8210d13b3daa18cddc4fe6a559241606a0649be7 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/ClassValueRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/ClassValueRestriction.java @@ -42,12 +42,14 @@ public class ClassValueRestriction extends ClassRestriction implements Cloneable ValueExpression value = null; /** - * Constructs a valueCondition with the given restriction. + * Constructs a ClassValueRestriction with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param p + * the restricted PathExpression + * @param comp + * the Comparator defining the restriction + * @param v + * the ValueExpression to which it is restricted * @throws NullPointerException * if the restriction is null */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java index 29a61cdfbb984974148c0d0c1458c15c957efbd1..30e7653f4a25b30db475f588df3d4c288ce61e18 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/EDOALCell.java @@ -25,6 +25,8 @@ package fr.inrialpes.exmo.align.impl.edoal; import java.io.PrintStream; import java.io.IOException; import java.util.Comparator; +import java.util.Set; +import java.util.HashSet; import java.lang.ClassNotFoundException; import java.lang.Float; import java.lang.Double; @@ -68,9 +70,10 @@ import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor; public class EDOALCell extends BasicCell { - // JE2009: This has been added for private URI id; // This is the id + private Set<Transformation> transformations; + public void accept( AlignmentVisitor visitor) throws AlignmentException { visitor.visit( this ); } @@ -95,9 +98,27 @@ public class EDOALCell extends BasicCell { //throw new AlignmentException( "Cannot convert to URI "+object2 ); } + public void addTransformation( Transformation trs ){ + if ( transformations == null ) { + transformations = new HashSet<Transformation>(); + } + transformations.add( trs ); + } + + /** + * May be null + */ + public Set<Transformation> transformations() { + return transformations; + } + public Cell inverse() throws AlignmentException { - return (Cell)new EDOALCell( (String)null, (Expression)object2, (Expression)object1, (EDOALRelation)relation.inverse(), strength ); + EDOALCell invcell = new EDOALCell( (String)null, (Expression)object2, (Expression)object1, (EDOALRelation)relation.inverse(), strength ); + for ( Transformation trsf : transformations ) { + invcell.addTransformation( trsf.inverse() ); + } // The same should be done for the measure + return invcell; } } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/InstanceExpression.java b/src/fr/inrialpes/exmo/align/impl/edoal/InstanceExpression.java index 0ae5e9872e6b6a49ead34467569f8fd1f0b8e3f0..7845c8f0b539c8710e05b3ab72f85a91675f6d18 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/InstanceExpression.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/InstanceExpression.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.4 - 2006 - * 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 @@ -44,11 +44,6 @@ public class InstanceExpression extends Expression implements ValueExpression { /** * Creates a simple InstaneExpression with the given Id. - * - * @param id - * the Id of this expression - * @throws IllegalArgumentException - * if the id isn't a InstanceId */ public InstanceExpression() { super(); diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/InstanceId.java b/src/fr/inrialpes/exmo/align/impl/edoal/InstanceId.java index df8d9073a2367e2333e017f4a4b064846bf9af0e..d57c226990795fb48dbdd7233bbf51085f7bfa8d 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/InstanceId.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/InstanceId.java @@ -50,10 +50,12 @@ public class InstanceId extends InstanceExpression implements Id { public InstanceId() {} /** - * Constructs a InstanceId. + * Constructs an InstanceId. * - * @param id - * the id of the class + * @param u + * an URI of this instance + * @throws NullPointerException + * u is null */ public InstanceId( final URI u ) { if ( u == null ) { diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PathExpression.java b/src/fr/inrialpes/exmo/align/impl/edoal/PathExpression.java index f94f7f660242ce2a9cb1d101022a0ad44f41f84d..afd4c724ba9a03fd11ada632a40ba780d9198d85 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PathExpression.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PathExpression.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.5 - 2006 - * 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 @@ -28,6 +28,7 @@ import org.semanticweb.owl.align.AlignmentException; import org.semanticweb.owl.align.AlignmentVisitor; import org.semanticweb.owl.align.Visitable; +import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor; /** * <p> @@ -52,6 +53,10 @@ public abstract class PathExpression extends Expression implements Cloneable, Vi public void accept(AlignmentVisitor visitor) throws AlignmentException { visitor.visit(this); } + public void accept(TypeCheckingVisitor visitor) throws AlignmentException { + visitor.visit(this); + } + /* public Object clone() { return super.clone(); diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyDomainRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyDomainRestriction.java index 6389c1a459e77e5501699121b3b00c66402876f6..df320e7e04e9439d5cbfcd8dd57e682042eeb041 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyDomainRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyDomainRestriction.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.4 - 2006 -- then DomainAttributeCondition.java - * 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 @@ -32,7 +32,6 @@ package fr.inrialpes.exmo.align.impl.edoal; * * @author Richard Pöttler * @version $Revision: 1.4 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ * */ public class PropertyDomainRestriction extends PropertyRestriction { @@ -41,8 +40,6 @@ public class PropertyDomainRestriction extends PropertyRestriction { /** * Constructs a domainRestiction with the given restriction. * - * @param restriction - * the restriction for the domain * @throws NullPointerException * if the restriction is null */ @@ -53,14 +50,12 @@ public class PropertyDomainRestriction extends PropertyRestriction { /** * Constructs a domainRestiction with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param dom + * the restricting class expression * @throws NullPointerException * if the restriction is null */ - public PropertyDomainRestriction(final ClassExpression dom) { + public PropertyDomainRestriction( final ClassExpression dom ) { super(); domain = dom; } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyExpression.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyExpression.java index d282b000bbda495beff1977e2849932336d9c80e..b13ff56fe46921e5e5c5702bf934ec26b76b72e8 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyExpression.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyExpression.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.7 - 2006 -- then AttributeExpr.java - * 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 @@ -40,28 +40,12 @@ import org.semanticweb.owl.align.Visitable; * @author Francois Scharffe, Adrian Mocan * @author richi * @version $Revision: 1.7 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ */ public abstract class PropertyExpression extends PathExpression implements Cloneable, Visitable { - /** The transformation service */ - private TransfService transf; - /** - * Creates a simple PropertyExpression with the given ExpressionDefinition, - * conditions and transf. - * - * @param id - * the ExpressionDefinition - * @param conditions - * the conditions for the expression - * @param transf - * the transformation service - * @throws IllegalArgumentException - * if there are other ids than PropertyId - * @throws NullPointerException - * if the id is {@code null} + * Creates a simple PropertyExpression */ public PropertyExpression() { super(); diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyId.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyId.java index 67ad461f45485943884b2cc4b09ddb0da50c7dde..f828a1db8face7567ca68b4ee5fd81c851f76880 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyId.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyId.java @@ -35,7 +35,6 @@ import java.net.URISyntaxException; * * @author richi * @version $Revision: 1.7 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ */ public class PropertyId extends PropertyExpression implements Id { /** Holds the identifier. */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyTypeRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyTypeRestriction.java index 972c655a9b17f7b65ca6617356d3472e310214f7..ac1b137af535bbda3d6db1baa87879c2edd454b5 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyTypeRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyTypeRestriction.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.6 - 2006 -- then AttributeTypeCondition.java - * 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 @@ -40,16 +40,11 @@ package fr.inrialpes.exmo.align.impl.edoal; */ public class PropertyTypeRestriction extends PropertyRestriction implements Cloneable { - // BEWARE THIS IS INCORRECTLY IMPLEMENTED AS VALUES INSTEAD OF TYPES Datatype type = null; /** - * Constructs a attributeTypeRestriction with the given restriction. + * Constructs a simple PropertyTypeRestriction * - * @param attribute - * the attribute on which the restriction should be applied - * @param restriction - * the restriction for the domain * @throws NullPointerException * if the restriction is null */ @@ -58,18 +53,14 @@ public class PropertyTypeRestriction extends PropertyRestriction implements Clon } /** - * Constructs a attributeTypeRestriction with the given restriction. + * Constructs a PropertyTypeRestriction with the given restriction. * - * @param attribute - * the attribute on which the restriction should be applied - * @param restriction - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param t + * the restricting target datatype * @throws NullPointerException * if the restriction is null */ - public PropertyTypeRestriction(final Datatype t) { + public PropertyTypeRestriction( final Datatype t ) { super(); type = t; } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyValueRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyValueRestriction.java index 0196011047e71cd11b00fb806d49c4a5295984ab..e20590fe1ca3a41467d4bde2a0de4a4c979eb1ca 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyValueRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyValueRestriction.java @@ -42,10 +42,8 @@ public class PropertyValueRestriction extends PropertyRestriction implements Clo ValueExpression value = null; /** - * Constructs a attributeValueRestriction with the given restriction. + * Constructs a simple PropertyValueRestriction * - * @param attribute - * the attribute on which the restriction should be applied * @throws NullPointerException * if the restriction is null */ @@ -54,18 +52,16 @@ public class PropertyValueRestriction extends PropertyRestriction implements Clo } /** - * Constructs a attributeValueRestriction with the given restriction. + * Constructs a PropertyValueRestriction with the given restriction. * - * @param attribute - * the attribute on which the restriction should be applied - * @param restriction - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param comp + * the comparator between the restricted property and the restricting value + * @param v + * the target restricting value * @throws NullPointerException * if the restriction is null */ - public PropertyValueRestriction(final Comparator comp, final ValueExpression v) { + public PropertyValueRestriction( final Comparator comp, final ValueExpression v ) { super(); comparator = comp; value = v; diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/RelationCoDomainRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/RelationCoDomainRestriction.java index 15cb3b5a584e0e6aadfb88e742649f3262c3ff2b..649e3c3c66efedea94ea3c34e3b1240b04e0f976 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/RelationCoDomainRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/RelationCoDomainRestriction.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.4 - 2006 - * 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 @@ -33,7 +33,6 @@ package fr.inrialpes.exmo.align.impl.edoal; * * @author Richard Pöttler * @version $Revision: 1.4 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ * */ public class RelationCoDomainRestriction extends RelationRestriction { @@ -41,10 +40,8 @@ public class RelationCoDomainRestriction extends RelationRestriction { protected ClassExpression codomain = null; /** - * Constructs a coDomainRestriction with the given restriction. + * Constructs a simple RelationCoDomainRestriction * - * @param restriction - * the restriction for the domain * @throws NullPointerException * if the restriction is null */ @@ -53,16 +50,14 @@ public class RelationCoDomainRestriction extends RelationRestriction { } /** - * Constructs a coDomainRestriction with the given restriction. + * Constructs a RelationCoDomainRestriction with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param cod + * the restricting target class expression as codomain * @throws NullPointerException * if the restriction is null */ - public RelationCoDomainRestriction(final ClassExpression cod) { + public RelationCoDomainRestriction( final ClassExpression cod ) { super(); codomain = cod; } diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/RelationDomainRestriction.java b/src/fr/inrialpes/exmo/align/impl/edoal/RelationDomainRestriction.java index 220749ed532119446c4d2bdd07204cef900d7245..b56201116d9693b1f6b57ca9631ff0224c1c0bff 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/RelationDomainRestriction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/RelationDomainRestriction.java @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck * Sourceforge version 1.4 - 2006 - * 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 @@ -32,17 +32,14 @@ package fr.inrialpes.exmo.align.impl.edoal; * * @author Richard Pöttler * @version $Revision: 1.4 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ * */ public class RelationDomainRestriction extends RelationRestriction { private ClassExpression domain = null; /** - * Constructs a domainRestiction with the given restriction. + * Constructs a simple RelationDomainRestiction * - * @param restriction - * the restriction for the domain * @throws NullPointerException * if the restriction is null */ @@ -51,12 +48,10 @@ public class RelationDomainRestriction extends RelationRestriction { } /** - * Constructs a domainRestiction with the given restriction. + * Constructs a RelationDomainRestiction with the given restriction. * - * @param res - * the restriction for the domain - * @param target - * the target expression which should be restricted + * @param dom + * the target restricting class expression to be taken as domain * @throws NullPointerException * if the restriction is null */ diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Value.java b/src/fr/inrialpes/exmo/align/impl/edoal/Value.java index 41738ef89d4072036ca802e66981789bc9f831d9..bb7305f8d8c34e3c42d01a7e848b0e2057e8cb90 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Value.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Value.java @@ -40,7 +40,6 @@ import fr.inrialpes.exmo.align.parser.TypeCheckingVisitor; * * @author richi * @version $Revision: 1.2 $ - * @date $Date: 2010-03-07 20:40:05 +0100 (Sun, 07 Mar 2010) $ */ public class Value implements ValueExpression { //implements Cloneable, Visitable { diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java b/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java index 190875259d1fc949e4a426066deb8c2f958d0f62..4b5bce1015ffbf5ef176128990b6a49849512a6e 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Variable.java @@ -37,10 +37,10 @@ public class Variable { private Set<Expression> occurences; /** - * Constructs a InstanceId. + * Constructs a Variable * - * @param id - * the id of the class + * @param name + * the name of the variable */ public Variable( final String name ) { if ( name == null ) throw new NullPointerException("The name must not be null");