KickJava   Java API By Example, From Geeks To Geeks.

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


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 07-May-2003
9  * Filename $RCSfile: AllValuesFromRestriction.java,v $
10  * Revision $Revision: 1.7 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:04:14 $
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 // Imports
26
///////////////
27
import com.hp.hpl.jena.rdf.model.Resource;
28
29
30 /**
31  * <p>
32  * A property restriction that requires the named property to have have any range
33  * instances to be members of a given class.
34  * </p>
35  *
36  * @author Ian Dickinson, HP Labs
37  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
38  * @version CVS $Id: AllValuesFromRestriction.java,v 1.7 2005/02/21 12:04:14 andy_seaborne Exp $
39  */

40 public interface AllValuesFromRestriction
41     extends Restriction
42 {
43     // Constants
44
//////////////////////////////////
45

46
47     // External signature methods
48
//////////////////////////////////
49

50
51     // allValuesFrom
52

53     /**
54      * <p>Assert that this restriction restricts the property to have all values
55      * be members of the given class. Any existing statements for <code>allValuesFrom</code>
56      * will be removed.</p>
57      * @param cls The class that all values of the property must belong to
58      * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
59      */

60     public void setAllValuesFrom( Resource cls );
61
62     /**
63      * <p>Answer the resource characterising the constraint on all values of the restricted property. This may be
64      * a class, the URI of a concrete datatype, a DataRange object or the URI rdfs:Literal.</p>
65      * @return A resource, which will have been pre-converted to the appropriate Java value type
66      * ({@link OntClass} or {@link DataRange}) if appropriate.
67      * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
68      */

69     public Resource getAllValuesFrom();
70
71     /**
72      * <p>Answer true if this property restriction has the given class as the class to which all
73      * values of the restricted property must belong.</p>
74      * @param cls A class to test
75      * @return True if the given class is the class to which all values must belong
76      * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
77      */

78     public boolean hasAllValuesFrom( Resource cls );
79     
80     /**
81      * <p>Remove the statement that this restriction has all values from the given class among
82      * the values for the restricted property. If this statement
83      * is not true of the current model, nothing happens.</p>
84      * @param cls A Resource the denotes the class to be removed from this restriction
85      */

86     public void removeAllValuesFrom( Resource cls );
87     
88
89 }
90
91
92 /*
93     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
94     All rights reserved.
95
96     Redistribution and use in source and binary forms, with or without
97     modification, are permitted provided that the following conditions
98     are met:
99
100     1. Redistributions of source code must retain the above copyright
101        notice, this list of conditions and the following disclaimer.
102
103     2. Redistributions in binary form must reproduce the above copyright
104        notice, this list of conditions and the following disclaimer in the
105        documentation and/or other materials provided with the distribution.
106
107     3. The name of the author may not be used to endorse or promote products
108        derived from this software without specific prior written permission.
109
110     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
111     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
112     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
113     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
114     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
115     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
116     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
117     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
118     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
119     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
120 */

121
122
Popular Tags