archimate 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.projectile +18 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +4 -0
- data/.yardocs +15 -0
- data/Gemfile +5 -0
- data/Guardfile +27 -0
- data/LICENSE +201 -0
- data/README.md +94 -0
- data/Rakefile +29 -0
- data/TODOs.org +286 -0
- data/archimate.gemspec +51 -0
- data/bin/archimate +17 -0
- data/bin/console +13 -0
- data/bin/setup +8 -0
- data/exe/archidiff +7 -0
- data/exe/archidiff-summary +7 -0
- data/exe/archimate +7 -0
- data/exe/archimerge +7 -0
- data/exe/fmtxml +7 -0
- data/lib/archimate/cli/archi.rb +189 -0
- data/lib/archimate/cli/cleanup.rb +54 -0
- data/lib/archimate/cli/conflict_resolver.rb +39 -0
- data/lib/archimate/cli/convert.rb +39 -0
- data/lib/archimate/cli/diff.rb +31 -0
- data/lib/archimate/cli/diff_summary.rb +101 -0
- data/lib/archimate/cli/duper.rb +85 -0
- data/lib/archimate/cli/lint.rb +16 -0
- data/lib/archimate/cli/mapper.rb +82 -0
- data/lib/archimate/cli/merge.rb +49 -0
- data/lib/archimate/cli/merger.rb +109 -0
- data/lib/archimate/cli/stats.rb +42 -0
- data/lib/archimate/cli/svger.rb +40 -0
- data/lib/archimate/color.rb +53 -0
- data/lib/archimate/config.rb +35 -0
- data/lib/archimate/data_model/any_attribute.rb +13 -0
- data/lib/archimate/data_model/any_element.rb +15 -0
- data/lib/archimate/data_model/archimate_node.rb +181 -0
- data/lib/archimate/data_model/bounds.rb +72 -0
- data/lib/archimate/data_model/color.rb +47 -0
- data/lib/archimate/data_model/concept.rb +14 -0
- data/lib/archimate/data_model/concern.rb +17 -0
- data/lib/archimate/data_model/connection.rb +107 -0
- data/lib/archimate/data_model/constants.rb +82 -0
- data/lib/archimate/data_model/container.rb +17 -0
- data/lib/archimate/data_model/diagram.rb +40 -0
- data/lib/archimate/data_model/diffable_array.rb +213 -0
- data/lib/archimate/data_model/diffable_primitive.rb +83 -0
- data/lib/archimate/data_model/documentation.rb +14 -0
- data/lib/archimate/data_model/element.rb +87 -0
- data/lib/archimate/data_model/font.rb +54 -0
- data/lib/archimate/data_model/label.rb +19 -0
- data/lib/archimate/data_model/lang_string.rb +41 -0
- data/lib/archimate/data_model/location.rb +31 -0
- data/lib/archimate/data_model/metadata.rb +14 -0
- data/lib/archimate/data_model/model.rb +217 -0
- data/lib/archimate/data_model/modeling_note.rb +13 -0
- data/lib/archimate/data_model/named_referenceable.rb +14 -0
- data/lib/archimate/data_model/organization.rb +40 -0
- data/lib/archimate/data_model/property.rb +25 -0
- data/lib/archimate/data_model/property_definition.rb +16 -0
- data/lib/archimate/data_model/referenceable.rb +29 -0
- data/lib/archimate/data_model/relationship.rb +85 -0
- data/lib/archimate/data_model/schema_info.rb +18 -0
- data/lib/archimate/data_model/style.rb +32 -0
- data/lib/archimate/data_model/view.rb +12 -0
- data/lib/archimate/data_model/view_concept.rb +18 -0
- data/lib/archimate/data_model/view_node.rb +114 -0
- data/lib/archimate/data_model/viewpoint.rb +87 -0
- data/lib/archimate/data_model.rb +54 -0
- data/lib/archimate/diff/archimate_array_reference.rb +113 -0
- data/lib/archimate/diff/archimate_identified_node_reference.rb +41 -0
- data/lib/archimate/diff/archimate_node_attribute_reference.rb +70 -0
- data/lib/archimate/diff/archimate_node_reference.rb +80 -0
- data/lib/archimate/diff/change.rb +49 -0
- data/lib/archimate/diff/conflict.rb +31 -0
- data/lib/archimate/diff/conflicts/base_conflict.rb +53 -0
- data/lib/archimate/diff/conflicts/deleted_items_child_updated_conflict.rb +30 -0
- data/lib/archimate/diff/conflicts/deleted_items_referenced_conflict.rb +63 -0
- data/lib/archimate/diff/conflicts/path_conflict.rb +51 -0
- data/lib/archimate/diff/conflicts.rb +89 -0
- data/lib/archimate/diff/delete.rb +41 -0
- data/lib/archimate/diff/difference.rb +113 -0
- data/lib/archimate/diff/insert.rb +43 -0
- data/lib/archimate/diff/merge.rb +70 -0
- data/lib/archimate/diff/move.rb +51 -0
- data/lib/archimate/diff.rb +17 -0
- data/lib/archimate/export/csv_export.rb +32 -0
- data/lib/archimate/export/cypher.rb +171 -0
- data/lib/archimate/export/graph_ml.rb +131 -0
- data/lib/archimate/export/n_quads.rb +142 -0
- data/lib/archimate/file_format.rb +30 -0
- data/lib/archimate/file_formats/archi_file_format.rb +151 -0
- data/lib/archimate/file_formats/archi_file_reader.rb +252 -0
- data/lib/archimate/file_formats/archi_file_writer.rb +230 -0
- data/lib/archimate/file_formats/archimate_v2.rb +461 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_lang_string.rb +35 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_metadata.rb +115 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_property_definitions.rb +28 -0
- data/lib/archimate/file_formats/model_exchange_file/xml_property_defs.rb +27 -0
- data/lib/archimate/file_formats/model_exchange_file_reader.rb +237 -0
- data/lib/archimate/file_formats/model_exchange_file_reader_21.rb +73 -0
- data/lib/archimate/file_formats/model_exchange_file_reader_30.rb +134 -0
- data/lib/archimate/file_formats/model_exchange_file_writer.rb +157 -0
- data/lib/archimate/file_formats/model_exchange_file_writer_21.rb +143 -0
- data/lib/archimate/file_formats/model_exchange_file_writer_30.rb +153 -0
- data/lib/archimate/file_formats/writer.rb +56 -0
- data/lib/archimate/lint/duplicate_entities.rb +121 -0
- data/lib/archimate/lint/linter.rb +146 -0
- data/lib/archimate/logging.rb +55 -0
- data/lib/archimate/maybe_io.rb +34 -0
- data/lib/archimate/progress_indicator.rb +29 -0
- data/lib/archimate/svg/archimate.css +232 -0
- data/lib/archimate/svg/child.rb +29 -0
- data/lib/archimate/svg/connection.rb +184 -0
- data/lib/archimate/svg/css_style.rb +31 -0
- data/lib/archimate/svg/diagram.rb +87 -0
- data/lib/archimate/svg/entity/and_junction.rb +14 -0
- data/lib/archimate/svg/entity/application_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/application_component.rb +41 -0
- data/lib/archimate/svg/entity/application_event.rb +13 -0
- data/lib/archimate/svg/entity/application_function.rb +13 -0
- data/lib/archimate/svg/entity/application_interaction.rb +13 -0
- data/lib/archimate/svg/entity/application_interface.rb +13 -0
- data/lib/archimate/svg/entity/application_process.rb +13 -0
- data/lib/archimate/svg/entity/application_service.rb +13 -0
- data/lib/archimate/svg/entity/artifact.rb +39 -0
- data/lib/archimate/svg/entity/assessment.rb +14 -0
- data/lib/archimate/svg/entity/base_entity.rb +128 -0
- data/lib/archimate/svg/entity/business_actor.rb +14 -0
- data/lib/archimate/svg/entity/business_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/business_event.rb +10 -0
- data/lib/archimate/svg/entity/business_function.rb +13 -0
- data/lib/archimate/svg/entity/business_interaction.rb +13 -0
- data/lib/archimate/svg/entity/business_interface.rb +13 -0
- data/lib/archimate/svg/entity/business_object.rb +13 -0
- data/lib/archimate/svg/entity/business_process.rb +13 -0
- data/lib/archimate/svg/entity/business_role.rb +14 -0
- data/lib/archimate/svg/entity/business_service.rb +13 -0
- data/lib/archimate/svg/entity/capability.rb +14 -0
- data/lib/archimate/svg/entity/communication_network.rb +14 -0
- data/lib/archimate/svg/entity/communication_path.rb +14 -0
- data/lib/archimate/svg/entity/constraint.rb +15 -0
- data/lib/archimate/svg/entity/contract.rb +13 -0
- data/lib/archimate/svg/entity/course_of_action.rb +14 -0
- data/lib/archimate/svg/entity/data_entity.rb +29 -0
- data/lib/archimate/svg/entity/data_object.rb +13 -0
- data/lib/archimate/svg/entity/deliverable.rb +13 -0
- data/lib/archimate/svg/entity/device.rb +48 -0
- data/lib/archimate/svg/entity/diagram_model_reference.rb +22 -0
- data/lib/archimate/svg/entity/diagram_object.rb +30 -0
- data/lib/archimate/svg/entity/distribution_network.rb +14 -0
- data/lib/archimate/svg/entity/driver.rb +14 -0
- data/lib/archimate/svg/entity/equipment.rb +16 -0
- data/lib/archimate/svg/entity/event_entity.rb +36 -0
- data/lib/archimate/svg/entity/facility.rb +16 -0
- data/lib/archimate/svg/entity/function_entity.rb +14 -0
- data/lib/archimate/svg/entity/gap.rb +21 -0
- data/lib/archimate/svg/entity/goal.rb +14 -0
- data/lib/archimate/svg/entity/group.rb +24 -0
- data/lib/archimate/svg/entity/implementation_event.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_function.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_interface.rb +13 -0
- data/lib/archimate/svg/entity/infrastructure_service.rb +13 -0
- data/lib/archimate/svg/entity/interaction_entity.rb +14 -0
- data/lib/archimate/svg/entity/interface_entity.rb +35 -0
- data/lib/archimate/svg/entity/junction.rb +19 -0
- data/lib/archimate/svg/entity/location.rb +14 -0
- data/lib/archimate/svg/entity/material.rb +14 -0
- data/lib/archimate/svg/entity/meaning.rb +40 -0
- data/lib/archimate/svg/entity/motivation_entity.rb +40 -0
- data/lib/archimate/svg/entity/network.rb +14 -0
- data/lib/archimate/svg/entity/node.rb +33 -0
- data/lib/archimate/svg/entity/node_shape.rb +64 -0
- data/lib/archimate/svg/entity/note.rb +30 -0
- data/lib/archimate/svg/entity/or_junction.rb +14 -0
- data/lib/archimate/svg/entity/outcome.rb +15 -0
- data/lib/archimate/svg/entity/path.rb +14 -0
- data/lib/archimate/svg/entity/plateau.rb +15 -0
- data/lib/archimate/svg/entity/principle.rb +15 -0
- data/lib/archimate/svg/entity/process_entity.rb +63 -0
- data/lib/archimate/svg/entity/product.rb +20 -0
- data/lib/archimate/svg/entity/rect.rb +13 -0
- data/lib/archimate/svg/entity/rect_entity.rb +25 -0
- data/lib/archimate/svg/entity/representation.rb +31 -0
- data/lib/archimate/svg/entity/requirement.rb +15 -0
- data/lib/archimate/svg/entity/resource.rb +14 -0
- data/lib/archimate/svg/entity/rounded_rect_entity.rb +23 -0
- data/lib/archimate/svg/entity/service_entity.rb +51 -0
- data/lib/archimate/svg/entity/sketch_model_sticky.rb +14 -0
- data/lib/archimate/svg/entity/stakeholder.rb +15 -0
- data/lib/archimate/svg/entity/system_software.rb +14 -0
- data/lib/archimate/svg/entity/technology_collaboration.rb +14 -0
- data/lib/archimate/svg/entity/technology_event.rb +13 -0
- data/lib/archimate/svg/entity/technology_function.rb +13 -0
- data/lib/archimate/svg/entity/technology_interaction.rb +13 -0
- data/lib/archimate/svg/entity/technology_interface.rb +13 -0
- data/lib/archimate/svg/entity/technology_process.rb +13 -0
- data/lib/archimate/svg/entity/technology_service.rb +13 -0
- data/lib/archimate/svg/entity/value.rb +27 -0
- data/lib/archimate/svg/entity/work_package.rb +14 -0
- data/lib/archimate/svg/entity.rb +93 -0
- data/lib/archimate/svg/entity_factory.rb +17 -0
- data/lib/archimate/svg/extents.rb +27 -0
- data/lib/archimate/svg/point.rb +7 -0
- data/lib/archimate/svg/svg_template.rb +27 -0
- data/lib/archimate/svg/svg_template.svg.erb +169 -0
- data/lib/archimate/version.rb +4 -0
- data/lib/archimate.rb +114 -0
- metadata +623 -0
@@ -0,0 +1,461 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module FileFormats
|
5
|
+
module ArchimateV2
|
6
|
+
LAYER_ENTITIES = {
|
7
|
+
"Business" => %w[
|
8
|
+
BusinessActor
|
9
|
+
BusinessCollaboration
|
10
|
+
BusinessEvent
|
11
|
+
BusinessFunction
|
12
|
+
BusinessInteraction
|
13
|
+
BusinessInterface
|
14
|
+
BusinessObject
|
15
|
+
BusinessProcess
|
16
|
+
BusinessRole
|
17
|
+
BusinessService
|
18
|
+
Contract
|
19
|
+
Location
|
20
|
+
Meaning
|
21
|
+
Value
|
22
|
+
Product
|
23
|
+
Representation
|
24
|
+
].freeze,
|
25
|
+
"Application" => %w[
|
26
|
+
ApplicationCollaboration
|
27
|
+
ApplicationComponent
|
28
|
+
ApplicationFunction
|
29
|
+
ApplicationInteraction
|
30
|
+
ApplicationInterface
|
31
|
+
ApplicationService
|
32
|
+
DataObject
|
33
|
+
].freeze,
|
34
|
+
"Technology" => %w[
|
35
|
+
Artifact
|
36
|
+
CommunicationPath
|
37
|
+
Device
|
38
|
+
InfrastructureFunction
|
39
|
+
InfrastructureInterface
|
40
|
+
InfrastructureService
|
41
|
+
Network
|
42
|
+
Node
|
43
|
+
SystemSoftware
|
44
|
+
].freeze,
|
45
|
+
"Motivation" => %w[
|
46
|
+
Assessment
|
47
|
+
Constraint
|
48
|
+
Driver
|
49
|
+
Goal
|
50
|
+
Principle
|
51
|
+
Requirement
|
52
|
+
Stakeholder
|
53
|
+
].freeze,
|
54
|
+
"Implementation and Migration" => %w[
|
55
|
+
Deliverable
|
56
|
+
Gap
|
57
|
+
Plateau
|
58
|
+
WorkPackage
|
59
|
+
].freeze
|
60
|
+
}.freeze
|
61
|
+
|
62
|
+
ENTITIES = LAYER_ENTITIES.values.flatten.freeze
|
63
|
+
|
64
|
+
CORE_ELEMENTS = %w[Business Application Technology]
|
65
|
+
.map { |layer| LAYER_ENTITIES[layer] }
|
66
|
+
.inject([]) { |memo, obj| memo.concat(obj) }
|
67
|
+
|
68
|
+
CONNECTORS = %w[
|
69
|
+
AndJunction
|
70
|
+
Junction
|
71
|
+
OrJunction
|
72
|
+
].freeze
|
73
|
+
|
74
|
+
RELATIONS = %w[
|
75
|
+
AccessRelationship
|
76
|
+
AggregationRelationship
|
77
|
+
AssignmentRelationship
|
78
|
+
AssociationRelationship
|
79
|
+
CompositionRelationship
|
80
|
+
FlowRelationship
|
81
|
+
InfluenceRelationship
|
82
|
+
RealisationRelationship
|
83
|
+
SpecialisationRelationship
|
84
|
+
TriggeringRelationship
|
85
|
+
UsedByRelationship
|
86
|
+
].freeze
|
87
|
+
|
88
|
+
DEFAULT_RELATIONS = %w[
|
89
|
+
AccessRelationship
|
90
|
+
AggregationRelationship
|
91
|
+
AssignmentRelationship
|
92
|
+
AssociationRelationship
|
93
|
+
CompositionRelationship
|
94
|
+
FlowRelationship
|
95
|
+
RealisationRelationship
|
96
|
+
SpecialisationRelationship
|
97
|
+
TriggeringRelationship
|
98
|
+
UsedByRelationship
|
99
|
+
].freeze
|
100
|
+
|
101
|
+
RELATION_VERBS = {
|
102
|
+
"AccessRelationship" => "accesses",
|
103
|
+
"AggregationRelationship" => "aggregates",
|
104
|
+
"AssignmentRelationship" => "is assigned to",
|
105
|
+
"AssociationRelationship" => "is associated with",
|
106
|
+
"CompositionRelationship" => "composes",
|
107
|
+
"FlowRelationship" => "flows to",
|
108
|
+
"InfluenceRelationship" => "influenecs",
|
109
|
+
"RealisationRelationship" => "realizes",
|
110
|
+
"SpecialisationRelationship" => "specializes",
|
111
|
+
"TriggeringRelationship" => "triggers",
|
112
|
+
"UsedByRelationship" => "is used by"
|
113
|
+
}.freeze
|
114
|
+
|
115
|
+
VIEWPOINTS = {
|
116
|
+
"Introductory" => { entities: CORE_ELEMENTS, relations: RELATIONS },
|
117
|
+
"Organization" => {
|
118
|
+
entities: CONNECTORS + %w[
|
119
|
+
BusinessActor
|
120
|
+
BusinessCollaboration
|
121
|
+
BusinessInterface
|
122
|
+
BusinessRole
|
123
|
+
Location
|
124
|
+
],
|
125
|
+
relations: DEFAULT_RELATIONS - %w[AccessRelationship RealisationRelationship]
|
126
|
+
},
|
127
|
+
"Actor Co-operation" => {
|
128
|
+
entities: CONNECTORS + %w[
|
129
|
+
ApplicationComponent
|
130
|
+
ApplicationInterface
|
131
|
+
ApplicationService
|
132
|
+
BusinessActor
|
133
|
+
BusinessCollaboration
|
134
|
+
BusinessInterface
|
135
|
+
BusinessRole
|
136
|
+
BusinessService
|
137
|
+
],
|
138
|
+
relations: DEFAULT_RELATIONS - %w[AccessRelationship]
|
139
|
+
},
|
140
|
+
"Business Function" => {
|
141
|
+
entities: CONNECTORS + %w[
|
142
|
+
BusinessActor
|
143
|
+
BusinessFunction
|
144
|
+
BusinessRole
|
145
|
+
],
|
146
|
+
relations: DEFAULT_RELATIONS - %w[AccessRelationship RealisationRelationship]
|
147
|
+
},
|
148
|
+
"Business Process" => {
|
149
|
+
entities: CONNECTORS + %w[
|
150
|
+
ApplicationService
|
151
|
+
BusinessActor
|
152
|
+
BusinessCollaboration
|
153
|
+
BusinessEvent
|
154
|
+
BusinessFunction
|
155
|
+
BusinessInteraction
|
156
|
+
BusinessObject
|
157
|
+
BusinessProcess
|
158
|
+
BusinessRole
|
159
|
+
BusinessService
|
160
|
+
Location
|
161
|
+
Representation
|
162
|
+
],
|
163
|
+
relations: DEFAULT_RELATIONS
|
164
|
+
},
|
165
|
+
"Business Process Co-operation" => {
|
166
|
+
entities: CONNECTORS + %w[
|
167
|
+
ApplicationService
|
168
|
+
BusinessActor
|
169
|
+
BusinessCollaboration
|
170
|
+
BusinessEvent
|
171
|
+
BusinessFunction
|
172
|
+
BusinessInteraction
|
173
|
+
BusinessObject
|
174
|
+
BusinessProcess
|
175
|
+
BusinessRole
|
176
|
+
BusinessService
|
177
|
+
Location
|
178
|
+
Representation
|
179
|
+
],
|
180
|
+
relations: DEFAULT_RELATIONS
|
181
|
+
},
|
182
|
+
"Product" => {
|
183
|
+
entities: CONNECTORS + %w[
|
184
|
+
ApplicationComponent
|
185
|
+
ApplicationInterface
|
186
|
+
ApplicationService
|
187
|
+
BusinessActor
|
188
|
+
BusinessEvent
|
189
|
+
BusinessFunction
|
190
|
+
BusinessInteraction
|
191
|
+
BusinessInterface
|
192
|
+
BusinessProcess
|
193
|
+
BusinessRole
|
194
|
+
BusinessService
|
195
|
+
Contract
|
196
|
+
Product
|
197
|
+
Value
|
198
|
+
],
|
199
|
+
relations: DEFAULT_RELATIONS
|
200
|
+
},
|
201
|
+
"Application Behavior" => {
|
202
|
+
entities: CONNECTORS + %w[
|
203
|
+
ApplicationCollaboration
|
204
|
+
ApplicationComponent
|
205
|
+
ApplicationFunction
|
206
|
+
ApplicationInteraction
|
207
|
+
ApplicationInterface
|
208
|
+
ApplicationService
|
209
|
+
DataObject
|
210
|
+
],
|
211
|
+
relations: DEFAULT_RELATIONS
|
212
|
+
},
|
213
|
+
"Application Co-operation" => {
|
214
|
+
entities: CONNECTORS + %w[
|
215
|
+
ApplicationCollaboration
|
216
|
+
ApplicationComponent
|
217
|
+
ApplicationFunction
|
218
|
+
ApplicationInteraction
|
219
|
+
ApplicationInterface
|
220
|
+
ApplicationService
|
221
|
+
DataObject
|
222
|
+
Location
|
223
|
+
],
|
224
|
+
relations: DEFAULT_RELATIONS
|
225
|
+
},
|
226
|
+
"Application Structure" => {
|
227
|
+
entities: CONNECTORS + %w[
|
228
|
+
ApplicationCollaboration
|
229
|
+
ApplicationComponent
|
230
|
+
ApplicationInterface
|
231
|
+
DataObject
|
232
|
+
],
|
233
|
+
relations: DEFAULT_RELATIONS - %w[RealisationRelationship]
|
234
|
+
},
|
235
|
+
"Application Usage" => {
|
236
|
+
entities: CONNECTORS + %w[
|
237
|
+
ApplicationCollaboration
|
238
|
+
ApplicationComponent
|
239
|
+
ApplicationInterface
|
240
|
+
ApplicationService
|
241
|
+
BusinessEvent
|
242
|
+
BusinessFunction
|
243
|
+
BusinessInteraction
|
244
|
+
BusinessObject
|
245
|
+
BusinessProcess
|
246
|
+
BusinessRole
|
247
|
+
DataObject
|
248
|
+
],
|
249
|
+
relations: DEFAULT_RELATIONS
|
250
|
+
},
|
251
|
+
"Infrastructure" => {
|
252
|
+
entities: CONNECTORS + %w[
|
253
|
+
Artifact
|
254
|
+
CommunicationPath
|
255
|
+
Device
|
256
|
+
InfrastructureFunction
|
257
|
+
InfrastructureInterface
|
258
|
+
InfrastructureService
|
259
|
+
Location
|
260
|
+
Network
|
261
|
+
Node
|
262
|
+
SystemSoftware
|
263
|
+
],
|
264
|
+
relations: DEFAULT_RELATIONS
|
265
|
+
},
|
266
|
+
"Infrastructure Usage" => {
|
267
|
+
entities: CONNECTORS + %w[
|
268
|
+
ApplicationComponent
|
269
|
+
ApplicationFunction
|
270
|
+
CommunicationPath
|
271
|
+
Device
|
272
|
+
InfrastructureFunction
|
273
|
+
InfrastructureInterface
|
274
|
+
InfrastructureService
|
275
|
+
Network
|
276
|
+
Node
|
277
|
+
SystemSoftware
|
278
|
+
],
|
279
|
+
relations: DEFAULT_RELATIONS
|
280
|
+
},
|
281
|
+
"Implementation and Deployment" => {
|
282
|
+
entities: CONNECTORS + %w[
|
283
|
+
ApplicationCollaboration
|
284
|
+
ApplicationComponent
|
285
|
+
Artifact
|
286
|
+
CommunicationPath
|
287
|
+
DataObject
|
288
|
+
Device
|
289
|
+
InfrastructureService
|
290
|
+
Network
|
291
|
+
Node
|
292
|
+
SystemSoftware
|
293
|
+
],
|
294
|
+
relations: DEFAULT_RELATIONS
|
295
|
+
},
|
296
|
+
"Information Structure" => {
|
297
|
+
entities: CONNECTORS + %w[
|
298
|
+
Artifact
|
299
|
+
BusinessObject
|
300
|
+
DataObject
|
301
|
+
Meaning
|
302
|
+
Representation
|
303
|
+
],
|
304
|
+
relations: DEFAULT_RELATIONS - %w[AssignmentRelationship UsedByRelationship]
|
305
|
+
},
|
306
|
+
"Service Realization" => {
|
307
|
+
entities: CONNECTORS + %w[
|
308
|
+
ApplicationCollaboration
|
309
|
+
ApplicationComponent
|
310
|
+
ApplicationService
|
311
|
+
BusinessActor
|
312
|
+
BusinessCollaboration
|
313
|
+
BusinessEvent
|
314
|
+
BusinessFunction
|
315
|
+
BusinessInteraction
|
316
|
+
BusinessObject
|
317
|
+
BusinessProcess
|
318
|
+
BusinessRole
|
319
|
+
BusinessService
|
320
|
+
DataObject
|
321
|
+
],
|
322
|
+
relations: DEFAULT_RELATIONS
|
323
|
+
},
|
324
|
+
"Layered" => {
|
325
|
+
entities: ENTITIES + CONNECTORS,
|
326
|
+
relations: RELATIONS
|
327
|
+
},
|
328
|
+
"Landscape Map" => {
|
329
|
+
entities: ENTITIES + CONNECTORS,
|
330
|
+
relations: RELATIONS
|
331
|
+
},
|
332
|
+
"Stakeholder" => {
|
333
|
+
entities: %w[
|
334
|
+
Assessment
|
335
|
+
Driver
|
336
|
+
Goal
|
337
|
+
Stakeholder
|
338
|
+
],
|
339
|
+
relations: %w[
|
340
|
+
AggregationRelationship
|
341
|
+
AssociationRelationship
|
342
|
+
CompositionRelationship
|
343
|
+
InfluenceRelationship
|
344
|
+
SpecialisationRelationship
|
345
|
+
]
|
346
|
+
},
|
347
|
+
"Goal Realization" => {
|
348
|
+
entities: %w[
|
349
|
+
Constraint
|
350
|
+
Goal
|
351
|
+
Principle
|
352
|
+
Requirement
|
353
|
+
],
|
354
|
+
relations: %w[
|
355
|
+
AggregationRelationship
|
356
|
+
AssociationRelationship
|
357
|
+
CompositionRelationship
|
358
|
+
InfluenceRelationship
|
359
|
+
RealisationRelationship
|
360
|
+
SpecialisationRelationship
|
361
|
+
]
|
362
|
+
},
|
363
|
+
"Goal Contribution" => {
|
364
|
+
entities: %w[
|
365
|
+
Constraint
|
366
|
+
Goal
|
367
|
+
Principle
|
368
|
+
Requirement
|
369
|
+
],
|
370
|
+
relations: %w[
|
371
|
+
AggregationRelationship
|
372
|
+
AssociationRelationship
|
373
|
+
CompositionRelationship
|
374
|
+
InfluenceRelationship
|
375
|
+
RealisationRelationship
|
376
|
+
SpecialisationRelationship
|
377
|
+
]
|
378
|
+
},
|
379
|
+
"Principles" => {
|
380
|
+
entities: %w[
|
381
|
+
Goal
|
382
|
+
Principle
|
383
|
+
],
|
384
|
+
relations: %w[
|
385
|
+
AggregationRelationship
|
386
|
+
AssociationRelationship
|
387
|
+
CompositionRelationship
|
388
|
+
InfluenceRelationship
|
389
|
+
RealisationRelationship
|
390
|
+
SpecialisationRelationship
|
391
|
+
]
|
392
|
+
},
|
393
|
+
"Requirements Realization" => {
|
394
|
+
entities: CORE_ELEMENTS + CONNECTORS + %w[
|
395
|
+
Constraint
|
396
|
+
Goal
|
397
|
+
Requirement
|
398
|
+
],
|
399
|
+
relations: DEFAULT_RELATIONS
|
400
|
+
},
|
401
|
+
"Motivation" => {
|
402
|
+
entities: %w[
|
403
|
+
Assessment
|
404
|
+
Constraint
|
405
|
+
Driver
|
406
|
+
Goal
|
407
|
+
Principle
|
408
|
+
Requirement
|
409
|
+
Stakeholder
|
410
|
+
],
|
411
|
+
relations: %w[
|
412
|
+
AggregationRelationship
|
413
|
+
AssociationRelationship
|
414
|
+
CompositionRelationship
|
415
|
+
FlowRelationship
|
416
|
+
InfluenceRelationship
|
417
|
+
RealisationRelationship
|
418
|
+
SpecialisationRelationship
|
419
|
+
]
|
420
|
+
},
|
421
|
+
"Project" => {
|
422
|
+
entities: CONNECTORS + %w[
|
423
|
+
BusinessActor
|
424
|
+
BusinessRole
|
425
|
+
Deliverable
|
426
|
+
Goal
|
427
|
+
WorkPackage
|
428
|
+
],
|
429
|
+
relations: DEFAULT_RELATIONS - %w[AccessRelationship]
|
430
|
+
},
|
431
|
+
"Migration" => {
|
432
|
+
entities: CONNECTORS + %w[Gap Plateau],
|
433
|
+
relations: %w[
|
434
|
+
AndJunction
|
435
|
+
AssociationRelationship
|
436
|
+
CompositionRelationship
|
437
|
+
FlowRelationship
|
438
|
+
Junction
|
439
|
+
OrJunction
|
440
|
+
TriggeringRelationship
|
441
|
+
]
|
442
|
+
},
|
443
|
+
"Implementation and Migration" => {
|
444
|
+
entities: CORE_ELEMENTS + CONNECTORS + %w[
|
445
|
+
Location
|
446
|
+
Requirement
|
447
|
+
Constraint
|
448
|
+
Goal
|
449
|
+
BusinessRole
|
450
|
+
WorkPackage
|
451
|
+
Deliverable
|
452
|
+
BusinessActor
|
453
|
+
Plateau
|
454
|
+
Gap
|
455
|
+
],
|
456
|
+
relations: DEFAULT_RELATIONS
|
457
|
+
}
|
458
|
+
}.freeze
|
459
|
+
end
|
460
|
+
end
|
461
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module FileFormats
|
5
|
+
module ModelExchangeFile
|
6
|
+
class XmlLangString
|
7
|
+
def self.parse(node)
|
8
|
+
return nil unless node
|
9
|
+
DataModel::LangString.new(text: node.content, lang: node["xml:lang"])
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(lang_str, tag_name)
|
13
|
+
@tag_name = tag_name
|
14
|
+
@lang_strs = Array(lang_str)
|
15
|
+
end
|
16
|
+
|
17
|
+
def serialize(xml)
|
18
|
+
return if @lang_strs.empty?
|
19
|
+
|
20
|
+
@lang_strs.each do |lang_str|
|
21
|
+
attrs = lang_str.lang && !lang_str.lang.empty? ? {"xml:lang" => lang_str.lang} : {}
|
22
|
+
xml.send(@tag_name, attrs) { xml.text text_proc(lang_str) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Processes text for text elements
|
27
|
+
private
|
28
|
+
|
29
|
+
def text_proc(str)
|
30
|
+
str.strip.tr("\r", "\n")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module FileFormats
|
5
|
+
module ModelExchangeFile
|
6
|
+
class XmlMetadata
|
7
|
+
def self.parse(metadata)
|
8
|
+
return nil unless metadata
|
9
|
+
DataModel::Metadata.new(schema_infos: parse_schema_infos(metadata))
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(metadata)
|
13
|
+
@metadata = metadata
|
14
|
+
end
|
15
|
+
|
16
|
+
def serialize(xml)
|
17
|
+
return unless @metadata && @metadata.schema_infos.size > 0
|
18
|
+
xml.metadata do
|
19
|
+
if @metadata.schema_infos.size == 1
|
20
|
+
serialize_schema_info_body(xml, @metadata.schema_infos.first)
|
21
|
+
else
|
22
|
+
@metadata.schema_infos.each do |schema_info|
|
23
|
+
serialize_schema_info(xml, schema_info)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def serialize_schema_info(xml, schema_info)
|
32
|
+
xml.schemaInfo do
|
33
|
+
serialize_schema_info_body(xml, schema_info)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def serialize_schema_info_body(xml, schema_info)
|
38
|
+
xml.schema { xml.text (schema_info.schema) } if schema_info.schema
|
39
|
+
xml.schemaversion { xml.text (schema_info.schemaversion) } if schema_info.schemaversion
|
40
|
+
schema_info.elements.each do |el|
|
41
|
+
serialize_any_element(xml, el)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def serialize_any_element(xml, el)
|
46
|
+
if el.prefix && !el.prefix.empty?
|
47
|
+
xml_prefix = xml[el.prefix]
|
48
|
+
else
|
49
|
+
xml_prefix = xml
|
50
|
+
end
|
51
|
+
xml_prefix.send(el.element.to_sym, serialize_any_attributes(el.attributes)) do
|
52
|
+
xml.text(el.content) if el.content&.size > 0
|
53
|
+
el.children.each { |child| serialize_any_element(xml, child) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def serialize_any_attributes(attrs)
|
58
|
+
attrs.each_with_object({}) do |attr, hash|
|
59
|
+
key = attr.prefix&.size > 0 ? [attr.prefix, attr.attribute].join(":") : attr.attribute
|
60
|
+
hash[key] = attr.value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.parse_schema_infos(metadata)
|
65
|
+
schema_infos = metadata.css(">schemaInfo")
|
66
|
+
if schema_infos.size > 0
|
67
|
+
schema_infos.map { |si| parse_schema_info(si) }
|
68
|
+
else
|
69
|
+
[parse_schema_info(metadata)].compact
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.parse_schema_info(node)
|
74
|
+
els = node.element_children
|
75
|
+
return nil if els.empty?
|
76
|
+
schema_info_attrs = {
|
77
|
+
schema: nil,
|
78
|
+
schemaversion: nil,
|
79
|
+
elements: []
|
80
|
+
}
|
81
|
+
els.each do |el|
|
82
|
+
case(el.name)
|
83
|
+
when "schema"
|
84
|
+
schema_info_attrs[:schema] = el.text
|
85
|
+
when "schemaversion"
|
86
|
+
schema_info_attrs[:schemaversion] = el.text
|
87
|
+
else
|
88
|
+
schema_info_attrs[:elements] << parse_any_element(el)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
DataModel::SchemaInfo.new(schema_info_attrs)
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.parse_any_element(node)
|
95
|
+
return nil unless node && node.is_a?(Nokogiri::XML::Element)
|
96
|
+
DataModel::AnyElement.new(
|
97
|
+
element: node.name,
|
98
|
+
prefix: node.namespace&.prefix,
|
99
|
+
attributes: node.attributes.map { |attr| parse_any_attribute(attr) },
|
100
|
+
content: node.text,
|
101
|
+
children: node.element_children.map { |child| parse_any_element(node) }
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.parse_any_attribute(attr)
|
106
|
+
DataModel::AnyAttribute.new(
|
107
|
+
attribute: attr.name,
|
108
|
+
prefix: attr.namepace&.prefix,
|
109
|
+
value: attr.text
|
110
|
+
)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module FileFormats
|
5
|
+
module ModelExchangeFile
|
6
|
+
# Property Definitions as defined in ArchiMate 3.0 Model Exchange XSDs
|
7
|
+
class XmlPropertyDefinitions
|
8
|
+
def initialize(property_defs)
|
9
|
+
@property_definitions = property_defs
|
10
|
+
end
|
11
|
+
|
12
|
+
def serialize(xml)
|
13
|
+
return if @property_definitions.empty?
|
14
|
+
xml.propertyDefinitions do
|
15
|
+
@property_definitions.each do |property_def|
|
16
|
+
xml.propertyDefinition(
|
17
|
+
"identifier" => property_def.id,
|
18
|
+
"type" => property_def.value_type
|
19
|
+
) do
|
20
|
+
ModelExchangeFile::XmlLangString.new(property_def.name, :name).serialize(xml)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Archimate
|
4
|
+
module FileFormats
|
5
|
+
module ModelExchangeFile
|
6
|
+
# Property Definitions as defined in ArchiMate 2.1 Model Exchange XSDs
|
7
|
+
class XmlPropertyDefs
|
8
|
+
def initialize(property_defs)
|
9
|
+
@property_definitions = property_defs
|
10
|
+
end
|
11
|
+
|
12
|
+
def serialize(xml)
|
13
|
+
return if @property_definitions.empty?
|
14
|
+
xml.propertydefs do
|
15
|
+
@property_definitions.each do |property_def|
|
16
|
+
xml.propertydef(
|
17
|
+
"identifier" => property_def.id,
|
18
|
+
"name" => property_def.name,
|
19
|
+
"type" => property_def.value_type
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|