ontomde-uml2 1.0.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. data/Manifest.txt +38 -22
  2. data/README.txt +21 -2
  3. data/Rakefile +1 -1
  4. data/bin/ontomde-umlToProtege +4 -0
  5. data/lib/ontomde-uml2.rb +19 -17
  6. data/lib/ontomde-uml2/UMLdatatypeMapping.rb +441 -0
  7. data/lib/ontomde-uml2/autoImplement.rb +170 -166
  8. data/lib/ontomde-uml2/check.rb +1 -1
  9. data/lib/ontomde-uml2/component.rb +45 -0
  10. data/lib/ontomde-uml2/createAndAdd.rb +32 -20
  11. data/lib/ontomde-uml2/dotDiagram.rb +1 -1
  12. data/lib/ontomde-uml2/kb.rb +4 -0
  13. data/lib/ontomde-uml2/kb/MYMODEL_kb.pprj +2377 -0
  14. data/lib/ontomde-uml2/kb/MYMODEL_kb.rdf +2 -0
  15. data/lib/ontomde-uml2/kb/MYMODEL_kb.rdfs +441 -0
  16. data/lib/ontomde-uml2/kb/MYMODEL_meta.pprj +874 -0
  17. data/lib/ontomde-uml2/kb/command.rb +143 -0
  18. data/lib/ontomde-uml2/kb/datatypeMapping.rb +99 -0
  19. data/lib/ontomde-uml2/kb/protege.rb +687 -0
  20. data/lib/ontomde-uml2/multipleInheritance.rb +1 -1
  21. data/lib/ontomde-uml2/salvageErrors.rb +1 -1
  22. data/lib/ontomde-uml2/select.rb +83 -5
  23. data/lib/ontomde-uml2/shortcut.rb +23 -8
  24. data/lib/ontomde-uml2/uml2.pprj +943 -0
  25. data/lib/ontomde-uml2/uml2.rb +62 -29
  26. data/lib/ontomde-uml2/uml2.rdf +768 -0
  27. data/lib/ontomde-uml2/uml2.rdfs +3233 -0
  28. data/lib/ontomde-uml2/umlx.rb +31 -9
  29. data/lib/ontomde-uml2/version.rb +1 -1
  30. data/lib/ontomde-uml2/versionSignature.rb +1 -1
  31. data/lib/ontomde-uml2/xsd.pprj +1063 -0
  32. data/lib/ontomde-uml2/xsd.rdf +2 -0
  33. data/lib/ontomde-uml2/xsd.rdfs +17 -0
  34. data/test/_test_dot.rb +1 -1
  35. data/test/_test_perf.rb +1 -1
  36. data/test/test_base.rb +1 -1
  37. data/test/test_clone.rb +5 -5
  38. data/test/test_misc.rb +3 -3
  39. metadata +47 -29
@@ -3,193 +3,197 @@
3
3
  # If a class implements an interface
4
4
  #
5
5
 
6
- module Mrdf_Model
7
- def umlx_autoImplementProperty!
8
- uml_Class_all.each {|c|
9
- next unless c.kind_of?(Muml_Class)
10
- c.umlx_autoImplementProperty!
11
- }
12
- end
6
+ module Mrdf_Repository
7
+ def umlx_autoImplementProperty!
8
+ uml_Class_all.each {|c|
9
+ next unless c.kind_of?(Muml_Class)
10
+ c.umlx_autoImplementProperty!
11
+ }
12
+ end
13
13
  end
14
14
  module Muml_Class
