1 /*
2 * @author Giorgos Anestis, TUC/MUSIC
3 *
4 * @version 2.0
5 */
6 package org.dbe.studio.tools.ontologyviewer.metamodels.odm;
7
8 import java.util.Vector;
9
10 /***
11 * Object properties link individuals to individuals. They are relations
12 * between instances of two classes
13 */
14
15 public class OdmObjectProperty extends OdmProperty {
16
17 /*
18 * Properties have a direction, from domain to range. An axiom of the form
19 * P1 owl:inverseOf P2 asserts that for every pair (x,y) in the property
20 * extension of P1, there is a pair (y,x) in the property extension of P2,
21 * and vice versa. Thus, owl:inverseOf is a symmetric property.
22 */
23 OdmObjectProperty inverseOf;
24
25 /*
26 * if a property is declared to be inverse-functional, then the object of a
27 * property statement uniquely determines the subject (some individual).
28 * More formally, if we state that P is an owl:InverseFunctionalProperty,
29 * then this asserts that a value y can only be the value of P for a single
30 * instance x, i.e. there cannot be two distinct instances x1 and x2 such
31 * that both pairs (x1,y) and (x2,y) are instances of P.
32 *
33 * Inverse-functional properties are by definition object properties.
34 */
35
36 boolean isInverseFunctional;
37
38 /*
39 * A symmetric property is a property for which holds that if the pair
40 * (x,y) is an instance of P, then the pair (y,x) is also an instance
41 * of P. Syntactically, a property is defined as symmetric by making
42 * it an instance of the built-in OWL class owl:SymmetricProperty, a
43 * subclass of owl:ObjectProperty.
44 *
45 * The domain and range of a symmetric property are the same.
46 */
47 boolean isSymmetric;
48
49 /*
50 * When one defines a property P to be a transitive property, this means
51 * that if a pair (x,y) is an instance of P, and the pair (y,z) is also
52 * instance of P, then we can infer the the pair (x,z) is also an instance
53 * of P.
54 *
55 * Syntactically, a property is defined as being transitive by making it an
56 * instance of the the built-in OWL class owl:TransitiveProperty, which is
57 * defined as a subclass of owl:ObjectProperty.
58 */
59 boolean isTransitive;
60
61 /***
62 *
63 */
64 public OdmObjectProperty() {
65 super();
66 }
67
68 public OdmObjectProperty(OdmObjectProperty op) {
69 super(op.getOntology(), op.getName(), op.getId());
70 }
71
72
73 /***
74 * @param ontology
75 * @param name
76 * @param id
77 */
78 public OdmObjectProperty(OdmOntology ontology, String name, String id) {
79 super(ontology, name, id);
80 }
81
82 public void addRange(OdmOntologyClass oc) {
83 if (range == null) {
84 range = new Vector();
85 }
86 range.add(oc);
87 }
88
89 public void removeRange(OdmOntologyClass oc) {
90 if (range != null) {
91 range.remove(oc);
92 }
93 }
94
95 public void setInverseOf(OdmObjectProperty op) {
96 inverseOf = op;
97 }
98
99 public OdmObjectProperty getInverseOf() {
100 return inverseOf;
101 }
102
103 public void setIsInverseFunctional(boolean iif) {
104 isInverseFunctional = iif;
105 }
106
107 public void setIsSymmetric(boolean is) {
108 isSymmetric = is;
109 }
110
111 public void setIsTransitive(boolean it) {
112 isTransitive = it;
113 }
114
115 public boolean getIsInverseFunctional() {
116 return isInverseFunctional;
117 }
118
119 public boolean getIsSymmetric() {
120 return isSymmetric;
121 }
122
123 public boolean getIsTransitive() {
124 return isTransitive;
125 }
126 }