View Javadoc

1   /*
2    wsmo4j - a WSMO API and Reference Implementation
3   
4    Copyright (c) 2005, University of Innsbruck, Austria
5   
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  
19  package org.wsmo.validator;
20  
21  
22  import java.util.*;
23  
24  import org.omwg.logicalexpression.LogicalExpression;
25  import org.wsmo.common.*;
26  
27  
28  
29  /**
30   * Extends the interface of wsmo-api with necessary properties needed during
31   * implementation (might be merged with wsmo-api later).
32   * <p>Checks only for standard datatypes. </p>
33   *
34   * <pre>
35   *  Created on Aug 18, 2005
36   *  Committed by $Author: morcen $
37   *  $Source$,
38   * </pre>
39   *
40   * @author Holger Lausen (holger.lausen@deri.org)
41   * @author Nathalie Steinmetz
42   * @see org.wsmo.validator.Validator
43   * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
44   */
45  public interface WsmlValidator extends Validator{
46  
47  	public static final String VALIDATE_IMPORTS = "Validate imports";
48  	
49      /**
50       * Checks whether a WSMO element definition is valid. The notion of
51       * "validity" is dependent only on the specific Validator implementation
52       * (f.e. a validity check may be whether a definition is compliant with a
53       * specific WSML variant)
54       *
55       * @param te
56       *            the TopEntity to be validated (ontology, mediator, goal,...)
57       * @param variant
58       *            the Variant for which should be checked
59       * @param errorMessages
60       *            a collection where the validation specific error messages will
61       *            be added (if any)
62       * @param warningMessages
63       *            a collection where the validation specific warning messages will
64       *            be added (if any)
65       * @return valid/invalid
66       * @see org.omwg.ontology.Ontology
67       */
68      boolean isValid(TopEntity te, String variant, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages);
69      
70      /**
71       * Checks whether a logical expression is valid. The notion of
72       * "validity" is dependent only on the specific Validator implementation
73       * (f.e. a validity check may be whether a definition is compliant with a
74       * specific WSML variant)
75       *
76       * @param logExpr
77       *            the logical expression to be validated
78       * @param variant
79       *            the Variant for which should be checked
80       * @param errorMessages
81       *            a collection where the validation specific error messages will
82       *            be added (if any)
83       * @param warningMessages
84       *            a collection where the validation specific warning messages will
85       *            be added (if any)
86       * @return valid/invalid
87       * @see org.omwg.logicalexpression.LogicalExpression
88       */
89      boolean isValid(LogicalExpression logExpr, String variant, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages);
90      
91      /**
92       * Determines the Variant of a topEntity
93       *
94       * @param te
95       *            topEntity to be checked.
96       * @param errorMessages
97       *            a collection where the validation specific error messages will
98       *            be added (if any)
99       * @param warningMessages
100      *            a collection where the validation specific warning messages will
101      *            be added (if any)
102      * @return The IRI of variant that te is in, null if not valid wsml full
103      */
104     String determineVariant(TopEntity te, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages);
105     
106     /**
107      * Determines the Variant of a logical expression
108      *
109      * @param logExpr
110      *            logical expression to be checked.
111      * @param errorMessages
112      *            a collection where the validation specific error messages will
113      *            be added (if any)
114      * @param warningMessages
115      *            a collection where the validation specific warning messages will
116      *            be added (if any)
117      * @return The IRI of variant that logExpr is in, null if not valid wsml full
118      */
119     String determineVariant(LogicalExpression logExpr, List <ValidationError> errorMessages, List <ValidationWarning> warningMessages);
120     
121 }
122 
123 /*
124  * $Log$
125  * Revision 1.11  2007/04/02 12:13:15  morcen
126  * Generics support added to wsmo-api, wsmo4j and wsmo-test
127  *
128  * Revision 1.10  2006/09/20 09:13:04  nathaliest
129  * added validator methods for logical expressions
130  *
131  * Revision 1.9  2006/08/22 16:26:53  nathaliest
132  * added support for validating imported ontologies
133  *
134  * Revision 1.8  2006/01/11 13:01:45  marin_dimitrov
135  * common constants moved to Factory
136  *
137  * Revision 1.7  2006/01/09 16:16:43  nathaliest
138  * deleted duplicate entry from wsmo4j.properties and renamed the parser_le_factory and the parser_wsmo_factory to le_factory and wsmo_factory.
139  *
140  * Revision 1.6  2006/01/05 14:57:48  nathaliest
141  * Validator uses leFactory taken in constructor from properties map
142  *
143  * Revision 1.5  2005/11/15 16:49:45  nathaliest
144  * added validation warning to the interface
145  *
146  * Revision 1.4  2005/09/23 12:06:32  holgerlausen
147  * moved wsml varinat constructs to common.wsml
148  *
149  * Revision 1.3  2005/09/21 08:15:39  holgerlausen
150  * fixing java doc, removing asString()
151  *
152  * Revision 1.2  2005/09/11 22:10:20  nathaliest
153  * changed method to determine variant and added doc
154  *
155  * Revision 1.1  2005/09/09 15:45:06  marin_dimitrov
156  * moved from org.wsmo.common
157  *
158  * Revision 1.3  2005/09/09 15:22:21  nathaliest
159  * let WsmlValidator extend Validator
160  *
161  * Revision 1.2  2005/09/09 10:48:51  marin_dimitrov
162  * formatting
163  *
164  */