15
- rdf_safe_attr_reader_many :umlx_autoImplementComplete
16
- def umlx_autoImplementProperty!
17
- return if umlx_autoImplementComplete?
18
- umlx_autoImplementComplete=RDF_TRUE
19
-
20
- #Recurse begining at top of inheritance
21
- uml_generalization.each { |gen|
22
- gen.uml_general_one.umlx_autoImplementProperty!
23
- }
24
-
25
- #OK my ancesters have been processed
26
- #Now if I don't implement an attribute, it is my duty.
27
- impAttNames=umlx_ImplementedAttributesNames
28
- umlx_ImplementedAttributes.each { |ia|
29
- #log.debug { "umlx_autoImplementProperty #{ia} for #{self} #{ia.umlx_isAssociation?}" }
30
- next if impAttNames.include?(ia.uml_name.to_s)
31
- if(ia.umlx_isAttribute?)
32
- att=self.umlx_createAndAddProperty(ia.uml_name.to_s)
33
- att.uml_name=ia.uml_name
34
- att.uml_type=ia.uml_type
35
- else
36
- #puts "create and add ..."
37
- ms=ia.uml_association_one
38
- ms1=ia
39
- ms2=ia.umlx_otherEnd;
40
- #puts "ms=#{ms}"
41
- #puts "ms1=#{ms1} #{ms1.uml_type}"
42
- #puts "ms2=#{ms2} #{ms2.uml_type}"
43
- m,m1,m2=self.umlx_createAndAddAssociation(self.rdf_uri+ia.uml_name.to_s,ia.uml_type)
44
- m1.uml_aggregation=ms1.uml_aggregation
45
- m2.uml_aggregation=ms2.uml_aggregation
46
- m1.uml_name=ms1.uml_name
47
- m2.uml_name=ms2.uml_name
48
-
49
- ms1.umlx_copyToAttributeProperty(m1)
50
- ms2.umlx_copyToAttributeProperty(m2)
51
-
52
- #puts "m=#{m}"
53
- #puts "m1=#{m1} #{m1.uml_type}"
54
- #puts "m2=#{m2} #{m2.uml_type}"
55
- end
56
- }
57
- end
58
- def umlx_ImplementedAttributesNames(ret=Set.new())
59
- uml_generalization.each { |gen|
60
- gen.uml_general_one.umlx_ImplementedAttributesNames(ret)
61
- }
62
- uml_ownedAttribute.each { |oa|
63
- ret << oa.uml_name.to_s
64
- }
65
- return ret
66
- end
67
- def umlx_ImplementedAttributes(ret=Set.new())
68
- uml_implementation.each { |g|
69
- g.uml_supplier_one.umlx_ImplementedAttributes(ret)
70
- }
71
- return ret
72
- end
15
+ rdf_safe_attr_reader_many :umlx_autoImplementComplete
16
+ def umlx_autoImplementProperty!
17
+ return if umlx_autoImplementComplete?
18
+ umlx_autoImplementComplete=RDF_TRUE
19
+
20
+ #Recurse begining at top of inheritance
21
+ uml_generalization.each { |gen|
22
+ gen.uml_general_one.umlx_autoImplementProperty!
23
+ }
24
+
25
+ #OK my ancesters have been processed
26
+ #Now if I don't implement an attribute, it is my duty.
27
+ impAttNames=umlx_ImplementedAttributesNames
28
+ umlx_ImplementedAttributes.each { |ia|
29
+ #log.debug { "umlx_autoImplementProperty #{ia} for #{self} #{ia.umlx_isAssociation?}" }
30
+ next if impAttNames.include?(ia.uml_name.to_s)
31
+ if(ia.umlx_isAttribute?)
32
+ att=self.umlx_createAndAddProperty(ia.uml_name.to_s)
33
+ att.uml_name=ia.uml_name
34
+ att.uml_type=ia.uml_type
35
+ else
36
+ #puts "create and add ..."
37
+ ms=ia.uml_association_one
38
+ ms1=ia
39
+ ms2=ia.umlx_otherEnd;
40
+ #puts "ms=#{ms}"
41
+ #puts "ms1=#{ms1} #{ms1.uml_type}"
42
+ #puts "ms2=#{ms2} #{ms2.uml_type}"
43
+ m,m1,m2=self.umlx_createAndAddAssociation(self.rdf_uri+ia.uml_name.to_s,ia.uml_type)
44
+ m1.uml_aggregation=ms1.uml_aggregation
45
+ m2.uml_aggregation=ms2.uml_aggregation
46
+ m1.uml_name=ms1.uml_name
47
+ m2.uml_name=ms2.uml_name
48
+
49
+ ms1.umlx_copyToAttributeProperty(m1)
50
+ ms2.umlx_copyToAttributeProperty(m2)
51
+
52
+ #puts "m=#{m}"
53
+ #puts "m1=#{m1} #{m1.uml_type}"
54
+ #puts "m2=#{m2} #{m2.uml_type}"
55
+ end
56
+ }
57
+ end
58
+ def umlx_ImplementedAttributesNames(ret=Set.new())
59
+ uml_generalization.each { |gen|
60
+ gen.uml_general_one.umlx_ImplementedAttributesNames(ret)
61
+ }
62
+ uml_ownedAttribute.each { |oa|
63
+ ret << oa.uml_name.to_s
64
+ }
65
+ return ret
66
+ end
67
+ def umlx_ImplementedAttributes(ret=Set.new())
68
+ uml_implementation.each { |g|
69
+ g.uml_supplier_one.umlx_ImplementedAttributes(ret)
70
+ }
71
+ return ret
72
+ end
73
73
 
