xmi 0.3.17 → 0.3.19
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.
- checksums.yaml +4 -4
- data/lib/xmi/add.rb +27 -3
- data/lib/xmi/delete.rb +27 -3
- data/lib/xmi/difference.rb +27 -3
- data/lib/xmi/documentation.rb +95 -9
- data/lib/xmi/ea_root.rb +5 -1
- data/lib/xmi/replace.rb +27 -3
- data/lib/xmi/root.rb +157 -13
- data/lib/xmi/sparx.rb +351 -33
- data/lib/xmi/uml.rb +270 -26
- data/lib/xmi/version.rb +1 -1
- metadata +2 -2
data/lib/xmi/sparx.rb
CHANGED
@@ -129,7 +129,19 @@ module Xmi
|
|
129
129
|
|
130
130
|
xml do
|
131
131
|
root "tags"
|
132
|
-
map_element "tag", to: :tags, namespace: nil, prefix: nil
|
132
|
+
map_element "tag", to: :tags, namespace: nil, prefix: nil,
|
133
|
+
value_map: {
|
134
|
+
from: {
|
135
|
+
nil: :empty,
|
136
|
+
empty: :empty,
|
137
|
+
omitted: :empty
|
138
|
+
},
|
139
|
+
to: {
|
140
|
+
nil: :empty,
|
141
|
+
empty: :empty,
|
142
|
+
omitted: :empty
|
143
|
+
}
|
144
|
+
}
|
133
145
|
end
|
134
146
|
end
|
135
147
|
|
@@ -344,7 +356,7 @@ module Xmi
|
|
344
356
|
attribute :styleex, SparxElementStyleex
|
345
357
|
attribute :xrefs, SparxElementXrefs
|
346
358
|
|
347
|
-
xml do
|
359
|
+
xml do # rubocop:disable Metrics/BlockLength
|
348
360
|
root "attribute"
|
349
361
|
|
350
362
|
map_attribute "idref", to: :idref, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
|
@@ -354,8 +366,21 @@ module Xmi
|
|
354
366
|
map_element "initial", to: :initial, namespace: nil, prefix: nil
|
355
367
|
map_element "options", to: :options, namespace: nil, prefix: nil
|
356
368
|
map_element "style", to: :style, namespace: nil, prefix: nil
|
357
|
-
map_element "tags", to: :tags, namespace: nil, prefix: nil
|
358
|
-
|
369
|
+
map_element "tags", to: :tags, namespace: nil, prefix: nil,
|
370
|
+
value_map: {
|
371
|
+
from: {
|
372
|
+
nil: :empty,
|
373
|
+
empty: :empty,
|
374
|
+
omitted: :empty
|
375
|
+
},
|
376
|
+
to: {
|
377
|
+
nil: :empty,
|
378
|
+
empty: :empty,
|
379
|
+
omitted: :empty
|
380
|
+
}
|
381
|
+
}
|
382
|
+
map_element "documentation", to: :documentation, namespace: nil,
|
383
|
+
prefix: nil
|
359
384
|
map_element "model", to: :model, namespace: nil, prefix: nil
|
360
385
|
map_element "properties", to: :properties, namespace: nil, prefix: nil
|
361
386
|
map_element "coords", to: :coords, namespace: nil, prefix: nil
|
@@ -373,7 +398,19 @@ module Xmi
|
|
373
398
|
xml do
|
374
399
|
root "attributes"
|
375
400
|
|
376
|
-
map_element "attribute", to: :attribute, namespace: nil, prefix: nil
|
401
|
+
map_element "attribute", to: :attribute, namespace: nil, prefix: nil,
|
402
|
+
value_map: {
|
403
|
+
from: {
|
404
|
+
nil: :empty,
|
405
|
+
empty: :empty,
|
406
|
+
omitted: :empty
|
407
|
+
},
|
408
|
+
to: {
|
409
|
+
nil: :empty,
|
410
|
+
empty: :empty,
|
411
|
+
omitted: :empty
|
412
|
+
}
|
413
|
+
}
|
377
414
|
end
|
378
415
|
end
|
379
416
|
|
@@ -382,12 +419,50 @@ module Xmi
|
|
382
419
|
attribute :generalization, SparxElementGeneralization, collection: true
|
383
420
|
attribute :note_link, SparxElementNoteLink, collection: true
|
384
421
|
|
385
|
-
xml do
|
422
|
+
xml do # rubocop:disable Metrics/BlockLength
|
386
423
|
root "links"
|
387
424
|
|
388
|
-
map_element "Association", to: :association, namespace: nil,
|
389
|
-
|
390
|
-
|
425
|
+
map_element "Association", to: :association, namespace: nil,
|
426
|
+
prefix: nil,
|
427
|
+
value_map: {
|
428
|
+
from: {
|
429
|
+
nil: :empty,
|
430
|
+
empty: :empty,
|
431
|
+
omitted: :empty
|
432
|
+
},
|
433
|
+
to: {
|
434
|
+
nil: :empty,
|
435
|
+
empty: :empty,
|
436
|
+
omitted: :empty
|
437
|
+
}
|
438
|
+
}
|
439
|
+
map_element "Generalization", to: :generalization, namespace: nil,
|
440
|
+
prefix: nil,
|
441
|
+
value_map: {
|
442
|
+
from: {
|
443
|
+
nil: :empty,
|
444
|
+
empty: :empty,
|
445
|
+
omitted: :empty
|
446
|
+
},
|
447
|
+
to: {
|
448
|
+
nil: :empty,
|
449
|
+
empty: :empty,
|
450
|
+
omitted: :empty
|
451
|
+
}
|
452
|
+
}
|
453
|
+
map_element "NoteLink", to: :note_link, namespace: nil, prefix: nil,
|
454
|
+
value_map: {
|
455
|
+
from: {
|
456
|
+
nil: :empty,
|
457
|
+
empty: :empty,
|
458
|
+
omitted: :empty
|
459
|
+
},
|
460
|
+
to: {
|
461
|
+
nil: :empty,
|
462
|
+
empty: :empty,
|
463
|
+
omitted: :empty
|
464
|
+
}
|
465
|
+
}
|
391
466
|
end
|
392
467
|
end
|
393
468
|
|
@@ -442,7 +517,19 @@ module Xmi
|
|
442
517
|
xml do
|
443
518
|
root "elements"
|
444
519
|
|
445
|
-
map_element "element", to: :element, namespace: nil, prefix: nil
|
520
|
+
map_element "element", to: :element, namespace: nil, prefix: nil,
|
521
|
+
value_map: {
|
522
|
+
from: {
|
523
|
+
nil: :empty,
|
524
|
+
empty: :empty,
|
525
|
+
omitted: :empty
|
526
|
+
},
|
527
|
+
to: {
|
528
|
+
nil: :empty,
|
529
|
+
empty: :empty,
|
530
|
+
omitted: :empty
|
531
|
+
}
|
532
|
+
}
|
446
533
|
end
|
447
534
|
end
|
448
535
|
|
@@ -519,7 +606,19 @@ module Xmi
|
|
519
606
|
xml do
|
520
607
|
root "constraints"
|
521
608
|
|
522
|
-
map_element "constraint", to: :constraint, namespace: nil, prefix: nil
|
609
|
+
map_element "constraint", to: :constraint, namespace: nil, prefix: nil,
|
610
|
+
value_map: {
|
611
|
+
from: {
|
612
|
+
nil: :empty,
|
613
|
+
empty: :empty,
|
614
|
+
omitted: :empty
|
615
|
+
},
|
616
|
+
to: {
|
617
|
+
nil: :empty,
|
618
|
+
empty: :empty,
|
619
|
+
omitted: :empty
|
620
|
+
}
|
621
|
+
}
|
523
622
|
end
|
524
623
|
end
|
525
624
|
|
@@ -564,8 +663,20 @@ module Xmi
|
|
564
663
|
map_element "constraints", to: :constraints, render_nil: true, namespace: nil, prefix: nil
|
565
664
|
map_element "modifiers", to: :modifiers, render_nil: true, namespace: nil, prefix: nil
|
566
665
|
map_element "style", to: :style, render_nil: true, namespace: nil, prefix: nil
|
567
|
-
map_element "documentation", to: :documentation, namespace: nil,
|
568
|
-
|
666
|
+
map_element "documentation", to: :documentation, namespace: nil,
|
667
|
+
prefix: nil,
|
668
|
+
value_map: {
|
669
|
+
from: {
|
670
|
+
nil: :empty,
|
671
|
+
empty: :empty,
|
672
|
+
omitted: :empty
|
673
|
+
},
|
674
|
+
to: {
|
675
|
+
nil: :empty,
|
676
|
+
empty: :empty,
|
677
|
+
omitted: :empty
|
678
|
+
}
|
679
|
+
}
|
569
680
|
map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
|
570
681
|
map_element "tags", to: :tags, render_nil: true, namespace: nil, prefix: nil
|
571
682
|
end
|
@@ -585,7 +696,19 @@ module Xmi
|
|
585
696
|
map_element "constraints", to: :constraints, render_nil: true, namespace: nil, prefix: nil
|
586
697
|
map_element "modifiers", to: :modifiers, render_nil: true, namespace: nil, prefix: nil
|
587
698
|
map_element "style", to: :style, render_nil: true, namespace: nil, prefix: nil
|
588
|
-
map_element "documentation", to: :documentation, prefix: nil,
|
699
|
+
map_element "documentation", to: :documentation, prefix: nil,
|
700
|
+
value_map: {
|
701
|
+
from: {
|
702
|
+
nil: :empty,
|
703
|
+
empty: :empty,
|
704
|
+
omitted: :empty
|
705
|
+
},
|
706
|
+
to: {
|
707
|
+
nil: :empty,
|
708
|
+
empty: :empty,
|
709
|
+
omitted: :empty
|
710
|
+
}
|
711
|
+
}
|
589
712
|
map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
|
590
713
|
map_element "tags", to: :tags, render_nil: true, namespace: nil, prefix: nil
|
591
714
|
end
|
@@ -644,6 +767,7 @@ module Xmi
|
|
644
767
|
end
|
645
768
|
|
646
769
|
class SparxConnector < Lutaml::Model::Serializable
|
770
|
+
attribute :name, :string
|
647
771
|
attribute :idref, :string
|
648
772
|
attribute :source, SparxConnectorSource
|
649
773
|
attribute :target, SparxConnectorTarget
|
@@ -657,17 +781,30 @@ module Xmi
|
|
657
781
|
attribute :tags, SparxElementTags
|
658
782
|
attribute :xrefs, SparxElementXrefs
|
659
783
|
|
660
|
-
xml do
|
784
|
+
xml do # rubocop:disable Metrics/BlockLength
|
661
785
|
root "element"
|
662
786
|
|
787
|
+
map_attribute "name", to: :name
|
663
788
|
map_attribute "idref", to: :idref, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
|
664
789
|
|
665
790
|
map_element "source", to: :source, namespace: nil, prefix: nil
|
666
791
|
map_element "target", to: :target, namespace: nil, prefix: nil
|
667
792
|
map_element "model", to: :model, namespace: nil, prefix: nil
|
668
793
|
map_element "properties", to: :properties, namespace: nil, prefix: nil
|
669
|
-
map_element "documentation", to: :documentation, namespace: nil,
|
670
|
-
|
794
|
+
map_element "documentation", to: :documentation, namespace: nil,
|
795
|
+
prefix: nil,
|
796
|
+
value_map: {
|
797
|
+
from: {
|
798
|
+
nil: :empty,
|
799
|
+
empty: :empty,
|
800
|
+
omitted: :empty
|
801
|
+
},
|
802
|
+
to: {
|
803
|
+
nil: :empty,
|
804
|
+
empty: :empty,
|
805
|
+
omitted: :empty
|
806
|
+
}
|
807
|
+
}
|
671
808
|
map_element "appearance", to: :appearance, namespace: nil, prefix: nil
|
672
809
|
map_element "labels", to: :labels, render_nil: true, namespace: nil, prefix: nil
|
673
810
|
map_element "extendedProperties", to: :extended_properties, namespace: nil, prefix: nil
|
@@ -682,7 +819,19 @@ module Xmi
|
|
682
819
|
xml do
|
683
820
|
root "connectors"
|
684
821
|
|
685
|
-
map_element "connector", to: :connector, namespace: nil, prefix: nil
|
822
|
+
map_element "connector", to: :connector, namespace: nil, prefix: nil,
|
823
|
+
value_map: {
|
824
|
+
from: {
|
825
|
+
nil: :empty,
|
826
|
+
empty: :empty,
|
827
|
+
omitted: :empty
|
828
|
+
},
|
829
|
+
to: {
|
830
|
+
nil: :empty,
|
831
|
+
empty: :empty,
|
832
|
+
omitted: :empty
|
833
|
+
}
|
834
|
+
}
|
686
835
|
end
|
687
836
|
end
|
688
837
|
|
@@ -692,7 +841,20 @@ module Xmi
|
|
692
841
|
xml do
|
693
842
|
root "primitivetypes"
|
694
843
|
|
695
|
-
map_element "packagedElement", to: :packaged_element, namespace: nil,
|
844
|
+
map_element "packagedElement", to: :packaged_element, namespace: nil,
|
845
|
+
prefix: nil,
|
846
|
+
value_map: {
|
847
|
+
from: {
|
848
|
+
nil: :empty,
|
849
|
+
empty: :empty,
|
850
|
+
omitted: :empty
|
851
|
+
},
|
852
|
+
to: {
|
853
|
+
nil: :empty,
|
854
|
+
empty: :empty,
|
855
|
+
omitted: :empty
|
856
|
+
}
|
857
|
+
}
|
696
858
|
end
|
697
859
|
end
|
698
860
|
|
@@ -704,7 +866,19 @@ module Xmi
|
|
704
866
|
|
705
867
|
map_element "Profile", to: :profile,
|
706
868
|
namespace: "http://www.omg.org/spec/UML/20131001",
|
707
|
-
prefix: "uml"
|
869
|
+
prefix: "uml",
|
870
|
+
value_map: {
|
871
|
+
from: {
|
872
|
+
nil: :empty,
|
873
|
+
empty: :empty,
|
874
|
+
omitted: :empty
|
875
|
+
},
|
876
|
+
to: {
|
877
|
+
nil: :empty,
|
878
|
+
empty: :empty,
|
879
|
+
omitted: :empty
|
880
|
+
}
|
881
|
+
}
|
708
882
|
end
|
709
883
|
end
|
710
884
|
|
@@ -729,7 +903,19 @@ module Xmi
|
|
729
903
|
xml do
|
730
904
|
root "elements"
|
731
905
|
|
732
|
-
map_element "element", to: :element, namespace: nil, prefix: nil
|
906
|
+
map_element "element", to: :element, namespace: nil, prefix: nil,
|
907
|
+
value_map: {
|
908
|
+
from: {
|
909
|
+
nil: :empty,
|
910
|
+
empty: :empty,
|
911
|
+
omitted: :empty
|
912
|
+
},
|
913
|
+
to: {
|
914
|
+
nil: :empty,
|
915
|
+
empty: :empty,
|
916
|
+
omitted: :empty
|
917
|
+
}
|
918
|
+
}
|
733
919
|
end
|
734
920
|
end
|
735
921
|
|
@@ -792,7 +978,19 @@ module Xmi
|
|
792
978
|
xml do
|
793
979
|
root "diagrams"
|
794
980
|
|
795
|
-
map_element "diagram", to: :diagram, namespace: nil, prefix: nil
|
981
|
+
map_element "diagram", to: :diagram, namespace: nil, prefix: nil,
|
982
|
+
value_map: {
|
983
|
+
from: {
|
984
|
+
nil: :empty,
|
985
|
+
empty: :empty,
|
986
|
+
omitted: :empty
|
987
|
+
},
|
988
|
+
to: {
|
989
|
+
nil: :empty,
|
990
|
+
empty: :empty,
|
991
|
+
omitted: :empty
|
992
|
+
}
|
993
|
+
}
|
796
994
|
end
|
797
995
|
end
|
798
996
|
|
@@ -834,7 +1032,7 @@ module Xmi
|
|
834
1032
|
include SparxExtensionAttributes
|
835
1033
|
attribute :profiles, SparxProfiles
|
836
1034
|
|
837
|
-
xml do
|
1035
|
+
xml do # rubocop:disable Metrics/BlockLength
|
838
1036
|
root "Extension"
|
839
1037
|
|
840
1038
|
map_attribute "id", to: :id, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
|
@@ -851,7 +1049,19 @@ module Xmi
|
|
851
1049
|
map_element "primitivetypes", to: :primitive_types, namespace: nil, prefix: nil
|
852
1050
|
map_element "profiles", to: :profiles, namespace: nil, prefix: nil
|
853
1051
|
map_element "diagrams", to: :diagrams, namespace: nil, prefix: nil
|
854
|
-
map_element "EAStub", to: :ea_stub, namespace: nil, prefix: nil
|
1052
|
+
map_element "EAStub", to: :ea_stub, namespace: nil, prefix: nil,
|
1053
|
+
value_map: {
|
1054
|
+
from: {
|
1055
|
+
nil: :empty,
|
1056
|
+
empty: :empty,
|
1057
|
+
omitted: :empty
|
1058
|
+
},
|
1059
|
+
to: {
|
1060
|
+
nil: :empty,
|
1061
|
+
empty: :empty,
|
1062
|
+
omitted: :empty
|
1063
|
+
}
|
1064
|
+
}
|
855
1065
|
end
|
856
1066
|
end
|
857
1067
|
|
@@ -1023,31 +1233,139 @@ module Xmi
|
|
1023
1233
|
prefix: "SysPhS"
|
1024
1234
|
map_element "import", to: :eauml_import,
|
1025
1235
|
namespace: "http://www.sparxsystems.com/profiles/EAUML/1.0",
|
1026
|
-
prefix: "EAUML"
|
1236
|
+
prefix: "EAUML",
|
1237
|
+
value_map: {
|
1238
|
+
from: {
|
1239
|
+
nil: :empty,
|
1240
|
+
empty: :empty,
|
1241
|
+
omitted: :empty
|
1242
|
+
},
|
1243
|
+
to: {
|
1244
|
+
nil: :empty,
|
1245
|
+
empty: :empty,
|
1246
|
+
omitted: :empty
|
1247
|
+
}
|
1248
|
+
}
|
1027
1249
|
map_element "ApplicationSchema", to: :gml_application_schema,
|
1028
1250
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1029
|
-
prefix: "GML"
|
1251
|
+
prefix: "GML",
|
1252
|
+
value_map: {
|
1253
|
+
from: {
|
1254
|
+
nil: :empty,
|
1255
|
+
empty: :empty,
|
1256
|
+
omitted: :empty
|
1257
|
+
},
|
1258
|
+
to: {
|
1259
|
+
nil: :empty,
|
1260
|
+
empty: :empty,
|
1261
|
+
omitted: :empty
|
1262
|
+
}
|
1263
|
+
}
|
1030
1264
|
map_element "CodeList", to: :gml_code_list,
|
1031
1265
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1032
|
-
prefix: "GML"
|
1266
|
+
prefix: "GML",
|
1267
|
+
value_map: {
|
1268
|
+
from: {
|
1269
|
+
nil: :empty,
|
1270
|
+
empty: :empty,
|
1271
|
+
omitted: :empty
|
1272
|
+
},
|
1273
|
+
to: {
|
1274
|
+
nil: :empty,
|
1275
|
+
empty: :empty,
|
1276
|
+
omitted: :empty
|
1277
|
+
}
|
1278
|
+
}
|
1033
1279
|
map_element "DataType", to: :gml_data_type,
|
1034
1280
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1035
|
-
prefix: "GML"
|
1281
|
+
prefix: "GML",
|
1282
|
+
value_map: {
|
1283
|
+
from: {
|
1284
|
+
nil: :empty,
|
1285
|
+
empty: :empty,
|
1286
|
+
omitted: :empty
|
1287
|
+
},
|
1288
|
+
to: {
|
1289
|
+
nil: :empty,
|
1290
|
+
empty: :empty,
|
1291
|
+
omitted: :empty
|
1292
|
+
}
|
1293
|
+
}
|
1036
1294
|
map_element "Union", to: :gml_union,
|
1037
1295
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1038
|
-
prefix: "GML"
|
1296
|
+
prefix: "GML",
|
1297
|
+
value_map: {
|
1298
|
+
from: {
|
1299
|
+
nil: :empty,
|
1300
|
+
empty: :empty,
|
1301
|
+
omitted: :empty
|
1302
|
+
},
|
1303
|
+
to: {
|
1304
|
+
nil: :empty,
|
1305
|
+
empty: :empty,
|
1306
|
+
omitted: :empty
|
1307
|
+
}
|
1308
|
+
}
|
1039
1309
|
map_element "Enumeration", to: :gml_enumeration,
|
1040
1310
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1041
|
-
prefix: "GML"
|
1311
|
+
prefix: "GML",
|
1312
|
+
value_map: {
|
1313
|
+
from: {
|
1314
|
+
nil: :empty,
|
1315
|
+
empty: :empty,
|
1316
|
+
omitted: :empty
|
1317
|
+
},
|
1318
|
+
to: {
|
1319
|
+
nil: :empty,
|
1320
|
+
empty: :empty,
|
1321
|
+
omitted: :empty
|
1322
|
+
}
|
1323
|
+
}
|
1042
1324
|
map_element "Type", to: :gml_type,
|
1043
1325
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1044
|
-
prefix: "GML"
|
1326
|
+
prefix: "GML",
|
1327
|
+
value_map: {
|
1328
|
+
from: {
|
1329
|
+
nil: :empty,
|
1330
|
+
empty: :empty,
|
1331
|
+
omitted: :empty
|
1332
|
+
},
|
1333
|
+
to: {
|
1334
|
+
nil: :empty,
|
1335
|
+
empty: :empty,
|
1336
|
+
omitted: :empty
|
1337
|
+
}
|
1338
|
+
}
|
1045
1339
|
map_element "FeatureType", to: :gml_feature_type,
|
1046
1340
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1047
|
-
prefix: "GML"
|
1341
|
+
prefix: "GML",
|
1342
|
+
value_map: {
|
1343
|
+
from: {
|
1344
|
+
nil: :empty,
|
1345
|
+
empty: :empty,
|
1346
|
+
omitted: :empty
|
1347
|
+
},
|
1348
|
+
to: {
|
1349
|
+
nil: :empty,
|
1350
|
+
empty: :empty,
|
1351
|
+
omitted: :empty
|
1352
|
+
}
|
1353
|
+
}
|
1048
1354
|
map_element "property", to: :gml_property,
|
1049
1355
|
namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
|
1050
|
-
prefix: "GML"
|
1356
|
+
prefix: "GML",
|
1357
|
+
value_map: {
|
1358
|
+
from: {
|
1359
|
+
nil: :empty,
|
1360
|
+
empty: :empty,
|
1361
|
+
omitted: :empty
|
1362
|
+
},
|
1363
|
+
to: {
|
1364
|
+
nil: :empty,
|
1365
|
+
empty: :empty,
|
1366
|
+
omitted: :empty
|
1367
|
+
}
|
1368
|
+
}
|
1051
1369
|
|
1052
1370
|
map_element "Model", to: :model,
|
1053
1371
|
namespace: "http://www.omg.org/spec/UML/20131001",
|