KickJava   Java API By Example, From Geeks To Geeks.

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


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: AllDifferent.java,v $
10  * Revision $Revision: 1.14 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:04:12 $
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 java.util.Iterator JavaDoc;
29
30 import com.hp.hpl.jena.rdf.model.*;
31 import com.hp.hpl.jena.rdf.model.Resource;
32 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
33
34
35 /**
36  * <p>
37  * Interface defining an individual in which all members of a collection are
38  * declared pair-wise disjoint. This allows ontologies that wish to support the
39  * unique names assumption to add this condition in languages (like OWL) that
40  * do not make the same assumption, with a minimum number of statements.
41  * Instances of the all different axiom are expected to have a property
42  * (e.g. <code>owl:distinctMembers</code> defining the list of distinct
43  * individuals in the ontology. For a given vocabulary, this will be defined by
44  * the {@linkplain Profile#DISTINCT_MEMBERS distinctMembers} entry.
45  * </p>
46  *
47  * @author Ian Dickinson, HP Labs
48  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
49  * @version CVS $Id: AllDifferent.java,v 1.14 2005/02/21 12:04:12 andy_seaborne Exp $
50  */

51 public interface AllDifferent
52     extends OntResource
53 {
54     // Constants
55
//////////////////////////////////
56

57
58     // External signature methods
59
//////////////////////////////////
60

61     /**
62      * <p>Assert that the list of distinct individuals in this AllDifferent declaration
63      * is the given list. Any existing
64      * statements for <code>distinctMembers</code> will be removed.</p>
65      * @param members A list of the members that are declared to be distinct.
66      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
67      */

68     public void setDistinctMembers( RDFList members );
69
70     /**
71      * <p>Add the given individual to the list of distinct members of this AllDifferent declaration.</p>
72      * @param res A resource that will be added to the list of all different members.
73      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
74      */

75     public void addDistinctMember( Resource res );
76
77     /**
78      * <p>Add the given individuals to the list of distinct members of this AllDifferent declaration.</p>
79      * @param individuals An iterator over the distinct invididuals that will be added
80      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
81      */

82     public void addDistinctMembers( Iterator JavaDoc individuals );
83
84     /**
85      * <p>Answer the list of distinct members for this AllDifferent declaration.</p>
86      * @return The list of individuals declared distinct by this AllDifferent declaration.
87      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
88      */

89     public RDFList getDistinctMembers();
90
91     /**
92      * <p>Answer an iterator over all of the individuals that are declared to be distinct by
93      * this AllDifferent declaration. Each element of the iterator will be an {@link OntResource}.</p>
94      * @return An iterator over distinct individuals.
95      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
96      */

97     public ExtendedIterator listDistinctMembers();
98
99     /**
100      * <p>Answer true if this AllDifferent declaration includes <code>res</code> as one of the distinct individuals.</p>
101      * @param res A resource to test against
102      * @return True if <code>res</code> is declared to be distinct from the other individuals in this declation.
103      * @exception OntProfileException If the {@link Profile#DISTINCT_MEMBERS()} property is not supported in the current language profile.
104      */

105     public boolean hasDistinctMember( Resource res );
106     
107     /**
108      * <p>Remove the given resource from the list of distinct individuals. If this statement
109      * is not true of the current model, nothing happens.</p>
110      * @param res A resource that is no longer distinct from the other listed individuals
111      */

112     public void removeDistinctMember( Resource res );
113     
114 }
115
116
117 /*
118     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
119     All rights reserved.
120
121     Redistribution and use in source and binary forms, with or without
122     modification, are permitted provided that the following conditions
123     are met:
124
125     1. Redistributions of source code must retain the above copyright
126        notice, this list of conditions and the following disclaimer.
127
128     2. Redistributions in binary form must reproduce the above copyright
129        notice, this list of conditions and the following disclaimer in the
130        documentation and/or other materials provided with the distribution.
131
132     3. The name of the author may not be used to endorse or promote products
133        derived from this software without specific prior written permission.
134
135     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
136     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
137     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
138     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
139     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
140     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
144     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145 */

146
147
Popular Tags