archimate 1.2.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +47 -0
- data/TODOs.org +219 -0
- data/archimate.gemspec +2 -1
- data/exe/archidiff +7 -0
- data/exe/archidiff-summary +7 -0
- data/exe/archimerge +7 -0
- data/exe/fmtxml +7 -0
- data/lib/archimate.rb +10 -21
- data/lib/archimate/cli/archi.rb +2 -1
- data/lib/archimate/cli/cleanup.rb +8 -9
- data/lib/archimate/cli/convert.rb +3 -1
- data/lib/archimate/cli/mapper.rb +1 -1
- data/lib/archimate/cli/stats.rb +1 -1
- data/lib/archimate/config.rb +4 -1
- data/lib/archimate/data_model.rb +11 -24
- data/lib/archimate/data_model/any_attribute.rb +18 -5
- data/lib/archimate/data_model/any_element.rb +30 -7
- data/lib/archimate/data_model/bounds.rb +34 -7
- data/lib/archimate/data_model/color.rb +32 -7
- data/lib/archimate/data_model/comparison.rb +87 -0
- data/lib/archimate/data_model/concern.rb +20 -7
- data/lib/archimate/data_model/connection.rb +71 -51
- data/lib/archimate/data_model/connector_type.rb +23 -0
- data/lib/archimate/data_model/diagram.rb +72 -10
- data/lib/archimate/data_model/diagram_type.rb +17 -0
- data/lib/archimate/data_model/differentiable.rb +142 -0
- data/lib/archimate/data_model/element.rb +39 -45
- data/lib/archimate/data_model/element_type.rb +89 -0
- data/lib/archimate/data_model/font.rb +30 -12
- data/lib/archimate/data_model/lang_string.rb +89 -16
- data/lib/archimate/data_model/layer.rb +55 -0
- data/lib/archimate/data_model/layers.rb +62 -0
- data/lib/archimate/data_model/location.rb +27 -11
- data/lib/archimate/data_model/metadata.rb +10 -3
- data/lib/archimate/data_model/model.rb +188 -121
- data/lib/archimate/data_model/modeling_note.rb +14 -3
- data/lib/archimate/data_model/organization.rb +44 -13
- data/lib/archimate/data_model/{documentation.rb → preserved_lang_string.rb} +1 -5
- data/lib/archimate/data_model/property.rb +17 -11
- data/lib/archimate/data_model/property_definition.rb +34 -4
- data/lib/archimate/data_model/referenceable.rb +0 -9
- data/lib/archimate/data_model/referenceable_collection.rb +201 -0
- data/lib/archimate/data_model/relationship.rb +52 -33
- data/lib/archimate/data_model/relationship_type.rb +43 -0
- data/lib/archimate/data_model/schema_info.rb +17 -6
- data/lib/archimate/data_model/style.rb +41 -11
- data/lib/archimate/data_model/view_node.rb +153 -59
- data/lib/archimate/data_model/viewpoint.rb +56 -80
- data/lib/archimate/data_model/viewpoint_type.rb +429 -0
- data/lib/archimate/export/csv_export.rb +2 -2
- data/lib/archimate/export/cypher.rb +2 -2
- data/lib/archimate/export/graph_ml.rb +7 -5
- data/lib/archimate/export/jsonl.rb +166 -0
- data/lib/archimate/export/n_quads.rb +8 -5
- data/lib/archimate/file_format.rb +4 -5
- data/lib/archimate/file_formats/archi_file_reader.rb +7 -240
- data/lib/archimate/file_formats/archi_file_writer.rb +16 -188
- data/lib/archimate/file_formats/model_exchange_file_reader.rb +7 -225
- data/lib/archimate/file_formats/model_exchange_file_writer_21.rb +22 -114
- data/lib/archimate/file_formats/model_exchange_file_writer_30.rb +22 -122
- data/lib/archimate/file_formats/sax.rb +55 -0
- data/lib/archimate/file_formats/sax/any_element.rb +64 -0
- data/lib/archimate/file_formats/sax/archi/archi_handler_factory.rb +48 -0
- data/lib/archimate/file_formats/sax/archi/bounds.rb +25 -0
- data/lib/archimate/file_formats/sax/archi/connection.rb +47 -0
- data/lib/archimate/file_formats/sax/archi/content.rb +28 -0
- data/lib/archimate/file_formats/sax/archi/diagram.rb +66 -0
- data/lib/archimate/file_formats/sax/archi/element.rb +36 -0
- data/lib/archimate/file_formats/sax/archi/location.rb +25 -0
- data/lib/archimate/file_formats/sax/archi/model.rb +109 -0
- data/lib/archimate/file_formats/sax/archi/organization.rb +60 -0
- data/lib/archimate/file_formats/sax/archi/property.rb +54 -0
- data/lib/archimate/file_formats/sax/archi/relationship.rb +50 -0
- data/lib/archimate/file_formats/sax/archi/style.rb +35 -0
- data/lib/archimate/file_formats/sax/archi/view_node.rb +76 -0
- data/lib/archimate/file_formats/sax/capture_content.rb +20 -0
- data/lib/archimate/file_formats/sax/capture_documentation.rb +19 -0
- data/lib/archimate/file_formats/sax/capture_properties.rb +20 -0
- data/lib/archimate/file_formats/sax/content_element.rb +19 -0
- data/lib/archimate/file_formats/sax/document.rb +80 -0
- data/lib/archimate/file_formats/sax/handler.rb +54 -0
- data/lib/archimate/file_formats/sax/lang_string.rb +28 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/color.rb +36 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/connection.rb +67 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/diagram.rb +60 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/element.rb +43 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/font.rb +44 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/item.rb +64 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/location.rb +23 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/metadata.rb +66 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/model.rb +124 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/model_exchange_handler_factory.rb +53 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/property.rb +32 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/property_definition.rb +36 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/relationship.rb +49 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/schema_info.rb +47 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/style.rb +66 -0
- data/lib/archimate/file_formats/sax/model_exchange_file/view_node.rb +86 -0
- data/lib/archimate/file_formats/sax/no_op.rb +17 -0
- data/lib/archimate/file_formats/sax/preserved_lang_string.rb +28 -0
- data/lib/archimate/file_formats/serializer.rb +57 -0
- data/lib/archimate/file_formats/serializer/archi/bounds.rb +23 -0
- data/lib/archimate/file_formats/serializer/archi/connection.rb +33 -0
- data/lib/archimate/file_formats/serializer/archi/diagram.rb +28 -0
- data/lib/archimate/file_formats/serializer/archi/documentation.rb +16 -0
- data/lib/archimate/file_formats/serializer/archi/element.rb +24 -0
- data/lib/archimate/file_formats/serializer/archi/location.rb +26 -0
- data/lib/archimate/file_formats/serializer/archi/model.rb +25 -0
- data/lib/archimate/file_formats/serializer/archi/organization.rb +21 -0
- data/lib/archimate/file_formats/serializer/archi/property.rb +15 -0
- data/lib/archimate/file_formats/serializer/archi/relationship.rb +36 -0
- data/lib/archimate/file_formats/serializer/archi/view_node.rb +52 -0
- data/lib/archimate/file_formats/serializer/archi/viewpoint_type.rb +45 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/element.rb +25 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/location.rb +15 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/model_exchange_file_writer.rb +32 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/organization.rb +23 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/properties.rb +15 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/relationship.rb +19 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/style.rb +48 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/connection.rb +25 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/diagram.rb +27 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/item.rb +17 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/label.rb +17 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/model.rb +36 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/organization_body.rb +25 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/property.rb +19 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v21/view_node.rb +44 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/connection.rb +26 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/diagram.rb +27 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/item.rb +17 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/label.rb +17 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/model.rb +41 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/organization_body.rb +25 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/property.rb +19 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/property_definitions.rb +34 -0
- data/lib/archimate/file_formats/serializer/model_exchange_file/v30/view_node.rb +45 -0
- data/lib/archimate/file_formats/serializer/named_collection.rb +21 -0
- data/lib/archimate/file_formats/serializer/writer.rb +56 -0
- data/lib/archimate/file_formats/serializer/xml_lang_string.rb +30 -0
- data/lib/archimate/file_formats/serializer/xml_metadata.rb +64 -0
- data/lib/archimate/file_formats/{model_exchange_file → serializer}/xml_property_defs.rb +2 -2
- data/lib/archimate/lint/duplicate_entities.rb +3 -3
- data/lib/archimate/lint/linter.rb +24 -29
- data/lib/archimate/svg/connection.rb +13 -103
- data/lib/archimate/svg/diagram.rb +1 -1
- data/lib/archimate/svg/entity/base_entity.rb +12 -8
- data/lib/archimate/svg/entity/data_entity.rb +2 -2
- data/lib/archimate/svg/entity/diagram_model_reference.rb +1 -1
- data/lib/archimate/svg/entity/event_entity.rb +2 -2
- data/lib/archimate/svg/entity/gap.rb +1 -1
- data/lib/archimate/svg/entity/group.rb +1 -1
- data/lib/archimate/svg/entity/motivation_entity.rb +1 -1
- data/lib/archimate/svg/entity/node.rb +1 -1
- data/lib/archimate/svg/entity/rect_entity.rb +1 -1
- data/lib/archimate/svg/entity/rounded_rect_entity.rb +1 -1
- data/lib/archimate/svg/entity/service_entity.rb +2 -2
- data/lib/archimate/svg/entity/value.rb +2 -2
- data/lib/archimate/svg/path.rb +153 -0
- data/lib/archimate/svg/point.rb +8 -1
- data/lib/archimate/version.rb +1 -1
- metadata +118 -36
- data/lib/archimate/data_model/archimate_node.rb +0 -181
- data/lib/archimate/data_model/concept.rb +0 -14
- data/lib/archimate/data_model/constants.rb +0 -82
- data/lib/archimate/data_model/container.rb +0 -17
- data/lib/archimate/data_model/diffable_array.rb +0 -213
- data/lib/archimate/data_model/diffable_primitive.rb +0 -83
- data/lib/archimate/data_model/label.rb +0 -19
- data/lib/archimate/data_model/named_referenceable.rb +0 -14
- data/lib/archimate/data_model/view.rb +0 -12
- data/lib/archimate/data_model/view_concept.rb +0 -18
- data/lib/archimate/file_formats/archi_file_format.rb +0 -151
- data/lib/archimate/file_formats/archimate_v2.rb +0 -461
- data/lib/archimate/file_formats/model_exchange_file/xml_lang_string.rb +0 -35
- data/lib/archimate/file_formats/model_exchange_file/xml_metadata.rb +0 -115
- data/lib/archimate/file_formats/model_exchange_file/xml_property_definitions.rb +0 -28
- data/lib/archimate/file_formats/model_exchange_file_reader_21.rb +0 -73
- data/lib/archimate/file_formats/model_exchange_file_reader_30.rb +0 -134
- data/lib/archimate/file_formats/model_exchange_file_writer.rb +0 -157
- data/lib/archimate/file_formats/writer.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b8d5f63a78b5e98d3791d8d58ea7474ad874325
|
4
|
+
data.tar.gz: 3cfc66538c6cbaf0792e96ca208712deff1ea194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe459d02990c355cd440e1460ec8bfac1019a6c3984918d4ee5ea53e9cb8709fd16bcfdf3f29ea3de5b7dbfaca01459143ec6de1294a9d402137e59fafcef1f2
|
7
|
+
data.tar.gz: 1d91a6c7e3cf0f0e0d7aaba0ba1068f0b74c5d08eca30d9e7541e5f15c066b237552eaab001bfa0cc6510459b07d754036bdd18825016213cd55ceca331d10d9
|
data/README.md
CHANGED
@@ -32,10 +32,57 @@ command | description
|
|
32
32
|
`archimate convert ARCHIFILE` | Convert the incoming file to the desired type
|
33
33
|
`archimate dedupe ARCHIFILE` | de-duplicate elements in Archi file
|
34
34
|
`archimate map ARCHIFILE` | *EXPERIMENTAL:* Produce a map of diagram links to a diagram
|
35
|
+
`archimate merge ARCHIFILE1 ARCHIFILE2` | *EXPERIMENTAL:*Merge two archimate files
|
35
36
|
`archimate project ARCHIFILE PROJECTFILE` | *EXPERIMENTAL:*Synchronize an Archi file and an MSProject XML file
|
36
37
|
`archimate svg ARCHIFILE` | Produce semantically meaningful SVG files from an Archi file
|
37
38
|
`archimate lint ARCHIFILE` | Produce a report of warnings and issues in the Archi file
|
38
39
|
|
40
|
+
### archidiff & archimerge
|
41
|
+
|
42
|
+
Archidiff is a set of tools to help with versioning an `.archimate` file from Archi in a version control system (like git). Eventually I want to provide diff and (3-way) merge tools that understand how *Archi* files are structured and avoid problems that happen when multiple people collaborate on a model.
|
43
|
+
|
44
|
+
To enable using these from the command line git, add these lines to your `~/.gitconfig` replacing `{PATH_TO_ARCHIDIFF}` with the path to the archidiff binaries.
|
45
|
+
|
46
|
+
```
|
47
|
+
[difftool "archidiff"]
|
48
|
+
cmd = {PATH_TO_ARCHIDIFF}/archidiff $LOCAL $REMOTE
|
49
|
+
|
50
|
+
[difftool "archidiff-summary"]
|
51
|
+
cmd = {PATH_TO_ARCHIDIFF}/archidiff-summary $LOCAL $REMOTE
|
52
|
+
|
53
|
+
[mergetool "archimerge"]
|
54
|
+
cmd = {PATH_TO_ARCHIDIFF}/archimerge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED
|
55
|
+
trustExitCode = false
|
56
|
+
```
|
57
|
+
|
58
|
+
Then to use the tool for diffing you can do this:
|
59
|
+
|
60
|
+
```sh
|
61
|
+
git difftool --tool archidiff 833cbb7 HEAD -- path_to/my.archimate
|
62
|
+
```
|
63
|
+
|
64
|
+
or to see a summary of what changed between versions:
|
65
|
+
|
66
|
+
```sh
|
67
|
+
git difftool --tool archidiff-summary 833cbb7 HEAD -- path_to/my.archimate
|
68
|
+
```
|
69
|
+
|
70
|
+
Finally, if you have a merge conflict, you can use archimerge to help make the merge sane:
|
71
|
+
|
72
|
+
```sh
|
73
|
+
git mergetool --tool archimerge -- path_to/my.archimate
|
74
|
+
```
|
75
|
+
|
76
|
+
### fmtxml
|
77
|
+
|
78
|
+
Can be used as a `textconv` filter in .gitconfig to pre-format files for better diff use (for visual scanning). You'd set this up in your `$HOME/.gitconfig` file like this.
|
79
|
+
|
80
|
+
```
|
81
|
+
[diff "archimate"]
|
82
|
+
textconv = fmtxml
|
83
|
+
cachetextconv = true
|
84
|
+
```
|
85
|
+
|
39
86
|
## Development
|
40
87
|
|
41
88
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/TODOs.org
CHANGED
@@ -284,3 +284,222 @@ effective_entity : (child -> element_name_type)
|
|
284
284
|
get effective entity
|
285
285
|
|
286
286
|
that's used to match the rest:
|
287
|
+
|
288
|
+
Intermittent Failure with test --seed 11297
|
289
|
+
|
290
|
+
---
|
291
|
+
|
292
|
+
Remove Id references in preference to object references
|
293
|
+
|
294
|
+
Done:
|
295
|
+
|
296
|
+
Property (PropertyDefinitionId)
|
297
|
+
|
298
|
+
TODO:
|
299
|
+
|
300
|
+
Relationship (Source & Target)
|
301
|
+
View (Viewpoint)
|
302
|
+
|
303
|
+
Connection (For Source & Targets)
|
304
|
+
Label (Not Currently Used)
|
305
|
+
ViewConcept (View {Concept} list)
|
306
|
+
ViewNode (model, targetConnections, archimateNode)
|
307
|
+
|
308
|
+
---
|
309
|
+
|
310
|
+
Part of Better Diff/Merge redux
|
311
|
+
|
312
|
+
What about the path? Need a way to describe diffs & conflicts back to meaningful user world terms. (not id oriented)
|
313
|
+
|
314
|
+
Eliminate the use of DiffableArray by making a class for collections
|
315
|
+
Eliminate the use of Diffable Primitive with a smarter context diff
|
316
|
+
|
317
|
+
Referenceable Object Instance Classes
|
318
|
+
|
319
|
+
Archimate::DataModel::Model < Archimate::DataModel::NamedReferenceable
|
320
|
+
Archimate::DataModel::PropertyDefinition < Archimate::DataModel::NamedReferenceable,
|
321
|
+
Archimate::DataModel::Element < Archimate::DataModel::Concept,
|
322
|
+
Archimate::DataModel::Relationship < Archimate::DataModel::Concept,
|
323
|
+
Archimate::DataModel::Diagram < Archimate::DataModel::View,
|
324
|
+
Archimate::DataModel::ViewNode < Archimate::DataModel::Referenceable,
|
325
|
+
Archimate::DataModel::Connection < Archimate::DataModel::Referenceable,
|
326
|
+
|
327
|
+
What are the non-referenceable things that might be included by a less automated diff?
|
328
|
+
|
329
|
+
Model
|
330
|
+
(from Referenceable)
|
331
|
+
id
|
332
|
+
name
|
333
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
334
|
+
type: String - TODO: need to handle US/UK spelling differences and naming differences between Archi/ArchiMate2.1/ArchiMate3
|
335
|
+
properties
|
336
|
+
metadata
|
337
|
+
elements
|
338
|
+
relationships
|
339
|
+
organizations
|
340
|
+
property_definitions
|
341
|
+
version
|
342
|
+
diagrams
|
343
|
+
viewpoints
|
344
|
+
filename
|
345
|
+
file_format
|
346
|
+
archimate_version
|
347
|
+
namespaces
|
348
|
+
schema_locations
|
349
|
+
|
350
|
+
PropertyDefinition
|
351
|
+
(from Referenceable)
|
352
|
+
id
|
353
|
+
name
|
354
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
355
|
+
type: String
|
356
|
+
(from PropertyDefinition)
|
357
|
+
value_type (DataType)
|
358
|
+
|
359
|
+
Element
|
360
|
+
(from Referenceable)
|
361
|
+
id
|
362
|
+
name
|
363
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
364
|
+
type: String
|
365
|
+
properties (from Concept)
|
366
|
+
|
367
|
+
Relationship
|
368
|
+
(from Referenceable)
|
369
|
+
id
|
370
|
+
name
|
371
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
372
|
+
type: String
|
373
|
+
source
|
374
|
+
target
|
375
|
+
access_type
|
376
|
+
|
377
|
+
Diagram
|
378
|
+
(from Referenceable)
|
379
|
+
id
|
380
|
+
name
|
381
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
382
|
+
type: String
|
383
|
+
(from View)
|
384
|
+
properties
|
385
|
+
viewpoint_type
|
386
|
+
viewpoint
|
387
|
+
(from Diagram)
|
388
|
+
nodes (ViewNode collection)
|
389
|
+
connection_router_type (int - enum, Archi only)
|
390
|
+
background (int Archi only)
|
391
|
+
connections (Connection Collection)
|
392
|
+
|
393
|
+
ViewNode
|
394
|
+
(from Referenceable)
|
395
|
+
id
|
396
|
+
name
|
397
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
398
|
+
type: String
|
399
|
+
model: (identifier - what is this? Archi Only)
|
400
|
+
content: string
|
401
|
+
target_connections: (Archi only, identifiers, collection of ids of targets, TODO, probably not needed)
|
402
|
+
archimate_element (Element)
|
403
|
+
bounds
|
404
|
+
nodes: (ViewNode collection)
|
405
|
+
connections (Connection collection)
|
406
|
+
style
|
407
|
+
type
|
408
|
+
child_type: (TODO: int this selects the shape of the object)
|
409
|
+
properties
|
410
|
+
|
411
|
+
There are some sub-classes here that might be valuable to implement?
|
412
|
+
Connection
|
413
|
+
(from Referenceable)
|
414
|
+
id
|
415
|
+
name
|
416
|
+
documentation: Array of LangString - really should be a LangString type (I believe)
|
417
|
+
type: String
|
418
|
+
source_attachment (Location)
|
419
|
+
bendpoints
|
420
|
+
target_attachment (Location)
|
421
|
+
source
|
422
|
+
target
|
423
|
+
relationship
|
424
|
+
style
|
425
|
+
properties
|
426
|
+
|
427
|
+
What about Organizations - they are horrifically defined in ArchiMate 3. Need an internal model that isn't so insane and is diffable/mergable.
|
428
|
+
|
429
|
+
---
|
430
|
+
|
431
|
+
Diff implementation
|
432
|
+
|
433
|
+
The refinements implementation is hokey. A lot of code and makes thing fragile.
|
434
|
+
|
435
|
+
Diff calculation
|
436
|
+
|
437
|
+
In most collections (except ones under diagram), the order of items doesn't matter - except it helps make textual diffs of models smaller.
|
438
|
+
|
439
|
+
insert and delete are probably only useful for collections
|
440
|
+
|
441
|
+
change is typical
|
442
|
+
|
443
|
+
how would move be implemented (i.e. move between collections)
|
444
|
+
What's the best data structure for collections to make diffs and merges easier? Diff lcs?
|
445
|
+
|
446
|
+
validation on demand rather than at creation of data model in absence of dry-struct? Switchable by global setting?
|
447
|
+
|
448
|
+
How would we add archimate modules (new concept)? privacy? Timeline? Transitional architectures?
|
449
|
+
|
450
|
+
---
|
451
|
+
|
452
|
+
Diff
|
453
|
+
|
454
|
+
- [ ] User friendly text description
|
455
|
+
- [ ] User friendly description includes location information in the model (I.e diagram it's located in, elements describing relationship, and so on)
|
456
|
+
- [ ] Diffs can be compared to see if they are in conflict
|
457
|
+
- [ ] Diff can be applied to a model to patch model
|
458
|
+
|
459
|
+
* TODO Eliminate Documentation class - it's a LangString
|
460
|
+
* TODO Make LangString be like a Hash with lang as key and string as value
|
461
|
+
* TODO Make LangString use a default lang (stored in Archimate module)
|
462
|
+
|
463
|
+
---
|
464
|
+
|
465
|
+
Strict::Array.member(AnyAttribute).default([])
|
466
|
+
Strict::Array.member(AnyElement).default([])
|
467
|
+
Strict::Array.member(Concern).default([])
|
468
|
+
Strict::Array.member(Connection).default([])
|
469
|
+
Strict::Array.member(Diagram).default([])
|
470
|
+
Strict::Array.member(Element).default([])
|
471
|
+
Strict::Array.member(ElementType).default([])
|
472
|
+
Strict::Array.member(LangString)
|
473
|
+
Strict::Array.member(Location).default([])
|
474
|
+
Strict::Array.member(ModelingNote).default([])
|
475
|
+
Strict::Array.member(Organization).default([])
|
476
|
+
Strict::Array.member(Property).default([])
|
477
|
+
Strict::Array.member(PropertyDefinition).default([])
|
478
|
+
Strict::Array.member(Referenceable).default([])
|
479
|
+
Strict::Array.member(Relationship).default([])
|
480
|
+
Strict::Array.member(RelationshipType).default([])
|
481
|
+
Strict::Array.member(SchemaInfo).default([])
|
482
|
+
Strict::Array.member(Strict::String).default([])
|
483
|
+
Strict::Array.member(ViewNode).default([])
|
484
|
+
Strict::Array.member(Viewpoint).default([])
|
485
|
+
Strict::Array.member(ViewpointContentEnum).default([])
|
486
|
+
Strict::Array.member(ViewpointPurposeEnum).default([])
|
487
|
+
|
488
|
+
---
|
489
|
+
|
490
|
+
Use locale for LangString
|
491
|
+
IRB::Locale.new.lang
|
492
|
+
|
493
|
+
---
|
494
|
+
|
495
|
+
referenced_identified_nodes
|
496
|
+
Model->
|
497
|
+
|
498
|
+
Diagram
|
499
|
+
ViewNode
|
500
|
+
Container
|
501
|
+
Connection
|
502
|
+
Element (Property->PropertyDefinition)
|
503
|
+
Organization
|
504
|
+
Relationship
|
505
|
+
|
data/archimate.gemspec
CHANGED
@@ -21,12 +21,13 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.metadata["yard.run"] = "yri" # use "yard" to build full HTML docs.
|
22
22
|
spec.required_ruby_version = '>= 2.3.0'
|
23
23
|
|
24
|
-
spec.add_runtime_dependency "dry-struct", "~> 0.3.0"
|
25
24
|
spec.add_runtime_dependency "nokogiri", "~> 1.6"
|
26
25
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
27
26
|
spec.add_runtime_dependency "highline", "~> 1.7"
|
28
27
|
spec.add_runtime_dependency "ruby-progressbar", "~>1.8.1"
|
29
28
|
spec.add_runtime_dependency "parallel", "~> 1.11"
|
29
|
+
spec.add_runtime_dependency "ruby-enum", "~> 0.7.1"
|
30
|
+
# spec.add_runtime_dependency "diff-lcs", "~> 1.3"
|
30
31
|
|
31
32
|
spec.add_development_dependency "bundler"
|
32
33
|
spec.add_development_dependency "rake"
|
data/exe/archidiff
ADDED
data/exe/archimerge
ADDED
data/exe/fmtxml
ADDED
data/lib/archimate.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry-types"
|
4
|
-
require "dry-struct"
|
5
|
-
|
6
3
|
module Archimate
|
4
|
+
# Support Archimate file format versions
|
7
5
|
SUPPORTED_FORMATS = %i[
|
8
6
|
archi_3
|
9
7
|
archi_4
|
@@ -11,6 +9,7 @@ module Archimate
|
|
11
9
|
archimate_3_0
|
12
10
|
].freeze
|
13
11
|
|
12
|
+
# Archimate modeling specification version
|
14
13
|
ARCHIMATE_VERSIONS = %i[
|
15
14
|
archimate_2_1
|
16
15
|
archimate_3_0
|
@@ -32,27 +31,18 @@ module Archimate
|
|
32
31
|
autoload :GraphML, 'archimate/export/graph_ml'
|
33
32
|
autoload :CSVExport, 'archimate/export/csv_export'
|
34
33
|
autoload :Cypher, 'archimate/export/cypher'
|
34
|
+
autoload :Jsonl, 'archimate/export/jsonl'
|
35
35
|
end
|
36
36
|
|
37
37
|
module FileFormats
|
38
|
-
autoload :ArchimateV2, 'archimate/file_formats/archimate_v2'
|
39
38
|
autoload :ArchiFileFormat, 'archimate/file_formats/archi_file_format'
|
40
39
|
autoload :ArchiFileReader, 'archimate/file_formats/archi_file_reader'
|
41
40
|
autoload :ArchiFileWriter, 'archimate/file_formats/archi_file_writer'
|
42
|
-
autoload :ModelExchangeFileFormat, 'archimate/file_formats/model_exchange_file_format'
|
43
41
|
autoload :ModelExchangeFileReader, 'archimate/file_formats/model_exchange_file_reader'
|
44
|
-
autoload :ModelExchangeFileReader21, 'archimate/file_formats/model_exchange_file_reader_21'
|
45
|
-
autoload :ModelExchangeFileReader30, 'archimate/file_formats/model_exchange_file_reader_30'
|
46
|
-
autoload :ModelExchangeFileWriter, 'archimate/file_formats/model_exchange_file_writer'
|
47
42
|
autoload :ModelExchangeFileWriter21, 'archimate/file_formats/model_exchange_file_writer_21'
|
48
43
|
autoload :ModelExchangeFileWriter30, 'archimate/file_formats/model_exchange_file_writer_30'
|
49
|
-
autoload :
|
50
|
-
|
51
|
-
autoload :XmlLangString, 'archimate/file_formats/model_exchange_file/xml_lang_string'
|
52
|
-
autoload :XmlMetadata, 'archimate/file_formats/model_exchange_file/xml_metadata'
|
53
|
-
autoload :XmlPropertyDefinitions, 'archimate/file_formats/model_exchange_file/xml_property_definitions'
|
54
|
-
autoload :XmlPropertyDefs, 'archimate/file_formats/model_exchange_file/xml_property_defs'
|
55
|
-
end
|
44
|
+
autoload :Sax, 'archimate/file_formats/sax'
|
45
|
+
autoload :Serializer, 'archimate/file_formats/serializer'
|
56
46
|
end
|
57
47
|
|
58
48
|
module Lint
|
@@ -68,6 +58,7 @@ module Archimate
|
|
68
58
|
autoload :Entity, 'archimate/svg/entity'
|
69
59
|
autoload :EntityFactory, 'archimate/svg/entity_factory'
|
70
60
|
autoload :Extents, 'archimate/svg/extents'
|
61
|
+
autoload :Path, 'archimate/svg/path'
|
71
62
|
autoload :Point, 'archimate/svg/point'
|
72
63
|
autoload :SvgTemplate, 'archimate/svg/svg_template'
|
73
64
|
end
|
@@ -87,17 +78,15 @@ module Archimate
|
|
87
78
|
# @param filename File name of the file to read
|
88
79
|
# @return Archimate::DataModel::Model of ArchiMate model in the file
|
89
80
|
def self.read(filename)
|
81
|
+
raise "#{filename.inspect} not found" unless File.exist?(filename)
|
90
82
|
FileFormat.read(filename)
|
91
83
|
end
|
92
84
|
|
93
85
|
# Reads the given file and returns the Archimate model
|
94
86
|
#
|
95
|
-
# @param
|
87
|
+
# @param str XML string containing the Archimate model
|
96
88
|
# @return Archimate::DataModel::Model of ArchiMate model in the file
|
97
|
-
def self.parse(
|
98
|
-
FileFormat.parse(
|
89
|
+
def self.parse(str)
|
90
|
+
FileFormat.parse(str)
|
99
91
|
end
|
100
|
-
|
101
|
-
using DataModel::DiffablePrimitive
|
102
|
-
using DataModel::DiffableArray
|
103
92
|
end
|
data/lib/archimate/cli/archi.rb
CHANGED
@@ -8,7 +8,8 @@ module Archimate
|
|
8
8
|
if output_io.is_a?(String)
|
9
9
|
if !force && File.exist?(output_io)
|
10
10
|
# TODO: This needs to be handled with more grace
|
11
|
-
|
11
|
+
cli = HighLine.new
|
12
|
+
return nil unless cli.agree("File #{output_io} exists. Overwrite?")
|
12
13
|
end
|
13
14
|
output_io = File.open(output_io, "w")
|
14
15
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require "nokogiri"
|
3
|
+
|
2
4
|
#
|
3
5
|
# The point of this script is to identify elements that aren't a part of any
|
4
6
|
# relationship and not referenced on any diagrams.
|
@@ -23,16 +25,13 @@ module Archimate
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def remove_unreferenced_nodes
|
26
|
-
model.unreferenced_nodes.each do |
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
model.unreferenced_nodes.each do |unreferenced_node|
|
29
|
+
raise "This functionality is not implemeted yet"
|
30
|
+
|
31
|
+
# TODO: this needs to be the XML serialization of the node
|
30
32
|
trash.root.add_child unreferenced_node.dup
|
31
|
-
|
32
|
-
|
33
|
-
ns << prev_sib
|
34
|
-
end
|
35
|
-
ns.remove
|
33
|
+
# TODO: implement this
|
34
|
+
# model.delete(unreferenced_node)
|
36
35
|
@progressbar.increment
|
37
36
|
end
|
38
37
|
end
|