KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > ontology > daml > DAMLClass


1 /*****************************************************************************
2  * Source code information
3  * -----------------------
4  * Original author Ian Dickinson, HP Labs Bristol
5  * Author email Ian.Dickinson@hp.com
6  * Package Jena
7  * Created 4 Jan 2001
8  * Filename $RCSfile: DAMLClass.java,v $
9  * Revision $Revision: 1.11 $
10  * Release status Preview-release $State: Exp $
11  *
12  * Last modified on $Date: 2005/02/21 12:04:56 $
13  * by $Author: andy_seaborne $
14  *
15  * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
16  * (see footer for full conditions)
17   *****************************************************************************/

18
19 // Package
20
///////////////
21
package com.hp.hpl.jena.ontology.daml;
22
23
24 // Imports
25
///////////////
26
import com.hp.hpl.jena.ontology.OntClass;
27 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
28
29
30
31 /**
32  * <p>Java representation of a DAML ontology Class. Note that the ontology classes are
33  * not the same as Java classes: think of classifications rather than active data structures.</p>
34  *
35  * @author Ian Dickinson, HP Labs (<a HREF="mailto:Ian.Dickinson@hp.com">email</a>)
36  * @version CVS info: $Id: DAMLClass.java,v 1.11 2005/02/21 12:04:56 andy_seaborne Exp $
37  */

