RDFProperty.java
001 /*
002  *  RDFProperty.java
003  *
004  *  Niraj Aswani, 09/March/07
005  *
006  *  $Id: RDFProperty.html,v 1.0 2007/03/09 16:13:01 niraj Exp $
007  */
008 package gate.creole.ontology;
009 
010 import gate.creole.ontology.OConstants.Closure;
011 import java.util.Set;
012 
013 /**
014  * RDFProperty is the top level property. Any property is an
015  * RDFProperty. Each sub property has their constraints on the type of
016  * values they can have for their domain and range. Typically
017  * RDFProperties (and not any of their sub properties) can have any
018  * OResource as its domain and range.
019  
020  @author Niraj Aswani
021  @author Johann Petrak
022  */
023 public interface RDFProperty extends OResource {
024 
025   /**
026    * Add an equivalentPropertyAs relation between the two properties. Each
027    * property has a set of these, so it is possible to have
028    * equivalentPropertyAs relation between more than two properties.
029    
030    @param theProperty
031    */
032   public void setEquivalentPropertyAs(RDFProperty theProperty);
033 
034   /**
035    * Returns a set of all RDFProperty instances that are in
036    * EquivalentPropertyAs relation with this property. Or null if there
037    * are no such properties.
038    
039    @return {@link Set} value.
040    */
041   public Set<RDFProperty> getEquivalentPropertyAs();
042 
043   /**
044    * Checks whether the property is Equivalent as the one provide.
045    
046    @param theProperty
047    @return true, if the provided property is same as the one provided,
048    *         otherwise - false.
049    */
050   public boolean isEquivalentPropertyAs(RDFProperty theProperty);
051 
052   /**
053    * Gets the set of super-properties for this property.
054    
055    @param {@link OConstants#DIRECT_CLOSURE} for direct
056    *          super-properties only or
057    *          {@link OConstants#TRANSITIVE_CLOSURE} for all the
058    *          super-properties.
059    @return a set of {@link Property} values.
060    */
061   @Deprecated
062   public Set<RDFProperty> getSuperProperties(byte closure);
063 
064   public Set<RDFProperty> getSuperProperties(Closure closure);
065 
066   /**
067    * Checks whether the property is a super property of the given
068    * property.
069    
070    @param theProperty
071    @param closure either OntologyConstants.DIRECT_CLOSURE or
072    *          OntologyConstants.TRANSTIVE_CLOSURE
073    @return true, if the property is a super property of the given
074    *         property, otherwise - false.
075    */
076   @Deprecated
077   public boolean isSuperPropertyOf(RDFProperty theProperty, byte closure);
078 
079   public boolean isSuperPropertyOf(RDFProperty theProperty, Closure closure);
080 
081   /**
082    * Add a SuperPropertyOf relation between the given property and this.
083    
084    @param property
085    */
086   public void addSubProperty(RDFProperty property);
087 
088   /**
089    * Removes a SuperPropertyOf relation between the given property and
090    * this.
091    
092    @param property
093    */
094   public void removeSubProperty(RDFProperty property);
095 
096   /**
097    * Gets the set of sub-properties for this property.
098    
099    @param {@link OConstants#DIRECT_CLOSURE} for direct sub-properties
100    *          only or {@link OConstants#TRANSITIVE_CLOSURE} for all the
101    *          sub-properties.
102    @return a set of {@link Property} values.
103    */
104   @Deprecated
105   public Set<RDFProperty> getSubProperties(byte closure);
106 
107   public Set<RDFProperty> getSubProperties(Closure closure);
108 
109   /**
110    * Checks whether the property is a sub property of the given
111    * property.
112    
113    @param theProperty
114    @param closure either OntologyConstants.DIRECT_CLOSURE or
115    *          OntologyConstants.TRANSTIVE_CLOSURE
116    @return true, if the property is a sub property of the given
117    *         property, otherwise - false.
118    */
119   @Deprecated
120   public boolean isSubPropertyOf(RDFProperty theProperty, byte closure);
121 
122   public boolean isSubPropertyOf(RDFProperty theProperty, Closure closure);
123 
124   /**
125    * Answers whether this property is a functional property. Functional
126    * properties are the ones that can have at most one value for any
127    * given value from the domain. Both object properties and datatype
128    * properties can be functional.
129    
130    @return <tt>true</tt> if this property is functional.
131    */
132   public boolean isFunctional();
133 
134   /**
135    * Sets the functional property flag on this property.
136    
137    @param functional <tt>true</tt> iff the property should be marked
138    *          as functional.
139    */
140   public void setFunctional(boolean functional);
141 
142   /**
143    * Answers whether this property is an inverse functional property.
144    * Inverse functional properties are the ones that for any given
145    * domain value there can be at most one range value that is valid for
146    * this property. Both object properties and datatype properties can
147    * be inverse functional.
148    
149    @return <tt>true</tt> if this property is inverse functional.
150    */
151   public boolean isInverseFunctional();
152 
153   /**
154    * Sets the inverse functional property flag on this property.
155    
156    @param inverseFunctional <tt>true</tt> iff the property should be
157    *          marked as inverse functional.
158    */
159   public void setInverseFunctional(boolean inverseFunctional);
160 
161   /**
162    * Checks whether the provided resource is compatible with the range
163    * restrictions on the property.
164    
165    @param aResource the Resource
166    @return true if this resource is compatible with the range
167    *         restrictions on the property. False otherwise.
168    @deprecated 
169    */
170   @Deprecated
171   public boolean isValidRange(OResource aResource);
172 
173   /**
174    * Checks whether the provided resource is compatible with the domain
175    * restrictions on the property.
176    
177    @param aResource the Resource
178    @return true if this resource is compatible with the domain
179    *         restrictions on the property. False otherwise.
180    @deprecated 
181    */
182   @Deprecated
183   public boolean isValidDomain(OResource aResource);
184 
185   /**
186    * Returns the set of domain restrictions for this property.
187    @return
188    @deprecated 
189    */
190   @Deprecated
191   public Set<OResource> getDomain();
192 
193   /**
194    * Gets the set of range restrictions for this property. If no range
195    * has been set it returns an empty set.
196    
197    @return a set of {@link OClass} or {@link Class} objects.
198    @deprecated
199    */
200   @Deprecated
201   public Set<OResource> getRange();
202 
203   /**
204    * Get the URI of the property.
205    @return - an OURI object representing the URI of the property.
206    */
207   public OURI getOURI();
208 }