74
74
  end
75
75
  module Muml_Interface
76
- def umlx_ImplementedAttributes(ret)
77
- uml_generalization.each{|gen|
78
- gen.uml_general_one.umlx_ImplementedAttributes(ret)
79
- }
80
- uml_ownedAttribute.each { |oa|
81
- ret << oa
82
- }
83
- return ret
84
- end
76
+ def umlx_ImplementedAttributes(ret)
77
+ uml_generalization.each{|gen|
78
+ gen.uml_general_one.umlx_ImplementedAttributes(ret)
79
+ }
80
+ uml_ownedAttribute.each { |oa|
81
+ ret << oa
82
+ }
83
+ return ret
84
+ end
85
85
  end
86
86
 
87
87
 
88
88
  #----------------
89
89
  #
90
- module Mrdf_Model
91
- def umlx_autoImplementOperation!
92
- uml_Class_all.each { |c|
93
- next unless c.kind_of?(Muml_Class)
94
- c.umlx_autoImplementOperation!
95
- }
96
- end
90
+ module Mrdf_Repository
91
+ def umlx_autoImplementOperation!
92
+ uml_Class_all.each { |c|
93
+ next unless c.kind_of?(Muml_Class)
94
+ c.umlx_autoImplementOperation!
95
+ }
96
+ uml_Component_all.each { |c|
97
+ #next unless c.kind_of?(Muml_Class)
98
+ c.umlx_autoImplementOperation!
99
+ }
100
+ end
97
101
  end
98
102
  module Muml_Class