38 public interface DAMLClass
39     extends DAMLCommon, OntClass
40 {
41     // Constants
42
//////////////////////////////////
43

44
45     // External signature methods
46
//////////////////////////////////
47

48
49     /**
50      * <p>Property accessor for the <code>daml:subClassOf</code> property of a class. This
51      * denotes a class that is a super-class of this class.
52      *
53      * @return Property accessor for <code>daml:subClassOf</code>.
54      */

55     public PropertyAccessor prop_subClassOf();
56
57
58     /**
59      * <p>Property accessor for the <code>daml:disjointWith</code> property of a class. This
60      * denotes a class with which this class has no instances in common.</p>
61      *
62      * @return Property accessor for <code>daml:disjointWith</code>.
63      */

64     public PropertyAccessor prop_disjointWith();
65
66
67     /**
68      * <p>Property accessor for the <code>daml:disjointUnionOf</code> property of a class. This
69      * denotes a list of classes that are each pair-wise disjoint, and whose
70      * union describes this class.</p>
71      *
72      * @return Property accessor for <code>daml:disjointUnionOf</code>.
73      */

74     public PropertyAccessor prop_disjointUnionOf();
75
76
77     /**
78      * <p>Property accessor for the <code>daml:sameClassAs</code> property of a DAML class. This
79      * denotes a class whose instances are the same those of this class.</p>
80      *
81      * @return Property accessor for <code>daml:sameClassAs</code>.
82      */

83     public PropertyAccessor prop_sameClassAs();
84
85
86     /**
87      * <p>Property accessor for the property <code>daml:unionOf</code>, which denotes a class
88      * expression consisting of the union (disjunction) of a list of classes.</p>
89      *
90      * @return Property accessor for <code>daml:unionOf</code>.
91      */

92     public PropertyAccessor prop_unionOf();
93
94
95     /**
96      * <p>Property accessor for the property <code>daml:intersectionOf</code>, which denotes an
97      * intersection (conjunction) of a list of classes.</p>
98      *
99      * @return Property accessor for <code>daml:intersectionOf</code>.
100      */

101     public PropertyAccessor prop_intersectionOf();
102
103
104     /**
105      * <p>Property accessor for the property <code>daml:compelementOf</code>, which denotes the
106      * class whose members are the individuals not in the given class.</p>
107      *
108      * @return Property accessor for <code>daml:compelementOf</code>.
109      */

110     public PropertyAccessor prop_complementOf();
111
112
113     /**
114      * <p>Property accessor for the <code>daml:oneOf</code> property, which defines a class expression
115      * denoting that the class is exactly one of the given list of classes.</p>
116      *
117      * @return Property accessor for <code>daml:oneOf</code>.
118      */

119     public PropertyAccessor prop_oneOf();
120
121
122     /**
123      * <p>Answer an iterator over the DAML classes
124      * that mention this class as one of its super-classes. Will return
125      * all available sub-classes (see {@link #getSubClasses(boolean)} for
126      * more details). The elements
127      * of the iterator will be {@link DAMLClass} objects.</p>
128      * @return An iterator over all available sub-classes of this class
129      */

130     public ExtendedIterator getSubClasses();
131
132
133     /**
134      * <p>Answer an iterator over the DAML classes
135      * that mention this class as one of its super-classes.
136      * The members of the iterator will be {@link DAMLClass} objects
137      * </p>
138      * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
139      * this iterator includes <em>inferred</em> sub-classes is determined
140      * not by a flag at the API level, but by the construction of the DAML
141      * model itself. See {@linkplain com.hp.hpl.jena.rdf.model.ModelFactory the model factory}
142      * for details. The boolean parameter
143      * <code>closed</code> is now re-interpreted to mean the inverse of <code>
144      * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
145      * </p>
146      *
147      * @param closed If true, return all available values; otherwise, return
148      * only local (direct) sub-classes. See note for details.
149      * @return An iterator over this class's sub-classes.
150      */

151     public ExtendedIterator getSubClasses( boolean closed );
152
153
154     /**
155      * <p>Answer an iterator over the DAML classes
156      * that are super-classes of this class. Will return
157      * all available super-classes (see {@link #getSuperClasses(boolean)} for
158      * more details). The elements
159      * of the iterator will be {@link DAMLClass} objects.</p>
160      * @return An iterator over all available super-classes of this class
161      */

162     public ExtendedIterator getSuperClasses();
163
164
165     /**
166      * <p>Answer an iterator over the DAML classes
167      * that are super-classes of this class.
168      * The members of the iterator will be {@link DAMLClass} objects
169      * </p>
170      * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
171      * this iterator includes <em>inferred</em> super-classes is determined
172      * not by a flag at the API level, but by the construction of the DAML
173      * model itself. See {@linkplain com.hp.hpl.jena.rdf.model.ModelFactory the model factory}
174      * for details. The boolean parameter
175      * <code>closed</code> is now re-interpreted to mean the inverse of <code>
176      * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
177      * </p>
178      *
179      * @param closed If true, return all available values; otherwise, return
180      * only local (direct) super-classes. See note for details.
181      * @return an iterator over this class's super-classes.
182      */

183     public ExtendedIterator getSuperClasses( boolean closed );
184
185
186     /**
187      * <p>Answer an iterator over all of the DAML classes that are equivalent to this
188      * value under the <code>daml:sameClassAs</code> relation. Note: only considers
189      * <code>daml:sameClassAs</code>, for general equivalence, see
190      * {@link #getEquivalentValues}. Note also that the first member of the iteration is
191      * always the DAMLClass on which the method is invoked: trivially, a DAMLClass is
192      * a member of the set of DAMLClasses equivalent to itself. If the caller wants
193      * the set of classes equivalent to this one, not including itself, simply ignore
194      * the first element of the iteration.</p>
195      *
196      * @return an iterator ranging over every equivalent DAML classes
197      */

198     public ExtendedIterator getSameClasses();
199
200
201     /**
202      * <p>Answer an iterator over all of the DAML objects that are equivalent to this
203      * class, which will be the union of <code>daml:equivalentTo</code> and
204      * <code>daml:sameClassAs</code>.</p>
205      *
206      * @return an iterator ranging over every equivalent DAML class
207      */

208     public ExtendedIterator getEquivalentValues();
209
210
211     /**
212      * <p>Answer an iterator over the instances of this class that currently exist
213      * in the model.<p>
214      *
215      * @return An iterator over those instances that have this class as one of
216      * the classes to which they belong
217      * @see com.hp.hpl.jena.ontology.daml.DAMLCommon#getRDFTypes
218      */

219     public ExtendedIterator getInstances();
220
221
222     /**
223      * <p>Answer an iteration of the properties that may be used for
224      * instances of this class: i&#046;e&#046; the properties that have this class,
225      * or one of its super-classes, as domain.<p>
226      *
227      * @return An iteration of the properties that have this class in the domain
228      */

229     public ExtendedIterator getDefinedProperties();
230
231
232     /**
233      * <p>Answer an iteration of the properties that may be used for
234      * instances of this class: i&#046;e&#046; the properties that have this class,
235      * or optionally one of its super-classes, as domain.</p>
236      * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
237      * this iterator includes the defined properties for <em>inferred</em>
238      * super-classes is determined
239      * not by a flag at the API level, but by the construction of the DAML
240      * model itself. See {@linkplain com.hp.hpl.jena.rdf.model.ModelFactory the model factory}
241      * for details. The boolean parameter
242      * <code>closed</code> is now re-interpreted to mean the inverse of <code>
243      * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
244      * </p>
245      *
246      * @param closed If true, use all available information from the class hierarchy;
247      * if false, only use local properties.
248      * @return An iteration of the properties that have this class as domain
249      */

250     public ExtendedIterator getDefinedProperties( boolean closed );
251     
252     
253     /**
254      * <p>Answer true if this class is an enumeration (i&#046;e&#046; has a property
255      * <code>daml:oneOf</code> with a list of values). This is not an exclusive property, a class
256      * can be an enumeration at the same time as one of the other kinds
257      * of class expression, though the conjunction of these may produce the Nothing
258      * class.</p>
259      *
260      * @return True if this class expression is an enumeration.
261      */

262     public boolean isEnumeration();
263
264
265     /**
266      * <p>Answer true if this class is a named class (i&#046;e&#046; is not an anonymous
267      * class expression). This is not an exclusive property, a class
268      * can be named at the same time as one of the other kinds
269      * of class expression.</p>
270      *
271      * @return True if this class expression is a named class.
272      */

273     public boolean isNamedClass();
274
275
276     /**
277      * <p>Answer true if this class is an property restriction (i&#046;e&#046; is a
278      * <code>daml:Restriction</code> instance). This is not an exclusive property: a class
279      * expression can be a property restriction at the same time as one of the other kinds
280      * of class expression, though the conjunction of these may produce the Nothing
281      * class.
282      *
283      * @return True if this class is a property restriction.
284      */

285     public boolean isRestriction();
286
287
288     /**
289      * <p>Answer true if this class is an intersection of a list
290      * of classes. This is not an exclusive property: a class
291      * expression can be an intersection at the same time as one of the other kinds
292      * of class expression, though the conjunction of these may produce the Nothing
293      * class.</p>
294      *
295      * @return True if this class is an intersection class expression.
296      */

297     public boolean isIntersection();
298
299
300     /**
301      * <p>Answer true if this class is a union of a list
302      * of classes. This is not an exclusive property, a class
303      * expression can be a union at the same time as one of the other kinds
304      * of class expression, though the conjunction of these may produce the Nothing
305      * class.</p>
306      *
307      * @return True if this class is a union class expression.
308      */

309     public boolean isUnion();
310
311
312     /**
313      * <p>Answer true if this class is a disjoint union of a list
314      * of classes. This is not an exclusive property, a class
315      * expression can be a disjoint union at the same time as one of the other kinds
316      * of class expression, though the conjunction of these may produce the Nothing
317      * class.</p>
318      *
319      * @return True if this class is a disjoint union expression.
320      */

321     public boolean isDisjointUnion();
322
323
324     /**
325      * <p>Answer true if this class expression is an boolean complement of another
326      * class. This is not an exclusive property, a class
327      * expression can be an complement at the same time as one of the other kinds
328      * of class expression, though the conjunction of these may produce the Nothing
329      * class.
330      *
331      * @return True if this class is a complement class expression.
332      */

333     public boolean isComplement();
334
335 }
336
337
338 /*
339     (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
340     All rights reserved.
341
342     Redistribution and use in source and binary forms, with or without
343     modification, are permitted provided that the following conditions
344     are met:
345
346     1. Redistributions of source code must retain the above copyright
347        notice, this list of conditions and the following disclaimer.
348
349     2. Redistributions in binary form must reproduce the above copyright
350        notice, this list of conditions and the following disclaimer in the
351        documentation and/or other materials provided with the distribution.
352
353     3. The name of the author may not be used to endorse or promote products
354        derived from this software without specific prior written permission.
355
356     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
357     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
358     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
359     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
360     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
361     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
362     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
363     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
364     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
365     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
366 */

367
368
Popular Tags