KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > ontology > Profile


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

19
20 // Package
21
///////////////
22
package com.hp.hpl.jena.ontology;
23
24
25
26 // Imports
27
///////////////
28
import com.hp.hpl.jena.enhanced.*;
29 import com.hp.hpl.jena.graph.*;
30 import com.hp.hpl.jena.rdf.model.*;
31
32 import java.util.Iterator JavaDoc;
33
34
35
36 /**
37  * <p>
38  * Interface that encapsulates the elements of a general vocabulary
39  * corresponding to a particular ontology language. The intent is that, using
40  * a given vocabulary, a given RDF model can be processed as an ontology
41  * description, without binding knowledge of the vocabulary into this Java
42  * package. For tractability, this limits the vocabularies that can easily be
43  * represented to those that are similar to OWL and DAML+OIL.
44  * </p>
45  *
46  * @author Ian Dickinson, HP Labs
47  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
48  * @version CVS $Id: Profile.java,v 1.16 2005/02/21 12:04:36 andy_seaborne Exp $
49  */

50 public interface Profile
51 {
52     // Constants
53
//////////////////////////////////
54

55     // External signature methods
56
//////////////////////////////////
57

58
59     /**
60      * <p>
61      * Answer the string that is the namespace prefix for this vocabulary
62      * </p>
63      *
64      * @return The namespace prefix, for example <code>http://www.w3c.org/2002/07/owl#</code>
65      */

66     public String JavaDoc NAMESPACE();
67     
68     
69     // Language classes
70
////////////////////////////////
71

72     
73     /**
74      * <p>
75      * Answer the resource that represents the class 'class' in this vocabulary.
76      * </p>
77      *
78      * @return The resource that represents the concept of a class
79      */

80     public Resource CLASS();
81     
82     
83     /**
84      * <p>
85      * Answer the resource that represents the a class formed by placing
86      * constraints (restrictions) on the values of a property.
87      * </p>
88      *
89      * @return The resource that represents the concept of a restriction
90      */

91     public Resource RESTRICTION();
92     
93     
94     /**
95      * <p>
96      * Answer the resource that represents the class all individuals.
97      * </p>
98      *
99      * @return The resource that represents the concept of the <i>top</i> class
100      */

101     public Resource THING();
102     
103     
104     /**
105      * <p>
106      * Answer the resource that represents the necessarily empty class.
107      * </p>
108      *
109      * @return The resource that represents the concept the <i>bottom</i> class.
110      */

111     public Resource NOTHING();
112     
113     
114     /**
115      * <p>
116      * Answer the resource that represents the general class of properties. This will
117      * typically be <code>rdf:Property</code>.
118      * </p>
119      *
120      * @return The resource that represents the concept of a property.
121      */

122     public Resource PROPERTY();
123     
124     
125     /**
126      * <p>
127      * Answer the resource that represents the class of properties whose range
128      * elements are individuals (not literals)
129      * </p>
130      *
131      * @return The resource that represents the concept of an object (individual) property.
132      */

133     public Resource OBJECT_PROPERTY();
134     
135     
136     /**
137      * <p>
138      * Answer the resource that represents the class of properties whose range
139      * elements are literals (not individuals)
140      * </p>
141      *
142      * @return The resource that represents the concept of an object (individual) property.
143      */

144     public Resource DATATYPE_PROPERTY();
145     
146     
147     /**
148      * <p>
149      * Answer the resource that represents the class of properties that apply <i>transitively</i>.
150      * </p>
151      *
152      * @return The resource that represents the concept of a transitive property.
153      */

154     public Resource TRANSITIVE_PROPERTY();
155     
156     
157     /**
158      * <p>
159      * Answer the resource that represents the class of properties that are <i>symmetric</i>.
160      * </p>
161      *
162      * @return The resource that represents the concept of a symmetric property.
163      */

164     public Resource SYMMETRIC_PROPERTY();
165     
166     
167     /**
168      * <p>
169      * Answer the resource that represents the class of properties that are <i>functional</i>,
170      * i&#046;e&#046; whose range is unique for a given domain element.
171      * </p>
172      *
173      * @return The resource that represents the concept of a functional property.
174      */

175     public Resource FUNCTIONAL_PROPERTY();
176     
177     
178     /**
179      * <p>
180      * Answer the resource that represents the class of properties that are
181      * <i>inverse functional</i>,
182      * i&#046;e&#046; whose domain is unique for a given range element.
183      * </p>
184      *
185      * @return The resource that represents the concept of an inverse functional property.
186      */

187     public Resource INVERSE_FUNCTIONAL_PROPERTY();
188     
189     
190     /**
191      * <p>
192      * Answer the resource that represents the class of axioms denoting that a set of
193      * individuals are pairwise distinct.
194      * </p>
195      *
196      * @return The resource that represents the concept of an all-different axiom.
197      */

198     public Resource ALL_DIFFERENT();
199     
200     
201     /**
202      * <p>
203      * Answer the resource that represents the class of ontology header elements. Individuals
204      * of this class typically associate meta-data about an ontology document with the
205      * classes and properties in the document.
206      * </p>
207      *
208      * @return The resource that represents the concept of an ontology header element.
209      */

210     public Resource ONTOLOGY();
211     
212     
213     /**
214      * <p>
215      * Answer the resource that represents the documentation class of deprecated
216      * classes. Belonging to this class is a hint to developers that a given class
217      * has been superceded in a later revision of the ontology.
218      * </p>
219      *
220      * @return The resource that represents the concept of a deprecated class.
221      */

222     public Resource DEPRECATED_CLASS();
223     
224     
225     /**
226      * <p>
227      * Answer the resource that represents the documentation class of deprecated
228      * properties. Belonging to this class is a hint to developers that a given property
229      * has been superceded in a later revision of the ontology.
230      * </p>
231      *
232      * @return The resource that represents the concept of a deprecated property.
233      */

234     public Resource DEPRECATED_PROPERTY();
235     
236     
237     /**
238      * <p>
239      * Answer the class that denotes an annotation property
240      * </p>
241      *
242      * @return The AnnotationProperty class
243      */

244     public Resource ANNOTATION_PROPERTY();
245     
246     /**
247      * <p>
248      * Answer the class that denotes an ontology property
249      * </p>
250      *
251      * @return The OntologyProperty class
252      */

253     public Resource ONTOLOGY_PROPERTY();
254     
255     /**
256      * <p>
257      * Answer the class that defines a closed range of concrete data values.
258      * </p>
259      * @return The DataRange class
260      */

261     public Resource DATARANGE();
262     
263     /**
264      * <p>
265      * Answer the predicate that denotes that one property has the same property
266      * extension as another.
267      * </p>
268      *
269      * @return The property that denotes equivalence between two property resources.
270      */

271     public Property EQUIVALENT_PROPERTY();
272     
273     
274     /**
275      * <p>
276      * Answer the predicate that denotes that one class has the same extension as another.
277      * </p>
278      *
279      * @return The property that denotes equivalence between two class expressions.
280      */

281     public Property EQUIVALENT_CLASS();
282     
283     
284     /**
285      * <p>
286      * Answer the predicate that denotes that one class has no individuals in its
287      * extension in common with another class.
288      * </p>
289      *
290      * @return The property that denotes disjointness between two class expressions.
291      */

292     public Property DISJOINT_WITH();
293     
294     
295     /**
296      * <p>
297      * Answer the predicate that denotes that one resource represents the same
298      * individual as another.
299      * </p>
300      *
301      * @return The property that denotes equivalence between two resources denoting
302      * individuals.
303      */

304     public Property SAME_INDIVIDUAL_AS();
305     
306     
307     /**
308      * <p>
309      * Answer the predicate that denotes that one resource represents the same
310      * ontology object as another.
311      * </p>
312      *
313      * @return The property that denotes equivalence between two resources.
314      */

315     public Property SAME_AS();
316     
317     
318     /**
319      * <p>
320      * Answer the predicate that denotes that one resource represents a different
321      * individual than another resource.
322      * </p>
323      *
324      * @return The property that denotes distinctness between two individuals.
325      */

326     public Property DIFFERENT_FROM();
327     
328     
329     /**
330      * <p>
331      * Answer the predicate that maps from an {@link #ALL_DIFFERENT}
332      * axiom to the set of individuals that are pair-wise different from
333      * each other.
334      * </p>
335      *
336      * @return The property that introduces a list of individuals that are distinct.
337      */

338     public Property DISTINCT_MEMBERS();
339     
340     
341     /**
342      * <p>
343      * Answer the predicate that denotes that one class is formed from the union
344      * (disjunction) of a set of others.
345      * </p>
346      *
347      * @return The property that denotes a class defined by a union of class expressions.
348      */

349     public Property UNION_OF();
350     
351     
352     /**
353      * <p>
354      * Answer the predicate that denotes that one class is formed from the intersection
355      * (conjunction) of a set of others.
356      * </p>
357      *
358      * @return The property that denotes a class defined by an intersection of class expressions.
359      */

360     public Property INTERSECTION_OF();
361     
362     
363     /**
364      * <p>
365      * Answer the predicate that denotes that one class comprises the individuals that are
366      * not in a second class.
367      * </p>
368      *
369      * @return The property that denotes a class defined by the complement of a class expression.
370      */

371     public Property COMPLEMENT_OF();
372     
373     
374     /**
375      * <p>
376      * Answer the predicate that denotes that a class comprises exactly one of a given
377      * closed set individuals.
378      * </p>
379      *
380      * @return The property that denotes a class defined its members being one of a give set.
381      */

382     public Property ONE_OF();
383     
384     
385     /**
386      * <p>
387      * Answer the predicate that maps from a {@link #RESTRICTION} to a property that it is
388      * a restriction on.
389      * </p>
390      *
391      * @return The property that denotes a property that a restriction applies to.
392      */

393     public Property ON_PROPERTY();
394     
395     
396     /**
397      * <p>
398      * Answer the predicate that denotes a restriction on a given property to
399      * have only values from the given class expression.
400      * </p>
401      *
402      * @return The property that denotes a local property range restriction.
403      */

404     public Property ALL_VALUES_FROM();
405     
406     
407     /**
408      * <p>
409      * Answer the predicate that denotes a restriction on a given property to
410      * have a given value.
411      * </p>
412      *
413      * @return The property that denotes a local property value restriction.
414      */

415     public Property HAS_VALUE();
416     
417     
418     /**
419      * <p>
420      * Answer the predicate that denotes a restriction on a given property to
421      * have at least one value from the given class expression.
422      * </p>
423      *
424      * @return The property that denotes a local property range restriction.
425      */

426     public Property SOME_VALUES_FROM();
427     
428     
429     /**
430      * <p>
431      * Answer the predicate that denotes a restriction on a given property to
432      * have at least a certain number of values
433      * </p>
434      *
435      * @return The property that denotes a local property cardinality lower bound.
436      */

437     public Property MIN_CARDINALITY();
438     
439     
440     /**
441      * <p>
442      * Answer the predicate that denotes a restriction on a given property to
443      * have at most a certain number of values
444      * </p>
445      *
446      * @return The property that denotes a local property cardinality upper bound.
447      */

448     public Property MAX_CARDINALITY();
449     
450     
451     /**
452      * <p>
453      * Answer the predicate that denotes a restriction on a given property to
454      * have exactly a certain number of values
455      * </p>
456      *
457      * @return The property that denotes a local property cardinality.
458      */

459     public Property CARDINALITY();
460     
461     
462     /**
463      * <p>
464      * Answer the predicate that denotes a qualified restriction on a given property to
465      * have at least a certain number of values
466      * </p>
467      *
468      * @return The property that denotes a local property cardinality lower bound.
469      */

470     public Property MIN_CARDINALITY_Q();
471     
472     
473     /**
474      * <p>
475      * Answer the predicate that denotes a qualified restriction on a given property to
476      * have at most a certain number of values
477      * </p>
478      *
479      * @return The property that denotes a local property cardinality upper bound.
480      */

481     public Property MAX_CARDINALITY_Q();
482     
483     
484     /**
485      * <p>
486      * Answer the predicate that denotes a qualified restriction on a given property to
487      * have exactly a certain number of values
488      * </p>
489      *
490      * @return The property that denotes a local property cardinality.
491      */

492     public Property CARDINALITY_Q();
493     
494     
495     /**
496      * <p>
497      * Answer the predicate that denotes a the class in a qualified restriction.
498      * </p>
499      *
500      * @return The property that denotes the class of all values in a qualified restriction.
501      */

502     public Property HAS_CLASS_Q();
503     
504     
505     /**
506      * <p>
507      * Answer the predicate that denotes that one property is the inverse of another
508      * </p>
509      *
510      * @return The property that denotes the inverse relationship between properties
511      */

512     public Property INVERSE_OF();
513     
514     
515     /**
516      * <p>
517      * Answer the predicate that denotes that one ontology document imports another.
518      * </p>
519      *
520      * @return The property that denotes ontology importing.
521      */

522     public Property IMPORTS();
523     
524     
525     /**
526      * <p>
527      * Answer the predicate that denotes version-info metadata on an ontology header
528      * </p>
529      *
530      * @return The property that denotes ontology version information.
531      */

532     public Property VERSION_INFO();
533     
534     
535     /**
536      * <p>
537      * Answer the predicate that documents that one ontology is a prior version
538      * of another.
539      * </p>
540      *
541      * @return The property that denotes ontology versioning
542      */

543     public Property PRIOR_VERSION();
544     
545     
546     /**
547      * <p>
548      * Answer the predicate that documents that one ontology resource is backwards
549      * compatible with another.
550      * </p>
551      *
552      * @return The property that denotes ontology element backwards compatability.
553      */

554     public Property BACKWARD_COMPATIBLE_WITH();
555     
556     
557     /**
558      * <p>
559      * Answer the predicate that documents that one ontology resource is not backwards
560      * compatible with another.
561      * </p>
562      *
563      * @return The property that denotes ontology element backwards incompatability.
564      */

565     public Property INCOMPATIBLE_WITH();
566     
567     
568     /**
569      * <p>
570      * Answer the predicate that denotes that one class is a sub-class of another.
571      * </p>
572      *
573      * @return The property that the sub-class relationship.
574      */

575     public Property SUB_CLASS_OF();
576     
577     
578     /**
579      * <p>
580      * Answer the predicate that denotes that one property is a sub-property of another.
581      * </p>
582      *
583      * @return The property that denotes the sub-property relationship.
584      */

585     public Property SUB_PROPERTY_OF();
586     
587     
588     /**
589      * <p>
590      * Answer the predicate that denotes the domain of a property.
591      * </p>
592      *
593      * @return The property that denotes a property domain
594      */

595     public Property DOMAIN();
596     
597     
598     /**
599      * <p>
600      * Answer the predicate that denotes the range of a property
601      * </p>
602      *
603      * @return The property that denotes the property range
604      */

605     public Property RANGE();
606     
607     
608     /**
609      * <p>
610      * Answer the predicate that denotes <code>label</code> annotation on an ontology element
611      * </p>
612      *
613      * @return The property that denotes the label annotation
614      */

615     public Property LABEL();
616     
617     
618     /**
619      * <p>
620      * Answer the predicate that denotes <code>comment</code> annotation on an ontology element
621      * </p>
622      *
623      * @return The property that denotes the comment annotation
624      */

625     public Property COMMENT();
626     
627     
628     /**
629      * <p>
630      * Answer the predicate that denotes <code>seeAlso</code> annotation on an ontology element
631      * </p>
632      *
633      * @return The property that denotes the seeAlso annotation
634      */

635     public Property SEE_ALSO();
636     
637     
638     /**
639      * <p>
640      * Answer the predicate that denotes <code>isDefinedBy</code> annotation on an ontology element
641      * </p>
642      *
643      * @return The property that denotes the isDefiendBy annotation
644      */

645     public Property IS_DEFINED_BY();
646    
647     // List vocabulary
648

649     /**
650      * <p>The property that denotes the head of a list</p>
651      * @return The property that maps from a cell in a list to its value
652      */

653     public Property FIRST();
654     
655     /**
656      * <p>The property that denotes the tail of a list</p>
657      * @return The property that maps from a cell in a list to the remainder of the list
658      */

659     public Property REST();
660     
661     /**
662      * <p>The <code>rdf:type</code> for cells in this list</p>
663      * @return The list rdf:type resource
664      */

665     public Resource LIST();
666     
667     /**
668      * <p>The resource that denotes the end of the list</p>
669      */

670     public Resource NIL();
671
672     
673     // Particular language syntax categories
674

675     /**
676      * <p>
677      * Answer an iterator over the rdf:types in this language that denote stand-alone
678      * axioms.
679      * </p>
680      *
681      * @return An iterator over axiom types.
682      */

683     public Iterator JavaDoc getAxiomTypes();
684     
685     
686     /**
687      * <p>
688      * Answer an iterator over the properties in this language that are denoted
689      * annotation properties. Not all languages have distinguished annotation
690      * properties.
691      * </p>
692      *
693      * @return An iterator over annotation properties.
694      */

695     public Iterator JavaDoc getAnnotationProperties();
696     
697     
698     /**
699      * <p>
700      * Answer an iterator over the various types of class description defined
701      * in the language.
702      * </p>
703      *
704      * @return An iterator over the various rdf:types of class descriptions.
705      */

706     public Iterator JavaDoc getClassDescriptionTypes();
707     
708     
709     // Alias management
710

711     /**
712      * <p>
713      * Answer true if the given resource has an alias in this profile.
714      * </p>
715      *
716      * @param res A resource (including properties) to test for an alias
717      * @return True if there is an alias for <code>res</code>
718      */

719     public boolean hasAliasFor( Resource res );
720     
721     /**
722      * <p>
723      * Answer an alias for the given resource. If there is more than
724      * one such alias, a choice is made non-deterministically between the
725      * alternatives.
726      * </p>
727      *
728      * @param res A resource (including properties) to test for an alias
729      * @return The alias for <code>res</code>, or one of the aliases for <code>res</code> if more
730      * than one is defined, or null if no alias is defined for <code>res</code>.
731      *
732      */

733     public Resource getAliasFor( Resource res );
734     
735     /**
736      * <p>
737      * Answer an iterator over the defined aliases for a resource.
738      * </p>
739      *
740      * @param res A resource (including properties)
741      * @return An iterator over the aliases for <code>res</code>. If there are
742      * no aliases, the empty iterator is returned.
743      */

744     public Iterator JavaDoc listAliasesFor( Resource res );
745     
746     
747     /**
748      * <p>
749      * Answer true if the given graph supports a view of this node as the given
750      * language element, according to the semantic constraints of the profile.
751      * If strict checking on the ontology model is turned off, this check is
752      * skipped.
753      * </p>
754      *
755      * @param n A node to test
756      * @param g The enhanced graph containing <code>n</code>, which is assumed to
757      * be an {@link OntModel}.
758      * @param type A class indicating the facet that we are testing against.
759      * @return True if strict checking is off, or if <code>n</code> can be
760      * viewed according to the facet resource <code>res</code>
761      */

762     public boolean isSupported( Node n, EnhGraph g, Class JavaDoc type );
763     
764     // Other stuff
765

766     /**
767      * <p>
768      * Answer a descriptive string for this profile, for use in debugging and other output.
769      * </p>
770      */

771     public String JavaDoc getLabel();
772 }
773
774
775 /*
776     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
777     All rights reserved.
778
779     Redistribution and use in source and binary forms, with or without
780     modification, are permitted provided that the following conditions
781     are met:
782
783     1. Redistributions of source code must retain the above copyright
784        notice, this list of conditions and the following disclaimer.
785
786     2. Redistributions in binary form must reproduce the above copyright
787        notice, this list of conditions and the following disclaimer in the
788        documentation and/or other materials provided with the distribution.
789
790     3. The name of the author may not be used to endorse or promote products
791        derived from this software without specific prior written permission.
792
793     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
794     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
795     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
796     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
797     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
798     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
799     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
800     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
801     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
802     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
803 */

804
805
Popular Tags