99
- rdf_safe_attr_reader_many :umlx_autoImplementCompleteOperation
100
- def umlx_autoImplementOperation!
101
- return if umlx_autoImplementCompleteOperation?
102
- return if uml_isAbstract?
103
- umlx_autoImplementCompleteOperation=RDF_TRUE
104
-
105
- #Recurse begining at top of inheritance
106
- uml_generalization.each { |gen|
107
- gen.uml_general_one.umlx_autoImplementOperation!
108
- }
109
-
110
- #OK my ancesters have been processed
111
- #Now if I don't implement an operation, it is my duty.
112
- impOper=umlx_ImplementedOperations
113
- umlx_operationIShouldImplement.each { |sig,ia|
114
- next if impOper.keys.include?(ia.umlx_signature)
115
-
116
- c=umlx_createAndAddOperation(ia.rdf_uri+"_implem",ia.uml_name);
117
- (ia.uml_ownedParameter+ia.uml_returnResult).each { |p|
118
- cp=c.umlx_createAndAddParameter(p.rdf_uri+"_implem",p.uml_name_one)
119
- p.umlx_copyToAttributeProperty(cp)
120
- cp.uml_direction=p.uml_direction
121
- }
122
- # the new method is considered business Method if the original method is one
123
- #NOTE: umlx_businessMethod? changed to umlx_businessMethod
124
- c.umlx_businessMethod=ia.umlx_businessMethod
125
- c.umlx_redefinesMethod=ia
126
- }
127
- end
128
-
129
- def umlx_ImplementedOperations(ret=Hash.new())
130
- uml_generalization.each { |gen|
131
- gen.uml_general_one.umlx_ImplementedOperations(ret)
132
- }
133
- uml_ownedOperation.each { |oa|
134
- next if oa.uml_isAbstract?
135
- ret[oa.umlx_signature]=oa
136
- }
137
- return ret
138
- end
139
-
140
- def umlx_operationIShouldImplement(ret=Hash.new())
141
-
142
- #SR16252
143
- umlx_classifier_generalization_indirect.each { |i|
144
- i.uml_ownedOperation.each { |oo|
145
- next unless oo.uml_isAbstract?
146
- ret[oo.umlx_signature]=oo
147
- }
148
- }
149
- uml_implementation.each { |g|
150
- g.uml_supplier_one.uml_ownedOperation.each { |oo|
151
- ret[oo.umlx_signature]=oo
152
- }
153
- #interface implemented via an interface inheritance
154
- g.uml_supplier_one.umlx_classifier_generalization_indirect.each { |i|
155
- i.uml_ownedOperation.each { |oo|
156
- ret[oo.umlx_signature]=oo
157
- }}
158
- }
159
- return ret
160
- end
103
+ rdf_safe_attr_reader_many :umlx_autoImplementCompleteOperation
104
+ def umlx_autoImplementOperation!
105
+ return if umlx_autoImplementCompleteOperation?
106
+ return if uml_isAbstract?
107
+ umlx_autoImplementCompleteOperation=RDF_TRUE
108
+
109
+ #Recurse begining at top of inheritance
110
+ uml_generalization.each { |gen|
111
+ gen.uml_general_one.umlx_autoImplementOperation!
112
+ }
113
+
114
+ #OK my ancesters have been processed
115
+ #Now if I don't implement an operation, it is my duty.
116
+ impOper=umlx_ImplementedOperations
117
+ umlx_operationIShouldImplement.each { |sig,ia|
118
+ next if impOper.keys.include?(ia.umlx_signature)
119
+
120
+ c=umlx_createAndAddOperation(ia.rdf_uri+"_implem",ia.uml_name);
121
+ (ia.uml_ownedParameter+ia.uml_returnResult).each { |p|
122
+ cp=c.umlx_createAndAddParameter(p.rdf_uri+"_implem",p.uml_name_one)
123
+ p.umlx_copyToAttributeProperty(cp)
124
+ cp.uml_direction=p.uml_direction
125
+ }
126
+ # the new method is considered business Method if the original method is one
127
+ #NOTE: umlx_businessMethod? changed to umlx_businessMethod
128
+ c.umlx_businessMethod=ia.umlx_businessMethod
129
+ c.umlx_redefinesMethod=ia
130
+ }
131
+ end
132
+
133
+ def umlx_ImplementedOperations(ret=Hash.new())
134
+ uml_generalization.each { |gen|
135
+ gen.uml_general_one.umlx_ImplementedOperations(ret)
136
+ }
137
+ uml_ownedOperation.each { |oa|
138
+ next if oa.uml_isAbstract?
139
+ ret[oa.umlx_signature]=oa
140
+ }
141
+ return ret
142
+ end
143
+
144
+ def umlx_operationIShouldImplement(ret=Hash.new())
145
+
146
+ #SR16252
147
+ umlx_classifier_generalization_indirect.each { |i|
148
+ i.uml_ownedOperation.each { |oo|
149
+ next unless oo.uml_isAbstract?
150
+ ret[oo.umlx_signature]=oo
151
+ }
152
+ }
153
+ uml_implementation.each { |g|
154
+ g.uml_supplier_one.uml_ownedOperation.each { |oo|
155
+ ret[oo.umlx_signature]=oo
156
+ }
157
+ #interface implemented via an interface inheritance
158
+ g.uml_supplier_one.umlx_classifier_generalization_indirect.each { |i|
159
+ i.uml_ownedOperation.each { |oo|
160
+ ret[oo.umlx_signature]=oo
161
+ }}
162
+ }
163
+ return ret
164
+ end
161
165
 
162
166
  end
163
167
  module Muml_Interface
164
- def umlx_ImplementedOperation(ret=Hash.new())
165
- return ret
166
- end
168
+ def umlx_ImplementedOperation(ret=Hash.new())
169
+ return ret
170
+ end
167
171
  end
168
172
 
169
173
  module Muml_Operation
170
- #operation this operation redefines.
171
- rdf_safe_attr_reader_many :umlx_redefinesMethod
172
-
173
- def umlx_signature
174
- #todo: take parameter into account
175
- r="#{uml_name}("
176
- sep=""
177
- uml_ownedParameter.each { |p|
178
- next if Cuml_ParameterDirectionKind::Return==p.uml_direction_one
179
- r="#{r}#{sep}#{p.umlx_signature}"
180
- sep=","
181
- }
182
- r="#{r})"
183
- return r
184
- end
174
+ #operation this operation redefines.
175
+ rdf_safe_attr_reader_many :umlx_redefinesMethod
176
+
177
+ def umlx_signature
178
+ #todo: take parameter into account
179
+ r="#{uml_name}("
180
+ sep=""
181
+ uml_ownedParameter.each { |p|
182
+ next if Cuml_ParameterDirectionKind::Return==p.uml_direction_one
183
+ r="#{r}#{sep}#{p.umlx_signature}"
184
+ sep=","
185
+ }
186
+ r="#{r})"
187
+ return r
188
+ end
185
189
  end
