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 07-May-2003
009: * Filename $RCSfile: AllValuesFromRestriction.java,v $
010: * Revision $Revision: 1.10 $
011: * Release status $State: Exp $
012: *
013: * Last modified on $Date: 2008/01/02 12:06:41 $
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.rdf.model.Resource;
023:
024: /**
025: * <p>
026: * A property restriction that requires the named property to have have any range
027: * instances to be members of a given class.
028: * </p>
029: *
030: * @author Ian Dickinson, HP Labs
031: * (<a href="mailto:Ian.Dickinson@hp.com" >email</a>)
032: * @version CVS $Id: AllValuesFromRestriction.java,v 1.10 2008/01/02 12:06:41 andy_seaborne Exp $
033: */
034: public interface AllValuesFromRestriction extends Restriction {
035: // Constants
036: //////////////////////////////////
037:
038: // External signature methods
039: //////////////////////////////////
040:
041: // allValuesFrom
042:
043: /**
044: * <p>Assert that this restriction restricts the property to have all values
045: * be members of the given class. Any existing statements for <code>allValuesFrom</code>
046: * will be removed.</p>
047: * @param cls The class that all values of the property must belong to
048: * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
049: */
050: public void setAllValuesFrom(Resource cls);
051:
052: /**
053: * <p>Answer the resource characterising the constraint on all values of the restricted property. This may be
054: * a class, the URI of a concrete datatype, a DataRange object or the URI rdfs:Literal.</p>
055: * @return A resource, which will have been pre-converted to the appropriate Java value type
056: * ({@link OntClass} or {@link DataRange}) if appropriate.
057: * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
058: */
059: public Resource getAllValuesFrom();
060:
061: /**
062: * <p>Answer true if this property restriction has the given class as the class to which all
063: * values of the restricted property must belong.</p>
064: * @param cls A class to test
065: * @return True if the given class is the class to which all values must belong
066: * @exception OntProfileException If the {@link Profile#ALL_VALUES_FROM()} property is not supported in the current language profile.
067: */
068: public boolean hasAllValuesFrom(Resource cls);
069:
070: /**
071: * <p>Remove the statement that this restriction has all values from the given class among
072: * the values for the restricted property. If this statement
073: * is not true of the current model, nothing happens.</p>
074: * @param cls A Resource the denotes the class to be removed from this restriction
075: */
076: public void removeAllValuesFrom(Resource cls);
077:
078: }
079:
080: /*
081: (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
082: All rights reserved.
083:
084: Redistribution and use in source and binary forms, with or without
085: modification, are permitted provided that the following conditions
086: are met:
087:
088: 1. Redistributions of source code must retain the above copyright
089: notice, this list of conditions and the following disclaimer.
090:
091: 2. Redistributions in binary form must reproduce the above copyright
092: notice, this list of conditions and the following disclaimer in the
093: documentation and/or other materials provided with the distribution.
094:
095: 3. The name of the author may not be used to endorse or promote products
096: derived from this software without specific prior written permission.
097:
098: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
099: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
100: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
101: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
102: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
103: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
104: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
105: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
106: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
107: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108: */
|