| Property.java |
1 /*
2 * Property.java
3 *
4 * Copyright (c) 2002, The University of Sheffield.
5 *
6 * This file is part of GATE (see http://gate.ac.uk/), and is free
7 * software, licenced under the GNU Library General Public License,
8 * Version 2, June1991.
9 *
10 * A copy of this licence is included in the distribution in the file
11 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html.
12 *
13 * Kalina Bontcheva 11/2003
14 *
15 *
16 * $Id: Property.java,v 1.1 2004/07/23 17:48:08 kalina Exp $
17 */
18
19 package gate.creole.ontology;
20
21 import java.util.Set;
22
23 public interface Property {
24
25 /**
26 * @return the name of the property within the ontology's namespace
27 */
28 public String getName();
29
30 /**
31 * Returns the URI of this property.
32 */
33 public String getURI();
34
35 /**
36 * Sets the URI of the property
37 * @param theURI
38 */
39 public void setURI(String theURI);
40
41 /**
42 * Add a samePropertyAs relation between the two properties.
43 * Each property has a set of these, so it is possible to
44 * have samePropertyAs relation between more than two properties.
45 * @param theProperty
46 */
47 public void setSamePropertyAs(Property theProperty);
48
49 /**
50 * Returns a set of all KBProperty instances that are in
51 * SamePropertyAs relation with this property. Or null if
52 * there are no such properties.
53 * @return a {@link Set} value.
54 */
55 public Set getSamePropertyAs();
56
57 /**
58 * Add a SubPropertyOf relation between the given property and this.
59 * @param propertyName
60 */
61 public void setSubPropertyOf(String propertyName);
62
63 /**
64 * Return a set of all local names of properties that are in a
65 * subPropertyOf relation with this property. Null if no
66 * such properties. This is not a transitive closure. To obtain
67 * the full depth of the property hierarchy, one needs then to
68 * get the sub-properties of the sub-properties of this, etc.
69 * @return a {@link Set} value.
70 */
71 public Set getSubPropertyOf();
72
73 /**
74 * Returns the domain of a property. There is no corresponding set
75 * method, because the property is created at knowledge base level
76 * by specifying its domain and range
77 */
78 public OClass getDomain();
79
80 /**
81 *
82 * @param value
83 * @return true if this value is compatible with the range
84 * restrictions on the property. False otherwise.
85 */
86 public boolean isValueCompatible(Object value);
87
88 /**Gets the ontology to which the class belongs.
89 * @return the ontology to which the class belongs
90 */
91 public Ontology getOntology() ;
92
93 public Object getRange();
94
95 }