1 /*
2 wsmo4j - a WSMO API and Reference Implementation
3
4 Copyright (c) 2004-2005, OntoText Lab. / SIRMA
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 /**
20 * <p>Title: WSMO4J</p>
21 * <p>Description: WSMO API and a Reference Implementation</p>
22 * <p>Copyright: Copyright (c) 2004-2005</p>
23 * <p>Company: OntoText Lab. / SIRMA </p>
24 */
25
26 package org.omwg.ontology;
27
28
29 import java.util.*;
30
31 import org.wsmo.common.*;
32 import org.wsmo.common.exception.*;
33
34
35 /**
36 * This interface represents a WSMO ontology.
37 *
38 * @author not attributable
39 * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
40 */
41 public interface Ontology
42 extends TopEntity {
43
44 /**
45 * Adds a new concept to this ontology.
46 * Note that a call to addXXX() i.e. adding an element to an ontology, should also
47 * invoke the respective element's setOntology() method
48 * @param concept The new concept to be added.
49 * @throws org.wsmo.common.exception.SynchronisationException
50 * @throws org.wsmo.common.exception.InvalidModelException
51 * @see #removeConcept(Concept concept)
52 * @see #removeConcept(Identifier id)
53 * @see OntologyElement#setOntology(Ontology ontology)
54 */
55 void addConcept(Concept concept)
56 throws SynchronisationException, InvalidModelException;
57
58 /**
59 * Removes a particular concept from this ontology.
60 * @param concept The concept to be removed.
61 * @throws org.wsmo.common.exception.SynchronisationException
62 * @throws org.wsmo.common.exception.InvalidModelException
63 * @see #removeConcept(Identifier id)
64 */
65 void removeConcept(Concept concept)
66 throws SynchronisationException, InvalidModelException;
67
68 /**
69 * Removes a particular concept from this ontology.
70 * @param concept The concept to be removed.
71 * @throws org.wsmo.common.exception.SynchronisationException
72 * @throws org.wsmo.common.exception.InvalidModelException
73 * @see #removeConcept(Concept)
74 */
75 void removeConcept(Identifier id)
76 throws SynchronisationException, InvalidModelException;
77
78 /**
79 * Lists the concepts defined by this ontology.
80 * @return A set of concepts that this ontology contains.
81 * @throws org.wsmo.common.exception.SynchronisationException
82 * @see org.omwg.ontology.Concept
83 */
84 Set <Concept> listConcepts()
85 throws SynchronisationException;
86
87 /**
88 * Finds a concept in the set of concepts defined by this ontology (returns <i>null</i> if none found).
89 * @param id The Identifier of the requested concept.
90 * @throws org.wsmo.common.exception.SynchronisationException
91 */
92 Concept findConcept(Identifier id)
93 throws SynchronisationException;
94
95 /**
96 * Adds a new relation to the list of relations defined by this ontology.
97 * Note that a call to addXXX() i.e. adding an element to an ontology, should also
98 * invoke the respective element's setOntology() method
99 * @param relation The relatino ot be added.
100 * @throws org.wsmo.common.exception.SynchronisationException
101 * @throws org.wsmo.common.exception.InvalidModelException
102 * @see #removeRelation(Relation relation)
103 * @see #removeRelation(Identifier id)
104 * @see OntologyElement#setOntology(Ontology ontology)
105 */
106
107 void addRelation(Relation relation)
108 throws SynchronisationException, InvalidModelException;
109
110 /**
111 * Removes a relation from the list of relations defined by this ontology.
112 * @param relation The relation to be removed.
113 * @throws org.wsmo.common.exception.SynchronisationException
114 * @throws org.wsmo.common.exception.InvalidModelException
115 * @see #removeRelation(Identifier id)
116 */
117 void removeRelation(Relation relation)
118 throws SynchronisationException, InvalidModelException;
119
120 /**
121 * Removes a relation from the list of relations defined by this ontology.
122 * @param relation The relation to be removed.
123 * @throws org.wsmo.common.exception.SynchronisationException
124 * @throws org.wsmo.common.exception.InvalidModelException
125 * @see #removeRelation(Relation)
126 */
127 void removeRelation(Identifier id)
128 throws SynchronisationException, InvalidModelException;
129
130 /**
131 * Lists the relations defined by this ontology.
132 * @return A set of relations defined in this ontology.
133 * @throws org.wsmo.common.exception.SynchronisationException
134 * @see Relation
135 */
136 Set <Relation> listRelations()
137 throws SynchronisationException;
138
139 /**
140 * Finds a relation in the set of relations defined by this ontology (returns NULL if none found).
141 * @param id The Identifier of the requested relation.
142 * @throws org.wsmo.common.exception.SynchronisationException
143 */
144 Relation findRelation(Identifier id)
145 throws SynchronisationException;
146
147 /**
148 * Adds a new instance to the list of instances defined by this ontology.
149 * Note that a call to addXXX() i.e. adding an element to an ontology, should also
150 * invoke the respective element's setOntology() method
151 * @param instance The new instance to be added.
152 * @throws org.wsmo.common.exception.SynchronisationException
153 * @throws org.wsmo.common.exception.InvalidModelException
154 * @see #removeInstance(Instance instance)
155 * @see #removeInstance(Identifier id)
156 * @see OntologyElement#setOntology(Ontology ontology)
157 */
158 void addInstance(Instance instance)
159 throws SynchronisationException, InvalidModelException;
160
161 /**
162 * Removes an instance from the list of instances defined by this ontology.
163 * @param instance The instance to be removed.
164 * @throws org.wsmo.common.exception.SynchronisationException
165 * @throws org.wsmo.common.exception.InvalidModelException
166 * @see #removeInstance(Identifier id)
167 */
168 void removeInstance(Instance instance)
169 throws SynchronisationException, InvalidModelException;
170
171 /**
172 * Removes an instance from the list of instances defined by this ontology.
173 * @param instance The instance to be removed.
174 * @throws org.wsmo.common.exception.SynchronisationException
175 * @throws org.wsmo.common.exception.InvalidModelException
176 * @see #removeInstance(Instance)
177 */
178 void removeInstance(Identifier id)
179 throws SynchronisationException, InvalidModelException;
180
181 /**
182 * Lists the instances defined by this ontology.
183 * @return The list of instances defined by this ontology.
184 * @throws org.wsmo.common.exception.SynchronisationException
185 * @see Instance
186 */
187 Set <Instance> listInstances()
188 throws SynchronisationException;
189
190 /**
191 * Finds an instance in the set of instances defined by this ontology (returns NULL if none found).
192 * @param id The Identifier of the requested instance.
193 * @throws org.wsmo.common.exception.SynchronisationException
194 */
195 Instance findInstance(Identifier id)
196 throws SynchronisationException;
197
198 /**
199 * Adds a new axiom to the set of axioms defined by this ontology.
200 * Note that a call to addXXX() i.e. adding an element to an ontology, should also
201 * invoke the respective element's setOntology() method
202 * @param axiom The new axioms to be added.
203 * @throws org.wsmo.common.exception.SynchronisationException
204 * @throws org.wsmo.common.exception.InvalidModelException
205 * @see #removeAxiom(Axiom axiom)
206 * @see #removeAxiom(Identifier id)
207 * @see OntologyElement#setOntology(Ontology ontology)
208 */
209 void addAxiom(Axiom axiom)
210 throws SynchronisationException, InvalidModelException;
211
212 /**
213 * Removes an axiom from the set of axioms defined by this ontology.
214 * @param axiom The axiom to be removed.
215 * @throws org.wsmo.common.exception.SynchronisationException
216 * @throws org.wsmo.common.exception.InvalidModelException
217 * @see #removeAxiom(Identifier id)
218 */
219 void removeAxiom(Axiom axiom)
220 throws SynchronisationException, InvalidModelException;
221
222 /**
223 * Removes an axiom from the set of axioms defined by this ontology.
224 * @param id The ID of the axiom to be removed.
225 * @throws org.wsmo.common.exception.SynchronisationException
226 * @throws org.wsmo.common.exception.InvalidModelException
227 * @see #removeAxiom(Axiom axiom)
228 */
229 void removeAxiom(Identifier id)
230 throws SynchronisationException, InvalidModelException;
231
232 /**
233 * Lists the axioms defined by this ontology.
234 * @return The set of axioms defined by this ontology.
235 * @throws org.wsmo.common.exception.SynchronisationException
236 * @see Axiom
237 */
238 Set <Axiom> listAxioms()
239 throws SynchronisationException;
240
241 /**
242 * Finds an axiom in the set of axioms defined by this ontology (returns NULL if none found).
243 * @param id The Identifier of the requested axiom.
244 * @throws org.wsmo.common.exception.SynchronisationException
245 */
246 Axiom findAxiom(Identifier id)
247 throws SynchronisationException;
248
249 /**
250 * Lists the relationInstances defined by this ontology.
251 * @return The list of relationInstances defined by this ontology.
252 * @throws org.wsmo.common.exception.SynchronisationException
253 * @see RelationInstance
254 */
255 Set <RelationInstance> listRelationInstances()
256 throws SynchronisationException;
257
258 /**
259 * Adds a new relationInstance to the list of relationInstances defined by this ontology.
260 * Note that a call to addXXX() i.e. adding an element to an ontology, should also
261 * invoke the respective element's setOntology() method
262 * @param instance The new relationInstance to be added.
263 * @throws org.wsmo.common.exception.SynchronisationException
264 * @throws org.wsmo.common.exception.InvalidModelException
265 * @see #removeRelationInstance(RelationInstance instance)
266 * @see #removeRelationInstance(Identifier id)
267 * @see OntologyElement#setOntology(Ontology ontology)
268 */
269 void addRelationInstance(RelationInstance instance)
270 throws SynchronisationException, InvalidModelException;
271
272 /**
273 * Removes a relationInstance from the list of relationInstances defined by this ontology.
274 * @param instance The relationInstance to be removed.
275 * @throws org.wsmo.common.exception.SynchronisationException
276 * @throws org.wsmo.common.exception.InvalidModelException
277 * @see #removeRelationInstance(Identifier id)
278 */
279 void removeRelationInstance(RelationInstance instance)
280 throws SynchronisationException, InvalidModelException;
281
282 /**
283 * Removes a relationInstance from the list of relationInstances defined by this ontology.
284 * @param id The ID of the relationInstance to be removed.
285 * @throws org.wsmo.common.exception.SynchronisationException
286 * @throws org.wsmo.common.exception.InvalidModelException
287 * @see #removeRelationInstance(RelationInstance instance)
288 */
289 void removeRelationInstance(Identifier id)
290 throws SynchronisationException, InvalidModelException;
291
292 /**
293 * Finds a relation instance in the set of relation instances defined by this ontology (returns NULL if none found).
294 * @param id The Identifier of the requested relation instance.
295 * @throws org.wsmo.common.exception.SynchronisationException
296 */
297 RelationInstance findRelationInstance(Identifier id)
298 throws SynchronisationException;
299
300 /**
301 * Finds an object (axiom, concept, function, instance, relation, etc), returns NULL if none found.
302 * Note that if metamodelling is used (e.g. the WSMl variant is more powerful than WSML-Core) then more
303 * than one entity may correspond to a given ID.
304 * @param id The Identifier of the requested object.
305 * @throws org.wsmo.common.exception.SynchronisationException
306 * @see Entity
307 */
308 Set <Entity> findEntity(Identifier id)
309 throws SynchronisationException;
310
311 //DO NOT EDIT below this line
312
313 /**
314 * @link aggregationByValue
315 * @supplierCardinality 0..*
316 * @supplierRole contains
317 * @clientCardinality 1
318 * @clientRole defined-in
319 */
320 /*# Axiom lnkAxiom; */
321
322 /**
323 * @link aggregationByValue
324 * @supplierCardinality 0..*
325 * @supplierRole contains
326 * @clientCardinality 1
327 * @clientRole defined-in
328 */
329 /*# Relation lnkRelation; */
330
331 /**
332 * @link aggregationByValue
333 * @supplierCardinality 0..*
334 * @supplierRole contains
335 * @clientCardinality 1
336 * @clientRole defined-in
337 */
338 /*# RelationInstance lnkRelationInstance; */
339
340 /**
341 * @link aggregationByValue
342 * @supplierCardinality 0..*
343 * @supplierRole contains
344 * @clientCardinality 1
345 * @clientRole defined-in
346 */
347 /*# Instance lnkInstance; */
348
349 /**
350 * @link aggregationByValue
351 * @supplierCardinality 0..*
352 * @supplierRole contains
353 * @clientCardinality 1
354 * @clientRole defined-in
355 */
356 /*# Concept lnkConcept; */
357 }
358
359 /*
360 * $Log$
361 * Revision 1.22 2007/04/02 12:13:14 morcen
362 * Generics support added to wsmo-api, wsmo4j and wsmo-test
363 *
364 * Revision 1.21 2005/10/18 09:08:04 marin_dimitrov
365 * findEntity resturns Set (was Entity[])
366 *
367 * Revision 1.20 2005/10/17 13:17:21 marin_dimitrov
368 * metamodeliing extensions
369 *
370 * Revision 1.19 2005/09/21 08:15:39 holgerlausen
371 * fixing java doc, removing asString()
372 *
373 * Revision 1.18 2005/06/01 10:13:40 marin_dimitrov
374 * v0.4.0
375 *
376 * Revision 1.7 2005/05/13 15:38:26 marin
377 * fixed javadoc errors
378 *
379 * Revision 1.6 2005/05/13 13:29:12 marin
380 * more comments
381 *
382 * Revision 1.5 2005/05/13 13:17:38 marin
383 * javadoc, header, footer, etc
384 *
385 */