xmi 0.5.2 → 0.5.4

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +5 -1
  3. data/.rubocop_todo.yml +52 -9
  4. data/lib/xmi/extension.rb +4 -12
  5. data/lib/xmi/parser_pipeline.rb +70 -0
  6. data/lib/xmi/root.rb +3 -12
  7. data/lib/xmi/sparx/connector/appearance.rb +27 -0
  8. data/lib/xmi/sparx/connector/connector.rb +52 -0
  9. data/lib/xmi/sparx/connector/end_base.rb +56 -0
  10. data/lib/xmi/sparx/connector/end_constraint.rb +33 -0
  11. data/lib/xmi/sparx/connector/end_modifiers.rb +19 -0
  12. data/lib/xmi/sparx/connector/end_role.rb +21 -0
  13. data/lib/xmi/sparx/connector/end_style.rb +17 -0
  14. data/lib/xmi/sparx/connector/end_type.rb +21 -0
  15. data/lib/xmi/sparx/connector/labels.rb +27 -0
  16. data/lib/xmi/sparx/connector/model.rb +19 -0
  17. data/lib/xmi/sparx/connector/properties.rb +19 -0
  18. data/lib/xmi/sparx/connector.rb +15 -233
  19. data/lib/xmi/sparx/element/association.rb +58 -0
  20. data/lib/xmi/sparx/element/attribute.rb +58 -0
  21. data/lib/xmi/sparx/element/bounds.rb +19 -0
  22. data/lib/xmi/sparx/element/code.rb +19 -0
  23. data/lib/xmi/sparx/element/containment.rb +19 -0
  24. data/lib/xmi/sparx/element/coords.rb +19 -0
  25. data/lib/xmi/sparx/element/documentation.rb +17 -0
  26. data/lib/xmi/sparx/element/element.rb +62 -0
  27. data/lib/xmi/sparx/element/extended_properties.rb +21 -0
  28. data/lib/xmi/sparx/element/flags.rb +29 -0
  29. data/lib/xmi/sparx/element/links.rb +22 -0
  30. data/lib/xmi/sparx/element/model.rb +26 -0
  31. data/lib/xmi/sparx/element/package_properties.rb +21 -0
  32. data/lib/xmi/sparx/element/paths.rb +17 -0
  33. data/lib/xmi/sparx/element/project.rb +29 -0
  34. data/lib/xmi/sparx/element/properties.rb +41 -0
  35. data/lib/xmi/sparx/element/stereotype.rb +17 -0
  36. data/lib/xmi/sparx/element/style.rb +17 -0
  37. data/lib/xmi/sparx/element/styleex.rb +17 -0
  38. data/lib/xmi/sparx/element/tag.rb +32 -0
  39. data/lib/xmi/sparx/element/times.rb +23 -0
  40. data/lib/xmi/sparx/element/xrefs.rb +17 -0
  41. data/lib/xmi/sparx/element.rb +28 -445
  42. data/lib/xmi/sparx/extension.rb +4 -12
  43. data/lib/xmi/sparx/gml/application_schema.rb +26 -0
  44. data/lib/xmi/sparx/gml/code_list.rb +23 -0
  45. data/lib/xmi/sparx/gml/data_type.rb +18 -0
  46. data/lib/xmi/sparx/gml/enumeration.rb +18 -0
  47. data/lib/xmi/sparx/gml/feature_type.rb +21 -0
  48. data/lib/xmi/sparx/gml/property.rb +24 -0
  49. data/lib/xmi/sparx/gml/shared_attributes.rb +39 -0
  50. data/lib/xmi/sparx/gml/type.rb +18 -0
  51. data/lib/xmi/sparx/gml/union.rb +18 -0
  52. data/lib/xmi/sparx/gml.rb +10 -125
  53. data/lib/xmi/sparx/index.rb +248 -0
  54. data/lib/xmi/sparx/mappings/base_mapping.rb +13 -137
  55. data/lib/xmi/sparx/root.rb +20 -7
  56. data/lib/xmi/sparx.rb +1 -0
  57. data/lib/xmi/uml/annotated_element.rb +16 -0
  58. data/lib/xmi/uml/association_generalization.rb +20 -0
  59. data/lib/xmi/uml/bounds.rb +43 -0
  60. data/lib/xmi/uml/default_value.rb +42 -0
  61. data/lib/xmi/uml/diagram.rb +25 -0
  62. data/lib/xmi/uml/member_end.rb +16 -0
  63. data/lib/xmi/uml/owned_attribute.rb +31 -0
  64. data/lib/xmi/uml/owned_comment.rb +29 -0
  65. data/lib/xmi/uml/owned_element.rb +33 -0
  66. data/lib/xmi/uml/owned_end.rb +34 -0
  67. data/lib/xmi/uml/owned_literal.rb +23 -0
  68. data/lib/xmi/uml/owned_operation.rb +22 -0
  69. data/lib/xmi/uml/owned_parameter.rb +29 -0
  70. data/lib/xmi/uml/package_import.rb +30 -0
  71. data/lib/xmi/uml/packaged_element.rb +49 -0
  72. data/lib/xmi/uml/precondition.rb +22 -0
  73. data/lib/xmi/uml/profile.rb +43 -0
  74. data/lib/xmi/uml/profile_application.rb +34 -0
  75. data/lib/xmi/uml/specification.rb +20 -0
  76. data/lib/xmi/uml/type.rb +18 -0
  77. data/lib/xmi/uml/uml_model.rb +29 -0
  78. data/lib/xmi/uml.rb +27 -502
  79. data/lib/xmi/version.rb +1 -1
  80. data/lib/xmi/version_registry.rb +2 -1
  81. data/lib/xmi/xmi_identity.rb +46 -0
  82. data/lib/xmi.rb +11 -6
  83. metadata +68 -2
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class PackagedElement < Lutaml::Model::Serializable
6
+ attribute :type, ::Xmi::Type::XmiType
7
+ attribute :id, ::Xmi::Type::XmiId
8
+ attribute :name, :string
9
+ attribute :member_end, :string
10
+ attribute :member_ends, MemberEnd, collection: true
11
+ attribute :owned_literal, OwnedLiteral, collection: true
12
+ attribute :owned_operation, OwnedOperation, collection: true
13
+
14
+ # EA specific
15
+ attribute :supplier, :string
16
+ attribute :client, :string
17
+
18
+ attribute :packaged_element, PackagedElement, collection: true
19
+ attribute :owned_end, OwnedEnd, collection: true
20
+ attribute :owned_attribute, OwnedAttribute, collection: true
21
+ attribute :owned_comment, OwnedComment, collection: true
22
+ attribute :generalization, AssociationGeneralization, collection: true
23
+
24
+ xml do
25
+ root "packagedElement"
26
+ namespace ::Xmi::Namespace::Omg::Uml
27
+
28
+ map_attribute "type", to: :type
29
+ map_attribute "id", to: :id
30
+ map_attribute "name", to: :name
31
+ map_attribute "memberEnd", to: :member_end
32
+
33
+ # EA specific
34
+ map_attribute "supplier", to: :supplier
35
+ map_attribute "client", to: :client
36
+
37
+ map_element "generalization", to: :generalization, value_map: VALUE_MAP
38
+ map_element "ownedComment", to: :owned_comment, value_map: VALUE_MAP
39
+ map_element "ownedEnd", to: :owned_end, value_map: VALUE_MAP
40
+ map_element "ownedLiteral", to: :owned_literal, value_map: VALUE_MAP
41
+ map_element "ownedAttribute", to: :owned_attribute, value_map: VALUE_MAP
42
+ map_element "ownedOperation", to: :owned_operation, value_map: VALUE_MAP
43
+ map_element "packagedElement", to: :packaged_element,
44
+ value_map: VALUE_MAP
45
+ map_element "memberEnd", to: :member_ends, value_map: VALUE_MAP
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class Precondition < Lutaml::Model::Serializable
6
+ attribute :id, ::Xmi::Type::XmiId
7
+ attribute :name, :string
8
+ attribute :type, ::Xmi::Type::XmiType
9
+ attribute :specification, Specification
10
+
11
+ xml do
12
+ root "precondition"
13
+ namespace ::Xmi::Namespace::Omg::Uml
14
+
15
+ map_attribute "id", to: :id
16
+ map_attribute "name", to: :name
17
+ map_attribute "type", to: :type
18
+ map_element "specification", to: :specification
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ module ProfileAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ attribute :packaged_element, PackagedElement, collection: true
9
+ attribute :package_import, PackageImport, collection: true
10
+ attribute :id, ::Xmi::Type::XmiId
11
+ attribute :name, :string
12
+ # attribute :xmi, :string
13
+ # attribute :uml, :string
14
+ attribute :ns_prefix, :string
15
+
16
+ # Is this an EA thing?
17
+ attribute :metamodel_reference, :string
18
+ end
19
+ end
20
+ end
21
+
22
+ class Profile < Lutaml::Model::Serializable
23
+ include ProfileAttributes
24
+
25
+ attribute :owned_comment, OwnedComment, collection: true
26
+
27
+ xml do
28
+ root "Profile"
29
+ namespace ::Xmi::Namespace::Omg::Uml
30
+
31
+ map_attribute "id", to: :id
32
+ map_attribute "name", to: :name
33
+ map_attribute "metamodelReference", to: :metamodel_reference
34
+ map_attribute "nsPrefix", to: :ns_prefix
35
+
36
+ map_element "ownedComment", to: :owned_comment, value_map: VALUE_MAP
37
+ map_element "packageImport", to: :package_import, value_map: VALUE_MAP
38
+ map_element "packagedElement", to: :packaged_element,
39
+ value_map: VALUE_MAP
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class ProfileApplicationAppliedProfile < Lutaml::Model::Serializable
6
+ attribute :type, ::Xmi::Type::XmiType
7
+ attribute :href, :string
8
+
9
+ xml do
10
+ root "appliedProfile"
11
+ namespace ::Xmi::Namespace::Omg::Uml
12
+
13
+ map_attribute "type", to: :type
14
+ map_attribute "href", to: :href
15
+ end
16
+ end
17
+
18
+ class ProfileApplication < Lutaml::Model::Serializable
19
+ attribute :type, ::Xmi::Type::XmiType
20
+ attribute :id, ::Xmi::Type::XmiId
21
+ attribute :applied_profile, ProfileApplicationAppliedProfile
22
+
23
+ xml do
24
+ root "profileApplication"
25
+ namespace ::Xmi::Namespace::Omg::Uml
26
+
27
+ map_attribute "type", to: :type
28
+ map_attribute "id", to: :id
29
+
30
+ map_element "appliedProfile", to: :applied_profile
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class Specification < Lutaml::Model::Serializable
6
+ attribute :id, ::Xmi::Type::XmiId
7
+ attribute :type, ::Xmi::Type::XmiType
8
+ attribute :language, :string
9
+
10
+ xml do
11
+ root "specification"
12
+ namespace ::Xmi::Namespace::Omg::Uml
13
+
14
+ map_attribute "id", to: :id
15
+ map_attribute "type", to: :type
16
+ map_attribute "language", to: :language
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class Type < Lutaml::Model::Serializable
6
+ attribute :idref, ::Xmi::Type::XmiIdRef
7
+ attribute :href, :string
8
+
9
+ xml do
10
+ root "type"
11
+ namespace ::Xmi::Namespace::Omg::Uml
12
+
13
+ map_attribute "idref", to: :idref
14
+ map_attribute "href", to: :href
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class UmlModel < Lutaml::Model::Serializable
6
+ attribute :type, ::Xmi::Type::XmiType
7
+ attribute :name, :string
8
+ attribute :profile_application, ProfileApplication, collection: true
9
+ attribute :packaged_element, PackagedElement, collection: true
10
+ attribute :package_import, PackageImport, collection: true
11
+ attribute :diagram, Diagram
12
+
13
+ xml do
14
+ root "Model"
15
+ namespace ::Xmi::Namespace::Omg::Uml
16
+
17
+ map_attribute "type", to: :type
18
+ map_attribute "name", to: :name
19
+
20
+ map_element "packageImport", to: :package_import, value_map: VALUE_MAP
21
+ map_element "packagedElement", to: :packaged_element,
22
+ value_map: VALUE_MAP
23
+ map_element "Diagram", to: :diagram
24
+ map_element "profileApplication", to: :profile_application,
25
+ value_map: VALUE_MAP
26
+ end
27
+ end
28
+ end
29
+ end