001 /*
002 * OResource.java
003 *
004 * Niraj Aswani, 09/March/07
005 *
006 * $Id: OResource.html,v 1.0 2007/03/09 16:13:01 niraj Exp $
007 */
008 package gate.creole.ontology;
009
010 import java.util.List;
011 import java.util.Locale;
012 import java.util.Set;
013
014 /**
015 * This is the top level interface for all ontology resources such as
016 * classes, instances and properties.
017 *
018 * @author Niraj Aswani
019 * @author Johann Petrak
020 *
021 */
022 public interface OResource {
023 /**
024 * Gets the URI of the resource.
025 *
026 * @return the URI.
027 * @deprecated
028 */
029 @Deprecated
030 public URI getURI();
031
032 public ONodeID getONodeID();
033
034 /**
035 * Sets the URI of the resource
036 *
037 * @param uri
038 * @deprecated
039 */
040 @Deprecated
041 public void setURI(URI uri);
042
043 /**
044 * This method returns a set of labels specified on this resource.
045 *
046 * @return
047 */
048 public Set<Literal> getLabels();
049
050 /**
051 * This method returns a set of comments specified on this resource.
052 *
053 * @return
054 * @deprecated
055 */
056 @Deprecated
057 public Set<Literal> getComments();
058
059 /**
060 * Gets the comment set on the resource in the specified language.
061 * Returns null if no comment found for the specified language.
062 *
063 * @param language (@see OConstants for available locales)
064 * @return the comment of the resource
065 * @deprecated
066 */
067 @Deprecated
068 public String getComment(Locale language);
069
070 /**
071 * Sets the comment for the resource with the specified language.
072 *
073 * @param aComment the comment to be set.
074 * @param Locale
075 * @deprecated
076 */
077 @Deprecated
078 public void setComment(String aComment, Locale Locale);
079
080 /**
081 * Gets the comment set on the resource in the specified language.
082 * Returns null if no comment found for the specified language.
083 *
084 * @param language
085 * @return the label of the resource
086 * @deprecated
087 */
088 @Deprecated
089 public String getLabel(Locale language);
090
091 /**
092 * Sets the label for the resource with the specified language.
093 *
094 * @param aLabel the label to be set.
095 * @param language the anguage of the label. (@see OConstants for
096 * available locales)
097 */
098 public void setLabel(String aLabel, Locale language);
099
100 /**
101 * Gets resource name. Typically a string after the last '#' or '/'
102 *
103 * @return the name of the resource.
104 */
105 public String getName();
106
107 /**
108 * Gets the ontology to which the resource belongs.
109 *
110 * @return the {@link Ontology} to which the resource belongs
111 */
112 public Ontology getOntology();
113
114 /**
115 * Adds a new annotation property value and specifies the language.
116 *
117 * @param theAnnotationProperty the annotation property
118 * @param literal the Literal containing some value
119 */
120 public void addAnnotationPropertyValue(
121 AnnotationProperty theAnnotationProperty, Literal literal);
122
123 /**
124 * Gets the list of values for a given property name.
125 *
126 * @param theAnnotationProperty
127 * @return a List of {@link Literal}.
128 */
129 public List<Literal> getAnnotationPropertyValues(
130 AnnotationProperty theAnnotationProperty);
131
132 /**
133 * This method returns the annotation properties set on this resource.
134 *
135 * @return
136 */
137 public Set<AnnotationProperty> getSetAnnotationProperties();
138
139 /**
140 * This method returns all the set properties set on this resource.
141 *
142 * @return
143 */
144 public Set<RDFProperty> getAllSetProperties();
145
146 /**
147 * This method returns a set of all properties where the current
148 * resource has been specified as one of the domain resources.
149 *
150 * @return
151 */
152 public Set<RDFProperty> getPropertiesWithResourceAsDomain();
153
154 /**
155 * This method returns a set of all properties where the current
156 * resource has been specified as one of the range resources.
157 *
158 * @return
159 */
160 public Set<RDFProperty> getPropertiesWithResourceAsRange();
161
162 /**
163 * Checks if the resource has the provided annotation property set on
164 * it with the specified value.
165 *
166 * @param aProperty
167 * @param aValue
168 * @return
169 */
170 public boolean hasAnnotationPropertyWithValue(AnnotationProperty aProperty,
171 Literal aValue);
172
173 /**
174 * For the current resource, the method removes the given literal for
175 * the given property.
176 *
177 * @param theAnnotationProperty
178 * @param literal
179 */
180 public void removeAnnotationPropertyValue(
181 AnnotationProperty theAnnotationProperty, Literal literal);
182
183 /**
184 * Removes all values for a named property.
185 *
186 * @param theProperty the property
187 */
188 public void removeAnnotationPropertyValues(AnnotationProperty theProperty);
189
190 }
|