KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > ontology > daml > PropertyAccessor


1 /*****************************************************************************
2  * Source code information
3  * -----------------------
4  * Original author Ian Dickinson, HP Labs Bristol
5  * Author email Ian.Dickinson@hp.com
6  * Package Jena
7  * Created 26 Jan 2001
8  * Filename $RCSfile: PropertyAccessor.java,v $
9  * Revision $Revision: 1.6 $
10  * Release status Preview-release $State: Exp $
11  *
12  * Last modified on $Date: 2005/02/21 12:05:04 $
13  * by $Author: andy_seaborne $
14  *
15  * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
16  * (see footer for full conditions)
17  *****************************************************************************/

18
19 // Package
20
///////////////
21
package com.hp.hpl.jena.ontology.daml;
22
23
24 // Imports
25
///////////////
26
import com.hp.hpl.jena.rdf.model.*;
27
28
29 /**
30  * <p>Encapsulates the standard methods of modifying a property on a DAML value.</p>
31  *
32  * @author Ian Dickinson, HP Labs (<a HREF="mailto:Ian.Dickinson@hp.com">email</a>)
33  * @version CVS info: $Id: PropertyAccessor.java,v 1.6 2005/02/21 12:05:04 andy_seaborne Exp $
34  */

35 public interface PropertyAccessor
36 {
37     // Constants
38
//////////////////////////////////
39

40
41     // External signature methods
42
//////////////////////////////////
43

44     /**
45      * <p>Answer the property that this accessor works on</p>
46      *
47      * @return A property
48      */

49     public Property getProperty();
50
51
52     /**
53      * <p>Answer the number of values that the encapsulated property has in the
54      * RDF model.</p>
55      *
56      * @return The number statements for this property in the model.
57      */

58     public int count();
59
60
61     /**
62      * <p>Answer an iteration over the DAML values that this property has in the
63      * RDF model.</p>
64      * <p><strong>Note:</strong> In Jena 1, this method took a paramter <code>closed</code>,
65      * to control whether the transitive closure of the class and property hierarchies was
66      * considered. Computing these entailments is now handled by the reaoner attached to the
67      * DAML or Ontology model, and is not controlled by a method parameter at the API level.
68      * Accordingly, this parameter has been removed. See the documentation for details on
69      * controlling the operation of the reasoners.</p>
70      *
71      * @return An iteration over the values of the encapsulated property.
72      */

73     public NodeIterator getAll();
74
75
76     /**
77      * <p>Answer a general value of the encapsulated property. If it has no values, answer
78      * null. If it has one value, answer that value. Otherwise, answer an undetermined
79      * member of the set of values. See also {@link #getDAMLValue}.
80      *
81      * @return A value for the encapsulated property in the RDF model, or null
82      * if the property has no value.
83      */

84     public RDFNode get();
85
86
87     /**
88      * <p>Answer the value of the encapsulated property, presented as a DAML list. If it has no values, answer
89      * null. If it has one value, answer that value (as a list). Otherwise, answer an undetermined
90      * member of the set of values. See also {@link #getDAMLValue}.
91      *
92      * @return A value for the encapsulated property in the RDF model, or null
93      * if the property has no value.
94      * @exception com.hp.hpl.jena.ontology.ConversionException if the value is not a list
95      */

96     public DAMLList getList();
97
98
99     /**
100      * <p>Answer a value of the encapsulated property, converted to a DAML common value</p>
101      *
102      * @return A DAML value for the encapsulated property in the RDF model, or null
103      * if the property has no value.
104      */

105     public DAMLCommon getDAMLValue();
106
107
108     /**
109      * <p>Add a value to the encapsulated property.</p>
110      *
111      * @param value The value to be added.
112      */

113     public void add( RDFNode value );
114
115
116     /**
117      * <p>Remove a value from the encapsulated property.</p>
118      *
119      * @param value The value to be removed.
120      */

121     public void remove( RDFNode value );
122
123
124     /**
125      * <p>Answer true if the encapsulated property has the given value as one of its
126      * values.</p>
127      *
128      * @param value A value to test for
129      * @return True if the RDF model contains a statement giving a value for
130      * the encapsulated property matching the given value.
131      */

132     public boolean hasValue( RDFNode value );
133
134 }
135
136
137
138 /*
139     (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
140     All rights reserved.
141
142     Redistribution and use in source and binary forms, with or without
143     modification, are permitted provided that the following conditions
144     are met:
145
146     1. Redistributions of source code must retain the above copyright
147        notice, this list of conditions and the following disclaimer.
148
149     2. Redistributions in binary form must reproduce the above copyright
150        notice, this list of conditions and the following disclaimer in the
151        documentation and/or other materials provided with the distribution.
152
153     3. The name of the author may not be used to endorse or promote products
154        derived from this software without specific prior written permission.
155
156     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
157     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
158     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
159     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
160     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
161     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
162     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
163     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
164     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
165     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
166 */

167
168
Popular Tags