186
190
 
187
191
  module Muml_Parameter
188
- # Returns parameter signature
189
- # Examples: String[], int, ...
190
- def umlx_signature
191
- return self.uml_type
192
- end
192
+ # Returns parameter signature
193
+ # Examples: String[], int, ...
194
+ def umlx_signature
195
+ return self.uml_type
196
+ end
193
197
  end
194
198
 
195
199
 
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- module Mrdf_Model
3
+ module Mrdf_Repository
4
4
  def umlx_checkAbstractAndInheritance()
5
5
  return unless context[:checkForAbstractAndInheritance,false]
6
6
  msg=""
@@ -0,0 +1,45 @@
1
+ #
2
+
3
+ module Mrdf_Repository
4
+ # generate implicit components from
5
+ # methods defined on domain class.
6
+ def umlx_autoCreateImplicitComponent!
7
+ uml_Class_all.each {|clazz|
8
+ next unless clazz.kind_of?(Cuml_Class)
9
+ clazz.umlx_autoCreateImplicitComponent!
10
+ }
11
+ end
12
+ end
13
+
14
+ module Muml_Component
15
+ # class this component was generated from (nil if none)
16
+ rdf_safe_attr_reader_many :umlx_implicitClass
17
+ end
18
+
19
+ module Muml_Class
20
+ def umlx_autoCreateImplicitComponent!
21
+ # next if uml_isAbstract?
22
+
23
+ p=umlx_owner_one
24
+ p=p.umlx_getOrCreatePackage(context[:componentPackage,"component"],p)
25
+ co=p.umlx_createAndAddComponent(rdf_uri+"_component","#{uml_name} Component")
26
+ co.umlx_implicitClass=self
27
+
28
+ uml_ownedOperation.each { |op|
29
+ #log.debug { "Copy operation #{op} to interface #{i}" }
30
+ nop=co.umlx_createAndAddOperation("#{op.rdf_uri}_interface",op.uml_name.to_s)
31
+ #copy parameter
32
+ op.uml_ownedParameter.each { |pa|
33
+ np=nop.umlx_createAndAddParameter("#{pa.rdf_uri}_interface",pa.uml_name.to_s)
34
+ pa.umlx_copyToAttributeProperty(np)
35
+ }
36
+ #copy return parameter
37
+ op.uml_returnResult.each { |pa|
38
+ np=nop.umlx_createAndAddReturnParameter("#{pa.rdf_uri}_interface",pa.uml_name.to_s)
39
+ pa.umlx_copyToAttributeProperty(np)
40
+ }
41
+ }
42
+
43
+
44
+ end
45
+ end
@@ -4,7 +4,7 @@
4
4
 
5
5
  module Muml_Operation
6
6
  def umlx_createAndAddParameter(new_uri,new_name=nil)
7
- p=Cuml_Parameter.new(rdf_model,new_uri)
7
+ p=Cuml_Parameter.new(rdf_Repository,new_uri)
8
8
  uml_ownedParameter_add(p)
9
9
  p.uml_name=new_name unless new_name.nil?
10
10
  p.uml_isUnique=RDF_TRUE
@@ -16,7 +16,7 @@ module Muml_Operation
16
16
  #Create and add a return parameter.
17
17
  #
18
18
  def umlx_createAndAddReturnParameter(new_uri,new_name="return")
19
- p=Cuml_Parameter.new(rdf_model,new_uri)
19
+ p=Cuml_Parameter.new(rdf_Repository,new_uri)
20
20
  uml_ownedParameter_add(p)
21
21
  p.uml_name=new_name
22
22
  p.uml_isUnique=RDF_TRUE
@@ -28,7 +28,7 @@ module Muml_Operation
28
28
  end
29
29
  module Muml_Interface
30
30
  def umlx_createAndAddGeneralization(gen)
31
- g=Cuml_Generalization.new(rdf_model,nil)
31
+ g=Cuml_Generalization.new(rdf_Repository,nil)
32
32
  g.uml_general=gen
33
33
  g.uml_specific=self
34
34
  self.uml_generalization_add(g)
@@ -40,7 +40,7 @@ module Muml_Class
40
40
  #Return the newly created element.
41
41
  #new_uri should be globaly unique.
