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.wsmo.factory;
27
28 import org.omwg.ontology.*;
29 import org.wsmo.common.*;
30 import org.wsmo.common.exception.*;
31 import org.wsmo.mediator.*;
32 import org.wsmo.service.*;
33
34
35 /**
36 * WsmoFactory interface, used to create WSMO entities (goals, ontologies, ...)
37 * @author not attributable
38 * @version $Revision: 1761 $ $Date: 2006-06-21 10:46:29 +0300 (Wed, 21 Jun 2006) $
39 */
40 public interface WsmoFactory {
41
42 /** Creates a goal.
43 * @param id The ID of the new goal object.
44 * @return The newly created goal object.
45 */
46 Goal createGoal(IRI id);
47
48 /**
49 * Creates a new WebService object.
50 * @param id The ID of the new service.
51 * @return The new WebService object.
52 */
53 WebService createWebService(IRI id);
54
55 /**
56 * Creates a new Capability object.
57 * @param id The ID of the new Capapbility.
58 * @return The newly created Capability object.
59 */
60 Capability createCapability(IRI id);
61
62 /**
63 * Creates a new Interface object.
64 * @param id The ID of the new interface object.
65 * @return The newly created interface object.
66 */
67 Interface createInterface(IRI id);
68
69 /**
70 * Creates a new Ontology object.
71 * @param id The ID of the new ontology.
72 * @return The new Ontology object.
73 */
74 Ontology createOntology(IRI id);
75
76 /**
77 * Creates a mediator.
78 * @param id The ID of the new mediator object.
79 * @return The newly created mediator.
80 */
81 OOMediator createOOMediator(IRI id);
82
83 /**
84 * Creates a mediator.
85 * @param id The ID of the new mediator object.
86 * @return The newly created mediator.
87 */
88 WWMediator createWWMediator(IRI id);
89
90 /**
91 * Creates a mediator.
92 * @param id The ID of the new mediator object.
93 * @return The newly created mediator.
94 */
95 WGMediator createWGMediator(IRI id);
96
97 /**
98 * Creates a mediator.
99 * @param id The ID of the new mediator object.
100 * @return The newly created mediator.
101 */
102 GGMediator createGGMediator(IRI id);
103
104 /**
105 * Creates a new Axiom object.
106 * @param id The ID of the new Axiom object.
107 * @return The newly created Axion object.
108 */
109 Axiom createAxiom(Identifier id);
110
111 /**
112 * Creates a new Concept object.
113 * @param id The ID of the new Concept object.
114 * @return The newly created Concept object.
115 */
116 Concept createConcept(Identifier id);
117
118 /**
119 * Creates a new Relation object.
120 * @param id The ID of the new relation.
121 * @return The newly created Relation object.
122 */
123 Relation createRelation(Identifier id);
124
125 /**
126 * Creates a new Instance object.
127 * @param id The ID of the new instance object.
128 * @param concept The Concept this Instance object is an instance of
129 * @return The newly created Instance object.
130 */
131 Instance createInstance(Identifier id);
132
133 /**
134 * Creates a new Instance object.
135 * @param id The ID of the new instance object.
136 * @param concept The Concept of the this Instance object is an instance of
137 * @return The newly created Instance object.
138 */
139 Instance createInstance(Identifier id, Concept concept)
140 throws SynchronisationException, InvalidModelException;
141
142 /**
143 * Creates a new RelationInstance object.
144 * @param rel The relation this RelationInstance object is an instance of.
145 * @return The newly created RelationInstance object.
146 */
147 RelationInstance createRelationInstance(Relation rel)
148 throws SynchronisationException, InvalidModelException;
149
150 /**
151 * Creates a new RelationInstance object.
152 * @param id The ID of the new RelationInstance object.
153 * @param rel The relation this RelationInstance object is an instance of.
154 * @return The newly created RelationInstance object.
155 */
156 RelationInstance createRelationInstance(Identifier id, Relation rel)
157 throws SynchronisationException, InvalidModelException;
158
159 /**
160 * Creates a new Namespace object.
161 * @param prefix namespace prefix. If <i>null</i> then the namespace should be used only as a default namespace
162 * @param uri the IRI of the namespace
163 * @return The newly created Namespace object.
164 */
165 Namespace createNamespace(String prefix, IRI iri);
166
167 /**
168 * Creates a new IRI object. (for example 'http://www.wsmo.org/x/y/z/')
169 * @param fullIRI the IRI (as String)
170 * @return The newly created IRI object.
171 * @see #createIRI(Namespace ns, String localPart)
172 */
173 IRI createIRI(String fullIRI);
174
175 /**
176 * Creates a new IRI object (for example 'ns:x').
177 * @param ns the namespace used
178 * @param localPart the local part of the IRI (as String)
179 * @return The newly created IRI object.
180 * @see #createIRI(String fullIRI)
181 */
182 IRI createIRI(Namespace ns, String localPart);
183
184 /**
185 * Creates an unnumbered ID (i.e. '_#')
186 * @return The newly created IRI object.
187 * @see #createAnonymousID(byte number)
188 */
189 UnnumberedAnonymousID createAnonymousID();
190
191 /*
192 * Creates an numbered ID (i.e. '_#1', '_#2',...)
193 * @return The newly created IRI object.
194 * @see #createAnonymousID()
195 *
196 NumberedAnonymousID createAnonymousID(byte number);
197 */
198
199 /**
200 * Return an existing Goal instance
201 * @param id The ID of the existing Goal objec
202 * @return An existing Goal instance
203 */
204 Goal getGoal(IRI id);
205
206 /**
207 * Return existing WebService instance
208 * @param id The identifier of the WebService
209 * @return WebService instance
210 */
211 WebService getWebService(IRI id);
212
213 /**
214 * Return an existing Interface instance
215 * @param id The identifier of the Interface instance
216 * @return An exisiting Interface instance
217 */
218 Interface getInterface(IRI id);
219
220 /**
221 * Return existing Capability instance
222 * @param id The Capability identifier
223 * @return existing Capability instance
224 */
225 Capability getCapability(IRI id);
226
227 /**
228 * Return exisitng Ontology instance
229 * @param id The Ontology
230 * @return existing Ontology instance
231 */
232 Ontology getOntology(IRI id);
233
234 /**
235 * Return an existing OOMediator instance
236 * @param id The ID of an existing OOMediator
237 * @return existing OOMediator insatnce
238 */
239 OOMediator getOOMediator(IRI id);
240
241 /**
242 * Return existing WWMediator instance
243 * @param d Teh ID of the WWMediator instance
244 * @return xiasing WWMedaitor instance
245 */
246 WWMediator getWWMediator(IRI id);
247
248 /**
249 * Return existing WGMediator instance
250 * @param id The ID of the WGMediator instance
251 * @return existing WGMediator instance
252 */
253 WGMediator getWGMediator(IRI id);
254
255 /**
256 * Return exiasing GGMediator instance
257 * @param id The ID of the GGMediator instance
258 * @return existing GGMediator instance
259 */
260 GGMediator getGGMediator(IRI id);
261
262 /**
263 * Return existing Axiom instance
264 * @param id The ID of the Axiom
265 * @return existing Axiom insatnce
266 */
267 Axiom getAxiom(Identifier id);
268
269 /**
270 * Return existing Concept insatnce
271 * @param id The ID of the Concept
272 * @return existing Concept Instance
273 */
274 Concept getConcept(Identifier id);
275
276 /**
277 * Return existing Instance object
278 * @param id The ID of the Instance
279 * @return existing Instance object
280 */
281 Instance getInstance(Identifier id);
282
283 /**
284 * Return existing Relation object
285 * @param id The ID of the Relation
286 * @return existing Relation object
287 */
288 Relation getRelation(Identifier id);
289
290 /**
291 * Return existing RelationInstance object
292 * @param id The ID of the RelationInstance
293 * @return existing RelationInstance object
294 */
295 RelationInstance getRelationInstance(Identifier id);
296
297 /**
298 * Return existing Varible instance
299 * @param name The name of the var
300 * @return existing var
301 */
302 Variable getVariable(String name);
303 }
304
305 /*
306 * $Log$
307 * Revision 1.9 2006/06/21 07:46:13 vassil_momtchev
308 * createVariable(String) method moved from WsmoFactory to LogicalExpressionFactory interface
309 *
310 * Revision 1.8 2006/02/10 14:27:46 vassil_momtchev
311 * getAttribute(IRI) method dropped from factory; attributes are strictly local to the scope of a concept
312 *
313 * Revision 1.7 2005/09/13 08:58:48 vassil_momtchev
314 * WsmoFactory.createRelationInstance(Identifier) replaced by WsmoFactory.createRelationInstance(Relation) (anonymous identifier is used)
315 *
316 * Revision 1.6 2005/09/02 09:43:32 ohamano
317 * integrate wsmo-api and le-api on api and reference implementation level; full parser, serializer and validator integration will be next step
318 *
319 * Revision 1.5 2005/09/02 08:44:52 marin_dimitrov
320 * createVariable() does not throw InvalidModelEx anymore
321 *
322 * Revision 1.4 2005/09/01 14:55:53 vassil_momtchev
323 * method createAttribute(IRI, Concept) removed
324 *
325 * Revision 1.3 2005/06/06 13:58:56 marin_dimitrov
326 * 1. createSharedvariable --> createVariable
327 *
328 * 2. getVariable added
329 *
330 * Revision 1.2 2005/06/06 13:42:51 alex_simov
331 * createSharedVariable() added
332 *
333 * Revision 1.1 2005/06/01 10:34:43 marin_dimitrov
334 * v0.4.0
335 *
336 * Revision 1.9 2005/05/31 09:27:31 damian
337 * new family of 'get' methods added
338 *
339 * Revision 1.8 2005/05/31 08:57:20 damian
340 * new family of 'get' methods added
341 *
342 * Revision 1.7 2005/05/19 14:21:16 marin
343 * 1. createXXXInstance throws exceptions
344 * 2. createNamespace accepts IRI (was: String)
345 *
346 * Revision 1.6 2005/05/19 13:56:06 marin
347 * javadocs
348 *
349 */