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: HasValueRestriction.java,v $
010: * Revision $Revision: 1.11 $
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.*;
023:
024: /**
025: * <p>
026: * A property restriction that requires the named property to have a given individual as
027: * its value.
028: * </p>
029: *
030: * @author Ian Dickinson, HP Labs
031: * (<a href="mailto:Ian.Dickinson@hp.com" >email</a>)
032: * @version CVS $Id: HasValueRestriction.java,v 1.11 2008/01/02 12:06:41 andy_seaborne Exp $
033: */
034: public interface HasValueRestriction extends Restriction {
035: // Constants
036: //////////////////////////////////
037:
038: // External signature methods
039: //////////////////////////////////
040:
041: // hasValue
042:
043: /**
044: * <p>Assert that this restriction restricts the property to have the given
045: * value. Any existing statements for <code>hasValue</code>
046: * will be removed.</p>
047: * @param value The RDF value (an individual or a literal)
048: * that is the value that the restricted property must have to be a member of the
049: * class defined by this restriction.
050: * @exception OntProfileException If the {@link Profile#HAS_VALUE()} property is not supported in the current language profile.
051: */
052: public void setHasValue(RDFNode value);
053:
054: /**
055: * <p>Answer the RDF value that all values of the restricted property must be equal to.</p>
056: * @return An RDFNode that is the value of the restricted property
057: * @exception OntProfileException If the {@link Profile#HAS_VALUE()} property is not supported in the current language profile.
058: */
059: public RDFNode getHasValue();
060:
061: /**
062: * <p>Answer true if this property restriction has the given RDF value as the value which all
063: * values of the restricted property must equal.</p>
064: * @param value An RDF value to test
065: * @return True if the given value is the value of the restricted property in this restriction
066: * @exception OntProfileException If the {@link Profile#HAS_VALUE()} property is not supported in the current language profile.
067: */
068: public boolean hasValue(RDFNode value);
069:
070: /**
071: * <p>Remove the statement that this restriction requires the restricted property to have
072: * the given value. If this statement
073: * is not true of the current model, nothing happens.</p>
074: * @param value An RDF value that is to be removed as the required value for the restricted property
075: */
076: public void removeHasValue(RDFNode value);
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: */
|