42
42
  def umlx_createAndAddClass(new_uri,new_name=nil)
43
- c=Cuml_Class.new(rdf_model,new_uri)
43
+ c=Cuml_Class.new(rdf_Repository,new_uri)
44
44
  #uml_ownedMember_add(c)
45
45
  uml_nestedClassifier_add(c)
46
46
  c.umlx_owner=self
@@ -50,7 +50,7 @@ module Muml_Class
50
50
  return c
51
51
  end
52
52
  def umlx_createAndAddGeneralization(gen)
53
- g=Cuml_Generalization.new(rdf_model,nil)
53
+ g=Cuml_Generalization.new(rdf_Repository,nil)
54
54
  g.uml_general=gen
55
55
  g.uml_specific=self
56
56
  self.uml_generalization_add(g)
@@ -58,7 +58,7 @@ module Muml_Class
58
58
  end
59
59
 
60
60
  def umlx_createAndAddImplementation(gen)
61
- g=Cuml_Implementation.new(rdf_model,nil)
61
+ g=Cuml_Implementation.new(rdf_Repository,nil)
62
62
  g.uml_supplier=gen
63
63
  g.uml_implementingClassifier=self
64
64
  self.uml_implementation_add(g)
@@ -68,13 +68,13 @@ end
68
68
  module Muml_Enumeration
69
69
  def umlx_createAndAddLiteral(lit)
70
70
  lit=lit.to_s
71
- o=Cuml_EnumerationLiteral.new(rdf_model,"#{rdf_uri}_#{lit}")
71
+ o=Cuml_EnumerationLiteral.new(rdf_Repository,"#{rdf_uri}_#{lit}")
72
72
  o.uml_name=lit
73
73
  self.uml_ownedLiteral_add(o)
74
74
  return o
75
75
  end
76
76
  def umlx_createAndAddImplementation(gen)
77
- g=Cuml_Implementation.new(rdf_model,nil)
77
+ g=Cuml_Implementation.new(rdf_Repository,nil)
78
78
  g.uml_supplier=gen
79
79
  g.uml_implementingClassifier=self
80
80
  self.uml_implementation_add(g)
@@ -86,7 +86,7 @@ module Muml_Package
86
86
  #Return the newly created element.
87
87
  #new_uri should be globaly unique.
88
88
  def umlx_createAndAddEnumeration(new_uri,new_name=nil)
89
- c=Cuml_Enumeration.new(rdf_model,new_uri)
89
+ c=Cuml_Enumeration.new(rdf_Repository,new_uri)
90
90
  uml_ownedMember_add(c)
91
91
  c.umlx_owner=self
92
92
  c.uml_name=new_name unless new_name.nil?
@@ -98,7 +98,7 @@ module Muml_Package
98
98
  #Return the newly created element.
99
99
  #new_uri should be globaly unique.
100
100
  def umlx_createAndAddInterface(new_uri,new_name=nil)
101
- c=Cuml_Interface.new(rdf_model,new_uri)
101
+ c=Cuml_Interface.new(rdf_Repository,new_uri)
102
102
  uml_ownedMember_add(c)
103
103
  c.umlx_owner=self
104
104
  c.uml_name=new_name unless new_name.nil?
@@ -110,7 +110,19 @@ module Muml_Package
110
110
  #Return the newly created element.
111
111
  #new_uri should be globaly unique.
112
112
  def umlx_createAndAddClass(new_uri,new_name=nil)
113
- c=Cuml_Class.new(rdf_model,new_uri)
113
+ c=Cuml_Class.new(rdf_Repository,new_uri)
114
+ uml_ownedMember_add(c)
115
+ c.umlx_owner=self
116
+ c.uml_name=new_name unless new_name.nil?
117
+ c.uml_visibility=::Cuml_VisibilityKind::Public
118
+ #puts "création classe #{new_name} in #{self.java_qualifiedName}"
119
+ return c
120
+ end
121
+ #Creates and add a new UML Class.
122
+ #Return the newly created element.
123
+ #new_uri should be globaly unique.
124
+ def umlx_createAndAddComponent(new_uri,new_name=nil)
125
+ c=Cuml_Component.new(rdf_Repository,new_uri)
114
126
  uml_ownedMember_add(c)
115
127
  c.umlx_owner=self
116
128
  c.uml_name=new_name unless new_name.nil?
