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
27 package org.wsmo.common;
28
29
30 import java.util.Set;
31
32 import org.omwg.ontology.Ontology;
33
34
35 /**
36 * Base class for top level WSMO entities (ontologies, mediators, goals, services + capabilities and interfaces)
37 *
38 * @author not attributable
39 * @version $Revision: 1946 $ $Date: 2007-04-02 15:13:28 +0300 (Mon, 02 Apr 2007) $
40 * @since 0.4.0
41 */
42 public interface TopEntity
43 extends Entity {
44
45 /**
46 * returns the WSML variant used for the definition of this entity
47 * @return the name of the WSML variant (as string)
48 * @see WSML
49 * @see #setWsmlVariant(String variant)
50 */
51 String getWsmlVariant();
52
53 /**
54 * specifies the WSML variant used for the definition of this entity
55 * @param variant the name of the WSML variant (as string)
56 * @see org.wsmo.common.WSML
57 */
58 void setWsmlVariant(String variant);
59
60 /**
61 * retrieves all avalible namespaces (prefix/iri pairs).
62 * Note: This does not include the default namespace
63 * @return a set of namespaces
64 * @see Namespace
65 * @see #getDefaultNamespace()
66 */
67 Set <Namespace> listNamespaces();
68
69 /**
70 * add a namespace in the contaioner
71 * @param ns to add
72 * @see #removeNamespace(String)
73 * @see #removeNamespace(Namespace)
74 */
75 void addNamespace(Namespace ns);
76
77 /**
78 * remove namespace from the top entity
79 * @param prexif prexif of the namespcae to be removed
80 */
81 void removeNamespace(String prefix);
82
83 /**
84 * remove namespace from the top entity
85 * @param ns namespace to be removed
86 */
87 void removeNamespace(Namespace ns);
88
89 /**
90 * finds a namespace by its prefix
91 * @param prefix of a namespace to look for
92 * @return a namesspace with such prefix or null if not found
93 */
94 Namespace findNamespace(String prefix);
95
96 /**
97 * retrieve the default namespace
98 * @return default namespace or null if not set
99 * @see #setDefaultNamespace(Namespace ns)
100 * @see #setDefaultNamespace(IRI iri)
101 */
102 Namespace getDefaultNamespace();
103
104 /**
105 * sets a default namespace for the container
106 * @param ns namespace to set as default
107 * @see #setDefaultNamespace(IRI iri)
108 */
109 void setDefaultNamespace(Namespace ns);
110
111 /**
112 * sets a default namespace for the container
113 * @param iri IRI of namespace to set as default
114 * @see #setDefaultNamespace(Namespace ns)
115 */
116 void setDefaultNamespace(IRI iri);
117
118 /**
119 * Adds a reference to a new mediator to this element's used mediators list.
120 * @param iri the ID of the used mediator reference
121 * @see #removeMediator(IRI mediator)
122 */
123 void addMediator(IRI mediator);
124
125 /**
126 * Removes a reference to a mediator from this element's used mediator list.
127 * @param iri The ID of the mediator to be removed from this element's list of used mediators.
128 */
129 void removeMediator(IRI iri);
130
131 /**
132 * Returns the list of used mediators.
133 * @return : The list of used mediators.
134 * @see org.wsmo.mediator.Mediator
135 */
136 Set <IRI> listMediators();
137
138 /**
139 * Adds an ontology to this element's imported ontologies list
140 * @param ontology The ontology to be imported.
141 * @see #removeOntology(Ontology ontology)
142 * @see #removeOntology(IRI iri)
143 */
144 void addOntology(Ontology ontology);
145
146 /**
147 * Removes an ontology from the list of ontolgies which this element imports.
148 * @param iri The ID of the ontology to be removed from this element's imported ontologies list.
149 */
150 void removeOntology(IRI iri);
151
152 /**
153 * Removes an ontology from the list of ontolgies which this element imports.
154 * @param ontology The ontology to be removed from this element's imported ontologies list.
155 */
156 void removeOntology(Ontology ontology);
157
158 /**
159 * Returns a list of ontologies which this element imports.
160 * @return : The list of ontologies that this element imports.
161 * @see org.omwg.ontology.Ontology
162 */
163 Set <Ontology> listOntologies();
164
165 //DO NOT EDIT below this line
166
167 /**
168 * @supplierCardinality 1
169 * @supplierRole default namespace
170 * @directed
171 */
172 /*# Namespace lnkNamespace1; */
173
174 /**
175 * @supplierCardinality 0..*
176 * @supplierRole namespaces
177 * @directed
178 */
179 /*# Namespace lnkNamespace; */
180 }
181
182 /*
183 * $Log$
184 * Revision 1.5 2007/04/02 12:13:14 morcen
185 * Generics support added to wsmo-api, wsmo4j and wsmo-test
186 *
187 * Revision 1.4 2006/04/05 13:21:52 vassil_momtchev
188 * usesMediator now refer mediators by IRI instead of handle to object
189 *
190 * Revision 1.3 2005/11/22 09:23:48 holgerlausen
191 * added docu for namespace issue by jan (rfe 1348215)
192 *
193 * Revision 1.2 2005/09/21 08:15:39 holgerlausen
194 * fixing java doc, removing asString()
195 *
196 * Revision 1.1 2005/06/01 10:30:24 marin_dimitrov
197 * v0.4.0
198 *
199 * Revision 1.5 2005/05/13 12:38:36 marin
200 * added setDefaultNamespace(IRI) since the def namespace does not have a prefix, e.g. it is not a complete Namespace object
201 *
202 * Revision 1.4 2005/05/12 14:42:57 marin
203 * added @since tags
204 *
205 * Revision 1.3 2005/05/12 13:29:16 marin
206 * javadoc, header, footer, etc
207 *
208 */