1
2
3
4
5
6 package org.dbe.studio.tools.ontologyviewer.metamodels.odm;
7
8 /***
9 * A property restriction is a special kind of class description. It describes
10 * an anonymous class, namely a class of all individuals that satisfy the
11 * restriction. OWL distinguishes two kinds of property restrictions: value
12 * constraints and cardinality constraints
13 *
14 * A value constraint puts constraints on the range of the property when applied
15 * to this particular class description. For example, we might want to refer to
16 * those individuals whose value of the property adjacentTo should be some Region,
17 * and then use this within a class axiom, perhaps even a class axiom for Region
18 * itself. Note that this is different from rdfs:range, which is applied to all
19 * situations in which the property is used.
20 *
21 * A cardinality constraint puts constraints on the number of values a property
22 * can take, in the context of this particular class description. For example,
23 * we might want to say that for a soccer team the hasPlayer property has 11 values.
24 * For a basketball team the same property would have only 5 values
25 *
26 * A restriction class should have exactly one triple linking the restriction
27 * to a particular property, using the owl:onProperty property. The restriction
28 * class should also have exactly one triple that represents the value constraint
29 * c.q. cardinality constraint on the property under consideration, e.g., that
30 * the cardinality of the property is exactly 1.
31 *
32 * Property restrictions can be applied both to datatype properties (properties
33 * for which the value is a data literal) and object properties (properties for
34 * which the value is an individual). For more information about this distinction,
35 * see the section on properties.
36 */
37 public class OdmRestrictionClass extends OdmOntologyClass {
38
39 OdmProperty onProperty;
40
41
42 OdmOntologyClass allValuesFrom;
43 OdmOntologyClass someValuesFrom;
44
45
46 Object hasValue;
47
48 String minCardinality, maxCardinality, cardinality;
49
50 public OdmRestrictionClass(OdmOntology ontology, OdmProperty prop) {
51 super(ontology);
52 onProperty = prop;
53 }
54
55 /***
56 * @param ontology
57 * @param name
58 * @param id
59 */
60 public OdmRestrictionClass(OdmOntology ontology, OdmProperty prop, String name, String id) {
61 super(ontology, name, id);
62 onProperty = prop;
63 }
64
65 public void setOnProperty(OdmProperty prop) {
66 onProperty = prop;
67 }
68
69 public void setAllValuesFrom(OdmOntologyClass avf) {
70 allValuesFrom = avf;
71 }
72
73 public void setSomeValuesFrom(OdmOntologyClass svf) {
74 someValuesFrom = svf;
75 }
76
77 public void setHasValue(Object o) {
78 hasValue = o;
79 }
80
81 public void setMinCardinality(String minC) {
82 minCardinality = minC;
83 }
84
85 public void setMaxCardinality(String maxC) {
86 maxCardinality = maxC;
87 }
88
89 public void setCardinality(String c) {
90 cardinality = c;
91 }
92
93 public OdmProperty getOnProperty() {
94 return onProperty;
95 }
96
97 public OdmOntologyClass getAllValuesFrom() {
98 return allValuesFrom;
99 }
100
101 public OdmOntologyClass getSomeValuesFrom() {
102 return someValuesFrom;
103 }
104
105 public Object getHasValue() {
106 return hasValue;
107 }
108
109 public String getMinCardinality() {
110 return minCardinality;
111 }
112
113 public String getMaxCardinality() {
114 return maxCardinality;
115 }
116
117 public String getCardinality() {
118 return cardinality;
119 }
120 }