Mentions légales du service

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

- new expressive language EDOAL

parent e670d718
No related branches found
No related tags found
No related merge requests found
Showing
with 1223 additions and 0 deletions
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.7 - 2006 -- then AttributeExpr.java
* Copyright (C) INRIA, 2009
*
* 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.net.URI;
import java.net.URISyntaxException;
/**
* <p>
* A simple Id to represent a Property.
* </p>
* <p>
* $Id: PropertyExpr.java,v 1.7 2006/11/30 12:21:41 poettler_ric Exp $
* </p>
*
* @author richi
* @version $Revision: 1.7 $
* @date $Date$
*/
public class PropertyId extends PropertyExpression implements Id {
/** Holds the identifier. */
private String id;
URI uri;
public PropertyId( final URI u ) {
if ( u == null ) {
throw new NullPointerException("The URI must not be null");
}
uri = u;
id = u.toString();
}
public URI getURI(){
return uri;
}
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>
* <p>
* An expamle return String could be:
* <code>attributeId: http://my/super/attribute</code>
* </p>
*/
public String toString() {
return "PropertyId: " + id;
}
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.6 - 2006 -- then AttributeCondition.java
* Copyright (C) INRIA, 2009
*
* 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 org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Superclass for all AttributeConditions.
* </p>
* <p>
* To successfully subclass this class the <code>clone</code> and
* <code>equals</code> methods must be overwritten. And if new fields were
* introduced, the <code>hashCode</code> and <code>toString</code> methods,
* too.
* </p>
* <p>
* Created on 24-Mar-2005 Committed by $Author: poettler_ric $
* </p>
* <p>
* $Id: PropertyCondition.java,v 1.6 2006/11/27 16:39:09 poettler_ric Exp $
* </p>
*
* @author Richard Pöttler
* @author Adrian Mocan
* @author Francois Scharffe
* @version $Revision: 1.6 $ $Date$
*/
public abstract class PropertyRestriction extends PropertyExpression implements Cloneable, Visitable {
protected PropertyRestriction() {
super();
}
public void accept(AlignmentVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
/*
public Object clone() {
try {
PropertyRestriction clone = (PropertyRestriction) super.clone();
clone.restriction = (Restriction) restriction.clone();
clone.target = (ExpressionDefinition) target.clone();
return clone;
} catch (CloneNotSupportedException e) {
assert true : "Object is always cloneable";
}
return null;
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.6 - 2006 -- then AttributeTypeCondition.java
* Copyright (C) INRIA, 2009
*
* 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;
/**
* <p>
* Represents a attributeTypeRestriction tag for a ClassExpressions.
* </p>
* <p>
* Created on 24-Mar-2005 Committed by $Author: poettler_ric $
* </p>
* <p>
* $Id: PropertyTypeRestriction.java,v 1.6 2006/11/27 16:39:08 poettler_ric Exp $
* </p>
*
* @author Francois Scharffe
* @author Adrian Mocan
* @author Richard Pöttler
* @version $Revision: 1.6 $ $Date$
*/
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.
*
* @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
*/
public PropertyTypeRestriction() {
super();
}
/**
* Constructs a attributeTypeRestriction 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
* @throws NullPointerException
* if the restriction is null
*/
public PropertyTypeRestriction(final Datatype t) {
super();
type = t;
}
public Datatype getType() {
return type;
}
public void setType( Datatype t ) {
type = t;
}
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* 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
* 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;
/**
* <p>
* Represents a attributeValueRestriction tag for a ClassExpressions.
* </p>
* <p>
* Created on 24-Mar-2005 Committed by $Author: poettler_ric $
* </p>
* <p>
* $Id: PropertyValueRestriction.java,v 1.6 2006/11/27 16:39:08 poettler_ric Exp $
* </p>
*
* @author Francois Scharffe
* @author Adrian Mocan
* @author Richard Pöttler
* @version $Revision: 1.6 $ $Date$
*/
public class PropertyValueRestriction extends PropertyRestriction implements Cloneable {
Comparator comparator = null;
PathExpression path = null;
InstanceExpression inst = null;
Value value = null;
/**
* Constructs a attributeValueRestriction with the given restriction.
*
* @param attribute
* the attribute on which the restriction should be applied
* @throws NullPointerException
* if the restriction is null
*/
public PropertyValueRestriction() {
super();
}
/**
* Constructs a attributeValueRestriction 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
* @throws NullPointerException
* if the restriction is null
*/
public PropertyValueRestriction(final Comparator comp, final PathExpression p) {
super();
comparator = comp;
path = p;
}
public PropertyValueRestriction(final Comparator comp, final Value v) {
super();
comparator = comp;
value = v;
}
public PropertyValueRestriction(final Comparator comp, final InstanceExpression i) {
super();
comparator = comp;
inst = i;
}
public Comparator getComparator(){
return comparator;
}
public void setComparator( Comparator comp ){
comparator = comp;
}
public Value getValue(){
return value;
}
public void setValue( Value v ){
value = v;
path = null;
inst = null;
}
public InstanceExpression getInstanceValue(){
return inst;
}
public void setInstanceValue( InstanceExpression i ){
inst = i;
value = null;
path = null;
}
public PathExpression getPath(){
return path;
}
public void setPath( PathExpression p ){
path = p;
value = null;
inst = null;
}
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.4 - 2006
* Copyright (C) INRIA, 2009
*
* 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;
/**
* <p>
* Represents a coDomainRestriction tag for RelationExpressions.
* </p>
* <p>
* $Id: RelationCoDomainRestriction.java,v 1.3 2006/11/15 16:01:17 poettler_ric
* Exp $
* </p>
*
* @author Richard Pöttler
* @version $Revision: 1.4 $
* @date $Date$
*
*/
public class RelationCoDomainRestriction extends RelationRestriction {
protected ClassExpression codomain = null;
/**
* Constructs a coDomainRestriction with the given restriction.
*
* @param restriction
* the restriction for the domain
* @throws NullPointerException
* if the restriction is null
*/
public RelationCoDomainRestriction() {
super();
}
/**
* Constructs a coDomainRestriction with the given restriction.
*
* @param res
* the restriction for the domain
* @param target
* the target expression which should be restricted
* @throws NullPointerException
* if the restriction is null
*/
public RelationCoDomainRestriction(final ClassExpression cod) {
super();
codomain = cod;
}
public ClassExpression getCoDomain() {
return codomain;
}
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.5 - 2006 - was RelationExpr
* 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
* 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.Collection;
import java.util.HashSet;
import fr.inrialpes.exmo.align.parser.SyntaxElement.Constructor;
import fr.inrialpes.exmo.align.parser.SyntaxElement;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Represents a RelationExpression.
* </p>
*
* @author Francois Scharffe, Adrian Mocan
*
* Created on 23-Mar-2005 Committed by $Author: adrianmocan $
*
* $Source:
* /cvsroot/mediation/mappingapi/src/fr.inrialpes.exmo.align.impl.edoal/RelationExpr.java,v $,
* @version $Revision: 1.5 $ $Date$
*/
// JE2010: Should it be abstract with RelationConjunction??
public class RelationConstruction extends RelationExpression {
/** Holds all expressions. */
private Collection<PathExpression> components;
/** Operator of this complex expression. */
private Constructor operator;
public RelationConstruction() {
super();
components = new HashSet<PathExpression>();
}
public RelationConstruction( Constructor op, Collection<PathExpression> expressions ) {
if ((expressions == null) || (op == null)) {
throw new NullPointerException("The subexpressions and the operator must not be null");
}
if (expressions.contains(null)) {
throw new IllegalArgumentException("The subexpressions must not contain null");
}
// The collection should have only relations
// It should be ordered: implement List
this.components = expressions;
if ( op != SyntaxElement.AND.getOperator() &&
op != SyntaxElement.OR.getOperator() &&
op != SyntaxElement.NOT.getOperator() &&
op != SyntaxElement.COMPOSE.getOperator() &&
op != SyntaxElement.TRANSITIVE.getOperator() &&
op != SyntaxElement.SYMMETRIC.getOperator() &&
op != SyntaxElement.REFLEXIVE.getOperator() &&
op != SyntaxElement.INVERSE.getOperator() ) {
throw new IllegalArgumentException( "Incorrect operator for relation : "+op );
}
this.operator = op;
}
public Constructor getOperator() {
return operator;
}
public void setOperator( Constructor op ) {
operator = op;
}
public Collection<PathExpression> getComponents() {
return components;
}
public void addComponents( RelationExpression exp ) {
components.add( exp );
}
/*
public void accept(AlignmentVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
*/
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.4 - 2006
* Copyright (C) INRIA, 2009
*
* 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;
/**
* <p>
* Represents a domainRestriction tag for RelationExpressions.
* </p>
* <p>
* $Id: RelationDomainRestriction.java,v 1.4 2006/11/27 16:39:08 poettler_ric Exp $
* </p>
*
* @author Richard Pöttler
* @version $Revision: 1.4 $
* @date $Date$
*
*/
public class RelationDomainRestriction extends RelationRestriction {
private ClassExpression domain = null;
/**
* Constructs a domainRestiction with the given restriction.
*
* @param restriction
* the restriction for the domain
* @throws NullPointerException
* if the restriction is null
*/
public RelationDomainRestriction() {
super();
}
/**
* Constructs a domainRestiction with the given restriction.
*
* @param res
* the restriction for the domain
* @param target
* the target expression which should be restricted
* @throws NullPointerException
* if the restriction is null
*/
public RelationDomainRestriction(final ClassExpression dom) {
super();
domain = dom;
}
public ClassExpression getDomain() {
return domain;
}
public void getDomain( ClassExpression dom ) {
domain = dom;
}
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.5 - 2006
* Copyright (C) INRIA, 2009
*
* 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.Collection;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Represents a RelationExpression.
* </p>
*
* @author Francois Scharffe, Adrian Mocan
*
* Created on 23-Mar-2005 Committed by $Author: adrianmocan $
*
* $Source:
* /cvsroot/mediation/mappingapi/src/fr.inrialpes.exmo.align.impl.edoal/RelationExpr.java,v $,
* @version $Revision: 1.5 $ $Date$
*/
public abstract class RelationExpression extends PathExpression implements Cloneable, Visitable {
public RelationExpression() {
super();
}
public void accept(AlignmentVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.5 - 2006 -- then RelationExpr
* Copyright (C) INRIA, 2009
*
* 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.net.URI;
import java.net.URISyntaxException;
import org.semanticweb.owl.align.AlignmentException;
/**
* A simple Id to represent a Relation.
*
* @author richi
*
*/
public class RelationId extends RelationExpression implements Id {
/** Holds the identifier. */
private String id;
URI uri;
public RelationId(final String id) throws AlignmentException {
if (id == null) {
throw new NullPointerException("The id must not be null");
}
if (id.length() <= 0) {
throw new IllegalArgumentException(
"The id must be longer than 0 characters");
}
this.id = id;
try {
uri = new URI( id );
} catch ( URISyntaxException mfuex ) {
throw new AlignmentException( "Not an URI "+id, mfuex );
}
}
public RelationId( final URI u ) {
if ( u == null ) {
throw new NullPointerException("The URI must not be null");
}
uri = u;
id = u.toString();
}
public URI getURI(){
return uri;
}
public String plainText() {
return id;
}
/**
* <p>
* Returns a simple description of this object. <b>The format of the
* returned String is undocumented and subject to change.</b>
* <p>
* <p>
* An expamle return String could be:
* <code>RelationId: http://my/super/class</code>
* </p>
*/
public String toString() {
return "RelationId: " + id;
}
public int hashCode() {
int result = 17;
result = result * 37 + uri.hashCode();
return result;
}
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof RelationId)) {
return false;
}
RelationId i = (RelationId) obj;
return id.equals(i.id);
}
/*
public Object clone() {
return super.clone();
}
*/
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.5 - 2006
* Copyright (C) INRIA, 2009
*
* 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 org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Superclass for all RelationConditions.
* </p>
* <p>
* To successfully subclass this class the <code>clone</code> and
* <code>equals</code> methods must be overwritten. And if new fields were
* introduced, the <code>hashCode</code> and <code>toString</code> methods,
* too.
* </p>
* <p>
* Created on 23-Mar-2005 Committed by $Author: poettler_ric $
* </p>
* <p>
* $Id: RelationCondition.java,v 1.5 2006/11/27 16:39:08 poettler_ric Exp $
* </p>
*
*
* @author Richard Pöttler
* @author Francois Scharffe
* @version $Revision: 1.5 $ $Date$
*/
public abstract class RelationRestriction extends RelationExpression implements Visitable {
protected RelationRestriction() {}
public void accept(AlignmentVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.2 - 2006
* Copyright (C) INRIA, 2009
*
* 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.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.net.URI;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Represents a tranformation service to transform the values of attributes.
* </p>
* <p>
* In the specification a {@code transf} is a local transformaion
* function/service. The {@code pov} specifies the parameters needed for the
* function to compute the transformaion.
* </p>
* <p>
* In the specification a {@code service} is a remote transformaion
* function/service. The {@code id} distiguishes between multiple transformation
* function at the given address. The {@code pov} specifies the parameters
* needed for the function to compute the transformaion.
* </p>
* <p>
* $Id: TransfService.java,v 1.2 2006/12/06 12:54:09 poettler_ric Exp $
* </p>
*
* @author richi
* @version $Revision: 1.2 $
* @date $Date$
*/
public class TransfService implements Cloneable, Visitable {
/** resource (uri) to the service */
private URI res;
/** id of the transformation function (only used if it is a service) */
private URI id;
/** paramteters for the transformation */
private Set<Id> params;
/**
* <p>
* Constructs a transf.
* </p>
*
* @param res
* uri to the service
* @param params
* parameters for the transformation
* @throws NullPointerException
* if the res is {@code null}
*/
public TransfService(final URI res, final Collection<Id> params) {
this(res, null, params);
}
public void accept(AlignmentVisitor visitor) throws AlignmentException {
visitor.visit(this);
}
/**
* <p>
* Constructs a service.
* </p>
*
* @param res
* uri to the service
* @param id
* id of the transformation function
* @param params
* parameters for the transformation
* @throws NullPointerException
* if the res is {@code null}
*/
@SuppressWarnings( "unchecked" )
public TransfService(final URI res, final URI id,
final Collection<Id> params) {
if (res == null) {
throw new NullPointerException("The resource must not be null");
}
this.res = res;
this.id = id;
if (params == null) {
// The unchecked would be solved by creating an empty hashset
this.params = (Set<Id>)Collections.EMPTY_SET;//[W:uncheked]
} else {
this.params = new HashSet<Id>(params);
this.params.remove(null);
}
}
/**
* Returns the resource / uri to the transformation.
*
* @return the uri to the transformator
*/
public URI getRes() {
return res;
}
/**
* Returns the id of the transformation function. This function only returns
* a usable value (another value than {@code null}) if it is a service.
*
* @return the id of the function
* @see #hasId()
*/
public URI getId() {
return id;
}
/**
* Returns an unmodifiable set of parameters needed for the transformation.
*
* @return the set of parameters
*/
public Set<Id> getParameters() {
return Collections.unmodifiableSet(params);
}
/**
* Returns whether there is a id.
*
* @return {@code true} if there is a usable id, otherwise {@code false}
* @see #getId()
*/
public boolean hasId() {
return id != null;
}
/**
* <p>
* Returns a short string description of this object. <b>The format of the
* returned string is undocumented and subject to change.</b>
* </p>
* <p>
* An example string could be:
* {@code transf: http://my/super/transf params: [dollar]}
* </p>
*/
public String toString() {
return "transf: " + res + ((id != null) ? " id: " + id : "")
+ " params: " + params;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof TransfService)) {
return false;
}
TransfService t = (TransfService) o;
return res.equals(t.res)
&& ((id == t.id) || ((id != null) && id.equals(t.id)))
&& (params.size() == t.params.size())
&& params.containsAll(t.params);
}
public int hashCode() {
int hash = 17;
hash = hash * 37 + res.hashCode();
hash = hash * 37 + ((id != null) ? id.hashCode() : 0);
hash = hash * 37 + params.hashCode();
return hash;
}
@SuppressWarnings( "unchecked" )
public Object clone() {
try {
TransfService clone = (TransfService) super.clone();
// JE: noclone on URI
//clone.res = (URI) res.clone();
clone.res = res;
clone.params = (params.isEmpty()) ? Collections.EMPTY_SET //[W:unchecked]
: new HashSet<Id>(params);
// JE: noclone on URI
//clone.id = (id == null) ? null : (URI) id.clone();
clone.id = (id == null) ? null : id;
return clone;
} catch (CloneNotSupportedException e) {
assert true : "Object is always cloneable";
}
return null;
}
}
/*
* $Id$
*
* Copyright (C) 2006 Digital Enterprise Research Insitute (DERI) Innsbruck
* Sourceforge version 1.2 - 2006
* 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
* 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;
/**
* <p>
* Id to represent a simple valuestring.
* </p>
* <p>
* $Id: Value.java,v 1.2 2006/10/30 15:24:43 poettler_ric Exp $
* </p>
*
* @author richi
* @version $Revision: 1.2 $
* @date $Date$
*/
public class Value { //implements Cloneable, Visitable {
/** Holds the value */
private String value;
/**
* Constructs an object with the given value.
*
* @param value
* the value for this object.
* @throws NullPointerException
* if the value is {@code null}
* @throws IllegalArgumentException
* if the value isn't longer than 0
*/
public Value( final String value ) {
if (value == null) {
throw new NullPointerException("The value must not be null");
}
this.value = value;
}
// public void accept(AlignmentVisitor visitor) throws AlignmentException {
// visitor.visit(this);
// }
public String plainText() {
return value;
}
public int hashCode() {
return value.hashCode();
}
public boolean equals(final Object o) {
if ( o == this ) {
return true;
}
if (!(o instanceof Value)) {
return false;
}
Value s = (Value) o;
return value.equals(s.value);
}
/*
public Object clone() {
return super.clone();
}
*/
/**
* <p>
* Returns a short description about this object. <b>The format of the
* returned string is undocumentd and subject to change.</b>
* </p>
* <p>
* An example return string could be: {@code 15}
* </p>
*/
public String toString() {
return value;
}
}
/*
* $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 org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
public class ValueConstraint implements Cloneable, Visitable {
// JE: 2010 this must be replaced by path-or-value
Value value = null;
Comparator comparator;
public ValueConstraint() {
super();
}
public ValueConstraint( Value v, Comparator comp ) {
super();
value = v;
comparator = comp;
}
public void accept( AlignmentVisitor visitor ) throws AlignmentException {
visitor.visit(this);
}
}
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