001: /*****************************************************************************
002: * Source code information
003: * -----------------------
004: * Original author Ian Dickinson, HP Labs Bristol
005: * Author email Ian.Dickinson@hp.com
006: * Package Jena 2
007: * Web http://sourceforge.net/projects/jena/
008: * Created 10 Feb 2003
009: * Filename $RCSfile: Profile.java,v $
010: * Revision $Revision: 1.19 $
011: * Release status $State: Exp $
012: *
013: * Last modified on $Date: 2008/01/02 12:06:42 $
014: * by $Author: andy_seaborne $
015: *
016: * (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
017: * (see footer for full conditions)
018: * ****************************************************************************/package com.hp.hpl.jena.ontology;
019:
020: // Imports
021: ///////////////
022: import com.hp.hpl.jena.enhanced.*;
023: import com.hp.hpl.jena.graph.*;
024: import com.hp.hpl.jena.rdf.model.*;
025:
026: import java.util.Iterator;
027:
028: /**
029: * <p>
030: * Interface that encapsulates the elements of a general vocabulary
031: * corresponding to a particular ontology language. The intent is that, using
032: * a given vocabulary, a given RDF model can be processed as an ontology
033: * description, without binding knowledge of the vocabulary into this Java
034: * package. For tractability, this limits the vocabularies that can easily be
035: * represented to those that are similar to OWL and DAML+OIL.
036: * </p>
037: *
038: * @author Ian Dickinson, HP Labs
039: * (<a href="mailto:Ian.Dickinson@hp.com" >email</a>)
040: * @version CVS $Id: Profile.java,v 1.19 2008/01/02 12:06:42 andy_seaborne Exp $
041: */
042: public interface Profile {
043: // Constants
044: //////////////////////////////////
045:
046: // External signature methods
047: //////////////////////////////////
048:
049: /**
050: * <p>
051: * Answer the string that is the namespace prefix for this vocabulary
052: * </p>
053: *
054: * @return The namespace prefix, for example <code>http://www.w3c.org/2002/07/owl#</code>
055: */
056: public String NAMESPACE();
057:
058: // Language classes
059: ////////////////////////////////
060:
061: /**
062: * <p>
063: * Answer the resource that represents the class 'class' in this vocabulary.
064: * </p>
065: *
066: * @return The resource that represents the concept of a class
067: */
068: public Resource CLASS();
069:
070: /**
071: * <p>
072: * Answer the resource that represents the a class formed by placing
073: * constraints (restrictions) on the values of a property.
074: * </p>
075: *
076: * @return The resource that represents the concept of a restriction
077: */
078: public Resource RESTRICTION();
079:
080: /**
081: * <p>
082: * Answer the resource that represents the class all individuals.
083: * </p>
084: *
085: * @return The resource that represents the concept of the <i>top</i> class
086: */
087: public Resource THING();
088:
089: /**
090: * <p>
091: * Answer the resource that represents the necessarily empty class.
092: * </p>
093: *
094: * @return The resource that represents the concept the <i>bottom</i> class.
095: */
096: public Resource NOTHING();
097:
098: /**
099: * <p>
100: * Answer the resource that represents the general class of properties. This will
101: * typically be <code>rdf:Property</code>.
102: * </p>
103: *
104: * @return The resource that represents the concept of a property.
105: */
106: public Resource PROPERTY();
107:
108: /**
109: * <p>
110: * Answer the resource that represents the class of properties whose range
111: * elements are individuals (not literals)
112: * </p>
113: *
114: * @return The resource that represents the concept of an object (individual) property.
115: */
116: public Resource OBJECT_PROPERTY();
117:
118: /**
119: * <p>
120: * Answer the resource that represents the class of properties whose range
121: * elements are literals (not individuals)
122: * </p>
123: *
124: * @return The resource that represents the concept of an object (individual) property.
125: */
126: public Resource DATATYPE_PROPERTY();
127:
128: /**
129: * <p>
130: * Answer the resource that represents the class of properties that apply <i>transitively</i>.
131: * </p>
132: *
133: * @return The resource that represents the concept of a transitive property.
134: */
135: public Resource TRANSITIVE_PROPERTY();
136:
137: /**
138: * <p>
139: * Answer the resource that represents the class of properties that are <i>symmetric</i>.
140: * </p>
141: *
142: * @return The resource that represents the concept of a symmetric property.
143: */
144: public Resource SYMMETRIC_PROPERTY();
145:
146: /**
147: * <p>
148: * Answer the resource that represents the class of properties that are <i>functional</i>,
149: * i.e. whose range is unique for a given domain element.
150: * </p>
151: *
152: * @return The resource that represents the concept of a functional property.
153: */
154: public Resource FUNCTIONAL_PROPERTY();
155:
156: /**
157: * <p>
158: * Answer the resource that represents the class of properties that are
159: * <i>inverse functional</i>,
160: * i.e. whose domain is unique for a given range element.
161: * </p>
162: *
163: * @return The resource that represents the concept of an inverse functional property.
164: */
165: public Resource INVERSE_FUNCTIONAL_PROPERTY();
166:
167: /**
168: * <p>
169: * Answer the resource that represents the class of axioms denoting that a set of
170: * individuals are pairwise distinct.
171: * </p>
172: *
173: * @return The resource that represents the concept of an all-different axiom.
174: */
175: public Resource ALL_DIFFERENT();
176:
177: /**
178: * <p>
179: * Answer the resource that represents the class of ontology header elements. Individuals
180: * of this class typically associate meta-data about an ontology document with the
181: * classes and properties in the document.
182: * </p>
183: *
184: * @return The resource that represents the concept of an ontology header element.
185: */
186: public Resource ONTOLOGY();
187:
188: /**
189: * <p>
190: * Answer the resource that represents the documentation class of deprecated
191: * classes. Belonging to this class is a hint to developers that a given class
192: * has been superceded in a later revision of the ontology.
193: * </p>
194: *
195: * @return The resource that represents the concept of a deprecated class.
196: */
197: public Resource DEPRECATED_CLASS();
198:
199: /**
200: * <p>
201: * Answer the resource that represents the documentation class of deprecated
202: * properties. Belonging to this class is a hint to developers that a given property
203: * has been superceded in a later revision of the ontology.
204: * </p>
205: *
206: * @return The resource that represents the concept of a deprecated property.
207: */
208: public Resource DEPRECATED_PROPERTY();
209:
210: /**
211: * <p>
212: * Answer the class that denotes an annotation property
213: * </p>
214: *
215: * @return The AnnotationProperty class
216: */
217: public Resource ANNOTATION_PROPERTY();
218:
219: /**
220: * <p>
221: * Answer the class that denotes an ontology property
222: * </p>
223: *
224: * @return The OntologyProperty class
225: */
226: public Resource ONTOLOGY_PROPERTY();
227:
228: /**
229: * <p>
230: * Answer the class that defines a closed range of concrete data values.
231: * </p>
232: * @return The DataRange class
233: */
234: public Resource DATARANGE();
235:
236: /**
237: * <p>
238: * Answer the predicate that denotes that one property has the same property
239: * extension as another.
240: * </p>
241: *
242: * @return The property that denotes equivalence between two property resources.
243: */
244: public Property EQUIVALENT_PROPERTY();
245:
246: /**
247: * <p>
248: * Answer the predicate that denotes that one class has the same extension as another.
249: * </p>
250: *
251: * @return The property that denotes equivalence between two class expressions.
252: */
253: public Property EQUIVALENT_CLASS();
254:
255: /**
256: * <p>
257: * Answer the predicate that denotes that one class has no individuals in its
258: * extension in common with another class.
259: * </p>
260: *
261: * @return The property that denotes disjointness between two class expressions.
262: */
263: public Property DISJOINT_WITH();
264:
265: /**
266: * <p>
267: * Answer the predicate that denotes that one resource represents the same
268: * individual as another.
269: * </p>
270: *
271: * @return The property that denotes equivalence between two resources denoting
272: * individuals.
273: */
274: public Property SAME_INDIVIDUAL_AS();
275:
276: /**
277: * <p>
278: * Answer the predicate that denotes that one resource represents the same
279: * ontology object as another.
280: * </p>
281: *
282: * @return The property that denotes equivalence between two resources.
283: */
284: public Property SAME_AS();
285:
286: /**
287: * <p>
288: * Answer the predicate that denotes that one resource represents a different
289: * individual than another resource.
290: * </p>
291: *
292: * @return The property that denotes distinctness between two individuals.
293: */
294: public Property DIFFERENT_FROM();
295:
296: /**
297: * <p>
298: * Answer the predicate that maps from an {@link #ALL_DIFFERENT}
299: * axiom to the set of individuals that are pair-wise different from
300: * each other.
301: * </p>
302: *
303: * @return The property that introduces a list of individuals that are distinct.
304: */
305: public Property DISTINCT_MEMBERS();
306:
307: /**
308: * <p>
309: * Answer the predicate that denotes that one class is formed from the union
310: * (disjunction) of a set of others.
311: * </p>
312: *
313: * @return The property that denotes a class defined by a union of class expressions.
314: */
315: public Property UNION_OF();
316:
317: /**
318: * <p>
319: * Answer the predicate that denotes that one class is formed from the intersection
320: * (conjunction) of a set of others.
321: * </p>
322: *
323: * @return The property that denotes a class defined by an intersection of class expressions.
324: */
325: public Property INTERSECTION_OF();
326:
327: /**
328: * <p>
329: * Answer the predicate that denotes that one class comprises the individuals that are
330: * not in a second class.
331: * </p>
332: *
333: * @return The property that denotes a class defined by the complement of a class expression.
334: */
335: public Property COMPLEMENT_OF();
336:
337: /**
338: * <p>
339: * Answer the predicate that denotes that a class comprises exactly one of a given
340: * closed set individuals.
341: * </p>
342: *
343: * @return The property that denotes a class defined its members being one of a give set.
344: */
345: public Property ONE_OF();
346:
347: /**
348: * <p>
349: * Answer the predicate that maps from a {@link #RESTRICTION} to a property that it is
350: * a restriction on.
351: * </p>
352: *
353: * @return The property that denotes a property that a restriction applies to.
354: */
355: public Property ON_PROPERTY();
356:
357: /**
358: * <p>
359: * Answer the predicate that denotes a restriction on a given property to
360: * have only values from the given class expression.
361: * </p>
362: *
363: * @return The property that denotes a local property range restriction.
364: */
365: public Property ALL_VALUES_FROM();
366:
367: /**
368: * <p>
369: * Answer the predicate that denotes a restriction on a given property to
370: * have a given value.
371: * </p>
372: *
373: * @return The property that denotes a local property value restriction.
374: */
375: public Property HAS_VALUE();
376:
377: /**
378: * <p>
379: * Answer the predicate that denotes a restriction on a given property to
380: * have at least one value from the given class expression.
381: * </p>
382: *
383: * @return The property that denotes a local property range restriction.
384: */
385: public Property SOME_VALUES_FROM();
386:
387: /**
388: * <p>
389: * Answer the predicate that denotes a restriction on a given property to
390: * have at least a certain number of values
391: * </p>
392: *
393: * @return The property that denotes a local property cardinality lower bound.
394: */
395: public Property MIN_CARDINALITY();
396:
397: /**
398: * <p>
399: * Answer the predicate that denotes a restriction on a given property to
400: * have at most a certain number of values
401: * </p>
402: *
403: * @return The property that denotes a local property cardinality upper bound.
404: */
405: public Property MAX_CARDINALITY();
406:
407: /**
408: * <p>
409: * Answer the predicate that denotes a restriction on a given property to
410: * have exactly a certain number of values
411: * </p>
412: *
413: * @return The property that denotes a local property cardinality.
414: */
415: public Property CARDINALITY();
416:
417: /**
418: * <p>
419: * Answer the predicate that denotes a qualified restriction on a given property to
420: * have at least a certain number of values
421: * </p>
422: *
423: * @return The property that denotes a local property cardinality lower bound.
424: */
425: public Property MIN_CARDINALITY_Q();
426:
427: /**
428: * <p>
429: * Answer the predicate that denotes a qualified restriction on a given property to
430: * have at most a certain number of values
431: * </p>
432: *
433: * @return The property that denotes a local property cardinality upper bound.
434: */
435: public Property MAX_CARDINALITY_Q();
436:
437: /**
438: * <p>
439: * Answer the predicate that denotes a qualified restriction on a given property to
440: * have exactly a certain number of values
441: * </p>
442: *
443: * @return The property that denotes a local property cardinality.
444: */
445: public Property CARDINALITY_Q();
446:
447: /**
448: * <p>
449: * Answer the predicate that denotes a the class in a qualified restriction.
450: * </p>
451: *
452: * @return The property that denotes the class of all values in a qualified restriction.
453: */
454: public Property HAS_CLASS_Q();
455:
456: /**
457: * <p>
458: * Answer the predicate that denotes that one property is the inverse of another
459: * </p>
460: *
461: * @return The property that denotes the inverse relationship between properties
462: */
463: public Property INVERSE_OF();
464:
465: /**
466: * <p>
467: * Answer the predicate that denotes that one ontology document imports another.
468: * </p>
469: *
470: * @return The property that denotes ontology importing.
471: */
472: public Property IMPORTS();
473:
474: /**
475: * <p>
476: * Answer the predicate that denotes version-info metadata on an ontology header
477: * </p>
478: *
479: * @return The property that denotes ontology version information.
480: */
481: public Property VERSION_INFO();
482:
483: /**
484: * <p>
485: * Answer the predicate that documents that one ontology is a prior version
486: * of another.
487: * </p>
488: *
489: * @return The property that denotes ontology versioning
490: */
491: public Property PRIOR_VERSION();
492:
493: /**
494: * <p>
495: * Answer the predicate that documents that one ontology resource is backwards
496: * compatible with another.
497: * </p>
498: *
499: * @return The property that denotes ontology element backwards compatability.
500: */
501: public Property BACKWARD_COMPATIBLE_WITH();
502:
503: /**
504: * <p>
505: * Answer the predicate that documents that one ontology resource is not backwards
506: * compatible with another.
507: * </p>
508: *
509: * @return The property that denotes ontology element backwards incompatability.
510: */
511: public Property INCOMPATIBLE_WITH();
512:
513: /**
514: * <p>
515: * Answer the predicate that denotes that one class is a sub-class of another.
516: * </p>
517: *
518: * @return The property that the sub-class relationship.
519: */
520: public Property SUB_CLASS_OF();
521:
522: /**
523: * <p>
524: * Answer the predicate that denotes that one property is a sub-property of another.
525: * </p>
526: *
527: * @return The property that denotes the sub-property relationship.
528: */
529: public Property SUB_PROPERTY_OF();
530:
531: /**
532: * <p>
533: * Answer the predicate that denotes the domain of a property.
534: * </p>
535: *
536: * @return The property that denotes a property domain
537: */
538: public Property DOMAIN();
539:
540: /**
541: * <p>
542: * Answer the predicate that denotes the range of a property
543: * </p>
544: *
545: * @return The property that denotes the property range
546: */
547: public Property RANGE();
548:
549: /**
550: * <p>
551: * Answer the predicate that denotes <code>label</code> annotation on an ontology element
552: * </p>
553: *
554: * @return The property that denotes the label annotation
555: */
556: public Property LABEL();
557:
558: /**
559: * <p>
560: * Answer the predicate that denotes <code>comment</code> annotation on an ontology element
561: * </p>
562: *
563: * @return The property that denotes the comment annotation
564: */
565: public Property COMMENT();
566:
567: /**
568: * <p>
569: * Answer the predicate that denotes <code>seeAlso</code> annotation on an ontology element
570: * </p>
571: *
572: * @return The property that denotes the seeAlso annotation
573: */
574: public Property SEE_ALSO();
575:
576: /**
577: * <p>
578: * Answer the predicate that denotes <code>isDefinedBy</code> annotation on an ontology element
579: * </p>
580: *
581: * @return The property that denotes the isDefiendBy annotation
582: */
583: public Property IS_DEFINED_BY();
584:
585: // List vocabulary
586:
587: /**
588: * <p>The property that denotes the head of a list</p>
589: * @return The property that maps from a cell in a list to its value
590: */
591: public Property FIRST();
592:
593: /**
594: * <p>The property that denotes the tail of a list</p>
595: * @return The property that maps from a cell in a list to the remainder of the list
596: */
597: public Property REST();
598:
599: /**
600: * <p>The <code>rdf:type</code> for cells in this list</p>
601: * @return The list rdf:type resource
602: */
603: public Resource LIST();
604:
605: /**
606: * <p>The resource that denotes the end of the list</p>
607: */
608: public Resource NIL();
609:
610: // Particular language syntax categories
611:
612: /**
613: * <p>
614: * Answer an iterator over the rdf:types in this language that denote stand-alone
615: * axioms.
616: * </p>
617: *
618: * @return An iterator over axiom types.
619: */
620: public Iterator getAxiomTypes();
621:
622: /**
623: * <p>
624: * Answer an iterator over the properties in this language that are denoted
625: * annotation properties. Not all languages have distinguished annotation
626: * properties.
627: * </p>
628: *
629: * @return An iterator over annotation properties.
630: */
631: public Iterator getAnnotationProperties();
632:
633: /**
634: * <p>
635: * Answer an iterator over the various types of class description defined
636: * in the language.
637: * </p>
638: *
639: * @return An iterator over the various rdf:types of class descriptions.
640: */
641: public Iterator getClassDescriptionTypes();
642:
643: // Alias management
644:
645: /**
646: * <p>
647: * Answer true if the given resource has an alias in this profile.
648: * </p>
649: *
650: * @param res A resource (including properties) to test for an alias
651: * @return True if there is an alias for <code>res</code>
652: */
653: public boolean hasAliasFor(Resource res);
654:
655: /**
656: * <p>
657: * Answer an alias for the given resource. If there is more than
658: * one such alias, a choice is made non-deterministically between the
659: * alternatives.
660: * </p>
661: *
662: * @param res A resource (including properties) to test for an alias
663: * @return The alias for <code>res</code>, or one of the aliases for <code>res</code> if more
664: * than one is defined, or null if no alias is defined for <code>res</code>.
665: *
666: */
667: public Resource getAliasFor(Resource res);
668:
669: /**
670: * <p>
671: * Answer an iterator over the defined aliases for a resource.
672: * </p>
673: *
674: * @param res A resource (including properties)
675: * @return An iterator over the aliases for <code>res</code>. If there are
676: * no aliases, the empty iterator is returned.
677: */
678: public Iterator listAliasesFor(Resource res);
679:
680: /**
681: * <p>
682: * Answer true if the given graph supports a view of this node as the given
683: * language element, according to the semantic constraints of the profile.
684: * If strict checking on the ontology model is turned off, this check is
685: * skipped.
686: * </p>
687: *
688: * @param n A node to test
689: * @param g The enhanced graph containing <code>n</code>, which is assumed to
690: * be an {@link OntModel}.
691: * @param type A class indicating the facet that we are testing against.
692: * @return True if strict checking is off, or if <code>n</code> can be
693: * viewed according to the facet resource <code>res</code>
694: */
695: public boolean isSupported(Node n, EnhGraph g, Class type);
696:
697: // Other stuff
698:
699: /**
700: * <p>
701: * Answer a descriptive string for this profile, for use in debugging and other output.
702: * </p>
703: */
704: public String getLabel();
705: }
706:
707: /*
708: (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
709: All rights reserved.
710:
711: Redistribution and use in source and binary forms, with or without
712: modification, are permitted provided that the following conditions
713: are met:
714:
715: 1. Redistributions of source code must retain the above copyright
716: notice, this list of conditions and the following disclaimer.
717:
718: 2. Redistributions in binary form must reproduce the above copyright
719: notice, this list of conditions and the following disclaimer in the
720: documentation and/or other materials provided with the distribution.
721:
722: 3. The name of the author may not be used to endorse or promote products
723: derived from this software without specific prior written permission.
724:
725: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
726: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
727: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
728: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
729: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
730: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
731: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
732: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
733: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
734: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
735: */
|