@@ -122,7 +134,7 @@ module Muml_Package
122
134
  #Return the newly created element.
123
135
  #new_uri should be globaly unique.
124
136
  def umlx_createAndAddDataType(new_uri,new_name=nil)
125
- c=Cuml_DataType.new(rdf_model,new_uri)
137
+ c=Cuml_DataType.new(rdf_Repository,new_uri)
126
138
  uml_ownedMember_add(c)
127
139
  c.umlx_owner=self
128
140
  c.uml_name=new_name unless new_name.nil?
@@ -134,7 +146,7 @@ module Muml_Package
134
146
  #Return the newly created element.
135
147
  #new_uri should be globaly unique.
136
148
  def umlx_createAndAddStereotype(new_uri,new_name=nil)
137
- c=Cuml_Stereotype.new(rdf_model,new_uri)
149
+ c=Cuml_Stereotype.new(rdf_Repository,new_uri)
138
150
  uml_ownedMember_add(c)
139
151
  c.umlx_owner=self
140
152
  c.uml_name=new_name unless new_name.nil?
@@ -145,7 +157,7 @@ module Muml_Package
145
157
  #Return the newly created element.
146
158
  #new_uri should be globaly unique.
147
159
  def umlx_createAndAddPackage(new_uri,new_name=nil)
148
- c=Cuml_Package.new(rdf_model,new_uri)
160
+ c=Cuml_Package.new(rdf_Repository,new_uri)
149
161
  uml_ownedMember_add(c)
150
162
  c.umlx_owner=self
151
163
  c.uml_name=new_name unless new_name.nil?
@@ -159,7 +171,7 @@ module Muml_Classifier
159
171
  #Return the newly created element.
160
172
  #new_uri should be globaly unique.
161
173
  def umlx_createAndAddOperation(new_uri,new_name=nil)
162
- m=Cuml_Operation.new(rdf_model,new_uri)
174
+ m=Cuml_Operation.new(rdf_Repository,new_uri)
163
175
  self.uml_ownedOperation_add(m)
164
176
  m.uml_name=new_name unless new_name.nil?
165
177
  m.uml_visibility=::Cuml_VisibilityKind::Public
@@ -171,7 +183,7 @@ module Muml_Classifier
171
183
  #new_uri should be globaly unique.
172
184
  def umlx_createAndAddProperty(new_uri,new_name=nil)
173
185
  #log.debug { %{umlx_createAndAddProperty : name="#{new_name}" uri="#{uri}" owner="#{self}" owner_uri="#{self.rdf_uri}"} }
174
- m=Cuml_Property.new(rdf_model,new_uri)
186
+ m=Cuml_Property.new(rdf_Repository,new_uri)
175
187
  self.uml_ownedAttribute_add(m)
176
188
  m.uml_name=new_name unless new_name.nil?
177
189
  m.uml_isUnique=RDF_TRUE
@@ -186,14 +198,14 @@ module Muml_Classifier
186
198
  #new_uri should be globaly unique.
187
199
  def umlx_createAndAddAssociation(new_uri,otherEnd)
188
200
  c1=self; c2=otherEnd
189
- a=Cuml_Association.new(rdf_model,new_uri)
201
+ a=Cuml_Association.new(rdf_Repository,new_uri)
190
202
 
191
- m1=Cuml_Property.new(rdf_model,"#{new_uri}_e1")
203
+ m1=Cuml_Property.new(rdf_Repository,"#{new_uri}_e1")
192
204
  m1.uml_type=c2
193
205
  #m1.uml_class=c1
194
206
  c1.uml_ownedAttribute_add(m1)
195
207
 
196
- m2=Cuml_Property.new(rdf_model,"#{new_uri}_e2")
208
+ m2=Cuml_Property.new(rdf_Repository,"#{new_uri}_e2")
197
209
  m2.uml_type=c1
198
210
  #m2.uml_class=c1
199
211
  #c2.uml_ownedAttribute_add(m2)
@@ -215,7 +227,7 @@ end
215
227
  module Muml_Element
216
228
  #Create a uml_Comment and append it to uml_ownedComment
217
229
  def umlx_createAndAddComment(uri,txtComment)
218
- c=Cuml_Comment.new(rdf_model,uri);
230
+ c=Cuml_Comment.new(rdf_Repository,uri);
219
231
  uml_ownedComment_add(c)
220
232
  c.uml_body=txtComment
221
233
  end