lutaml-uml 0.4.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +22 -0
- data/Gemfile +1 -5
- data/README.adoc +4 -42
- data/Rakefile +0 -5
- data/lutaml-uml.gemspec +23 -38
- metadata +20 -292
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -40
- data/.github/workflows/windows.yml +0 -51
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/CODE_OF_CONDUCT.md +0 -74
- data/LUTAML.adoc +0 -344
- data/bin/console +0 -15
- data/bin/folder_yaml2lutaml.sh +0 -6
- data/bin/plantuml2lutaml +0 -59
- data/bin/setup +0 -8
- data/bin/yaml2lutaml +0 -144
- data/exe/lutaml-wsd2uml +0 -59
- data/exe/lutaml-yaml2uml +0 -144
- data/lib/lutaml/layout/engine.rb +0 -15
- data/lib/lutaml/layout/graph_viz_engine.rb +0 -19
- data/lib/lutaml/uml/abstraction.rb +0 -11
- data/lib/lutaml/uml/activity.rb +0 -11
- data/lib/lutaml/uml/actor.rb +0 -19
- data/lib/lutaml/uml/association.rb +0 -41
- data/lib/lutaml/uml/behavior.rb +0 -11
- data/lib/lutaml/uml/class.rb +0 -83
- data/lib/lutaml/uml/classifier.rb +0 -11
- data/lib/lutaml/uml/connector.rb +0 -21
- data/lib/lutaml/uml/constraint.rb +0 -12
- data/lib/lutaml/uml/constructor_end.rb +0 -16
- data/lib/lutaml/uml/data_type.rb +0 -75
- data/lib/lutaml/uml/dependency.rb +0 -21
- data/lib/lutaml/uml/diagram.rb +0 -8
- data/lib/lutaml/uml/document.rb +0 -81
- data/lib/lutaml/uml/enum.rb +0 -45
- data/lib/lutaml/uml/event.rb +0 -12
- data/lib/lutaml/uml/final_state.rb +0 -11
- data/lib/lutaml/uml/formatter/base.rb +0 -67
- data/lib/lutaml/uml/formatter/graphviz.rb +0 -334
- data/lib/lutaml/uml/formatter.rb +0 -21
- data/lib/lutaml/uml/has_attributes.rb +0 -14
- data/lib/lutaml/uml/has_members.rb +0 -30
- data/lib/lutaml/uml/instance.rb +0 -17
- data/lib/lutaml/uml/model.rb +0 -13
- data/lib/lutaml/uml/node/base.rb +0 -21
- data/lib/lutaml/uml/node/class_node.rb +0 -57
- data/lib/lutaml/uml/node/class_relationship.rb +0 -14
- data/lib/lutaml/uml/node/document.rb +0 -18
- data/lib/lutaml/uml/node/field.rb +0 -34
- data/lib/lutaml/uml/node/has_name.rb +0 -15
- data/lib/lutaml/uml/node/has_type.rb +0 -15
- data/lib/lutaml/uml/node/method.rb +0 -29
- data/lib/lutaml/uml/node/method_argument.rb +0 -16
- data/lib/lutaml/uml/node/relationship.rb +0 -28
- data/lib/lutaml/uml/opaque_behavior.rb +0 -11
- data/lib/lutaml/uml/operation.rb +0 -31
- data/lib/lutaml/uml/package.rb +0 -53
- data/lib/lutaml/uml/parsers/attribute.rb +0 -70
- data/lib/lutaml/uml/parsers/dsl.rb +0 -413
- data/lib/lutaml/uml/parsers/dsl_preprocessor.rb +0 -59
- data/lib/lutaml/uml/parsers/dsl_transform.rb +0 -27
- data/lib/lutaml/uml/parsers/yaml.rb +0 -46
- data/lib/lutaml/uml/port.rb +0 -8
- data/lib/lutaml/uml/primitive_type.rb +0 -14
- data/lib/lutaml/uml/property.rb +0 -27
- data/lib/lutaml/uml/pseudostate.rb +0 -11
- data/lib/lutaml/uml/realization.rb +0 -11
- data/lib/lutaml/uml/region.rb +0 -12
- data/lib/lutaml/uml/serializers/association.rb +0 -58
- data/lib/lutaml/uml/serializers/base.rb +0 -16
- data/lib/lutaml/uml/serializers/class.rb +0 -29
- data/lib/lutaml/uml/serializers/top_element_attribute.rb +0 -14
- data/lib/lutaml/uml/serializers/yaml_view.rb +0 -18
- data/lib/lutaml/uml/state.rb +0 -12
- data/lib/lutaml/uml/state_machine.rb +0 -12
- data/lib/lutaml/uml/top_element.rb +0 -58
- data/lib/lutaml/uml/top_element_attribute.rb +0 -37
- data/lib/lutaml/uml/transition.rb +0 -12
- data/lib/lutaml/uml/trigger.rb +0 -12
- data/lib/lutaml/uml/value.rb +0 -30
- data/lib/lutaml/uml/version.rb +0 -7
- data/lib/lutaml/uml/vertex.rb +0 -11
- data/lib/lutaml/uml.rb +0 -13
- data/spec/fixtures/datamodel/models/AddressClassProfile.yml +0 -90
- data/spec/fixtures/datamodel/models/AddressComponentProfile.yml +0 -63
- data/spec/fixtures/datamodel/models/AddressComponentSpecification.yml +0 -15
- data/spec/fixtures/datamodel/models/AddressProfile.yml +0 -36
- data/spec/fixtures/datamodel/models/AttributeProfile.yml +0 -32
- data/spec/fixtures/datamodel/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/fixtures/datamodel/models/Localization copy.yml +0 -23
- data/spec/fixtures/datamodel/models/Localization.yml +0 -23
- data/spec/fixtures/datamodel/models/ProfileCompliantAddress.yml +0 -36
- data/spec/fixtures/datamodel/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/fixtures/datamodel/models/Signature.yml +0 -20
- data/spec/fixtures/datamodel/models/SignatureBlankDefinition.yml +0 -20
- data/spec/fixtures/datamodel/models/TextDirectionCode copy.yml +0 -16
- data/spec/fixtures/datamodel/models/TextDirectionCode.yml +0 -16
- data/spec/fixtures/datamodel/models/Validity.yml +0 -14
- data/spec/fixtures/datamodel/models/iso19160-1/Address.yml +0 -22
- data/spec/fixtures/datamodel/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/fixtures/datamodel/style.uml.inc +0 -37
- data/spec/fixtures/datamodel/views/AddressClassProfile.yml +0 -12
- data/spec/fixtures/datamodel/views/AddressProfile.yml +0 -3
- data/spec/fixtures/datamodel/views/CommonModels.yml +0 -9
- data/spec/fixtures/datamodel/views/TopDown.yml +0 -62
- data/spec/fixtures/dsl/broken_diagram.lutaml +0 -34
- data/spec/fixtures/dsl/diagram.lutaml +0 -3
- data/spec/fixtures/dsl/diagram_attributes.lutaml +0 -5
- data/spec/fixtures/dsl/diagram_blank_definion.lutaml +0 -6
- data/spec/fixtures/dsl/diagram_blank_entities.lutaml +0 -8
- data/spec/fixtures/dsl/diagram_class_assocation.lutaml +0 -29
- data/spec/fixtures/dsl/diagram_class_fields.lutaml +0 -25
- data/spec/fixtures/dsl/diagram_commented_includes.lutaml +0 -5
- data/spec/fixtures/dsl/diagram_comments.lutaml +0 -28
- data/spec/fixtures/dsl/diagram_concept_model.lutaml +0 -132
- data/spec/fixtures/dsl/diagram_data_types.lutaml +0 -44
- data/spec/fixtures/dsl/diagram_definitions.lutaml +0 -25
- data/spec/fixtures/dsl/diagram_includes.lutaml +0 -6
- data/spec/fixtures/dsl/diagram_multiply_classes.lutaml +0 -7
- data/spec/fixtures/dsl/diagram_non_existing_include.lutaml +0 -6
- data/spec/fixtures/dsl/shared.lutaml +0 -3
- data/spec/fixtures/dsl/shared1.lutaml +0 -4
- data/spec/fixtures/generated_dot/AddressClassProfile.dot +0 -170
- data/spec/fixtures/generated_dot/AddressProfile.dot +0 -34
- data/spec/lutaml/layout/graph_viz_engine_spec.rb +0 -31
- data/spec/lutaml/uml/formatter/graphviz_spec.rb +0 -41
- data/spec/lutaml/uml/parsers/dsl_spec.rb +0 -343
- data/spec/lutaml/uml/parsers/yaml_spec.rb +0 -18
- data/spec/lutaml/uml/serializers/yaml_view_spec.rb +0 -20
- data/spec/lutaml/uml_spec.rb +0 -7
- data/spec/spec_helper.rb +0 -25
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lutaml
|
4
|
-
module Uml
|
5
|
-
module Parsers
|
6
|
-
# Class for preprocessing dsl ascii file special directives:
|
7
|
-
# - include
|
8
|
-
class DslPreprocessor
|
9
|
-
attr_reader :input_file
|
10
|
-
|
11
|
-
def initialize(input_file)
|
12
|
-
@input_file = input_file
|
13
|
-
end
|
14
|
-
|
15
|
-
class << self
|
16
|
-
def call(input_file)
|
17
|
-
new(input_file).call
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def call
|
22
|
-
include_root = File.dirname(input_file.path)
|
23
|
-
input_file.read.split("\n").reduce([]) do |res, line|
|
24
|
-
res.push(*process_dsl_line(include_root, line))
|
25
|
-
end.join("\n")
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def process_dsl_line(include_root, line)
|
31
|
-
process_include_line(include_root, process_comment_line(line))
|
32
|
-
end
|
33
|
-
|
34
|
-
def process_comment_line(line)
|
35
|
-
has_comment = line.match(Regexp.new("//.+"))
|
36
|
-
return line if has_comment.nil?
|
37
|
-
|
38
|
-
line.gsub(Regexp.new("//.+"), "")
|
39
|
-
end
|
40
|
-
|
41
|
-
def process_include_line(include_root, line)
|
42
|
-
include_path_match = line.match(/^\s*include\s+(.+)/)
|
43
|
-
return line if include_path_match.nil? || line =~ /^\s\*\*/
|
44
|
-
|
45
|
-
path_to_file = include_path_match[1].strip
|
46
|
-
path_to_file = if path_to_file.match?(/^\//)
|
47
|
-
path_to_file
|
48
|
-
else
|
49
|
-
File.join(include_root, path_to_file)
|
50
|
-
end
|
51
|
-
File.read(path_to_file).split("\n")
|
52
|
-
rescue Errno::ENOENT
|
53
|
-
puts("No such file or directory @ rb_sysopen - #{path_to_file}, \
|
54
|
-
include file paths need to be supplied relative to the main document")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "parslet"
|
4
|
-
|
5
|
-
module Lutaml
|
6
|
-
module Uml
|
7
|
-
module Parsers
|
8
|
-
# Class for additional transformations of LutaML syntax:
|
9
|
-
# visibility modifier etc
|
10
|
-
class DslTransform < Parslet::Transform
|
11
|
-
rule(visibility_modifier: simple(:visibility_value)) do
|
12
|
-
case visibility_value
|
13
|
-
when "-"
|
14
|
-
"private"
|
15
|
-
when "#"
|
16
|
-
"protected"
|
17
|
-
when "~"
|
18
|
-
"friendly"
|
19
|
-
else
|
20
|
-
"public"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
rule(simple(:member)) { member.nil? ? member : member.to_s.strip }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "yaml"
|
4
|
-
require "lutaml/uml/class"
|
5
|
-
require "lutaml/uml/document"
|
6
|
-
require "lutaml/uml/serializers/yaml_view"
|
7
|
-
|
8
|
-
module Lutaml
|
9
|
-
module Uml
|
10
|
-
module Parsers
|
11
|
-
class Yaml
|
12
|
-
def self.parse(yaml_path, options = {})
|
13
|
-
new.parse(yaml_path, options)
|
14
|
-
end
|
15
|
-
|
16
|
-
def parse(yaml_path, _options = {})
|
17
|
-
yaml_parse(yaml_path)
|
18
|
-
end
|
19
|
-
|
20
|
-
def yaml_parse(yaml_path)
|
21
|
-
yaml_content = YAML.safe_load(File.read(yaml_path))
|
22
|
-
serialized_yaml = Lutaml::Uml::Serializers::YamlView
|
23
|
-
.new(yaml_content)
|
24
|
-
result = Lutaml::Uml::Document.new(serialized_yaml)
|
25
|
-
result.classes = imports_to_classes(yaml_content, yaml_path)
|
26
|
-
result
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def imports_to_classes(yaml_content, yaml_path)
|
32
|
-
models_path = File.join(File.dirname(yaml_path), "..", "models")
|
33
|
-
yaml_content["imports"].map do |(klass_name, _)|
|
34
|
-
klass_attrs = YAML.safe_load(
|
35
|
-
File.read(
|
36
|
-
File.join(models_path, "#{klass_name}.yml")
|
37
|
-
)
|
38
|
-
)
|
39
|
-
klass_attrs["name"] = klass_name if klass_attrs["name"].nil?
|
40
|
-
Lutaml::Uml::Serializers::Class.new(klass_attrs)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/lib/lutaml/uml/port.rb
DELETED
data/lib/lutaml/uml/property.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lutaml
|
4
|
-
module Uml
|
5
|
-
class Property < TopElement
|
6
|
-
attr_accessor :type,
|
7
|
-
:aggregation,
|
8
|
-
:association,
|
9
|
-
:is_derived,
|
10
|
-
:lowerValue,
|
11
|
-
:upperValue
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@name = nil
|
15
|
-
@xmi_id = nil
|
16
|
-
@xmi_uuid = nil
|
17
|
-
@aggregation = nil
|
18
|
-
@association = nil
|
19
|
-
@namespace = nil
|
20
|
-
@is_derived = false
|
21
|
-
@visibility = "public"
|
22
|
-
@lowerValue = "1"
|
23
|
-
@upperValue = "1"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/lib/lutaml/uml/region.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lutaml/uml/serializers/base"
|
4
|
-
require "lutaml/uml/serializers/class"
|
5
|
-
|
6
|
-
module Lutaml
|
7
|
-
module Uml
|
8
|
-
module Serializers
|
9
|
-
class Association < Base
|
10
|
-
property :member_end, from: :target
|
11
|
-
property :member_end_attribute_name,
|
12
|
-
from: "relationship",
|
13
|
-
transform_with: (lambda do |val|
|
14
|
-
val.dig("target", "attributes")&.keys&.first ||
|
15
|
-
val.dig("target", "attribute")&.keys&.first
|
16
|
-
end)
|
17
|
-
property :member_end_cardinality,
|
18
|
-
from: "relationship",
|
19
|
-
transform_with: (lambda do |val|
|
20
|
-
res = val.dig("source", "attributes")&.values&.first ||
|
21
|
-
val.dig("source", "attribute")&.values&.first
|
22
|
-
res["cardinality"] if res
|
23
|
-
end)
|
24
|
-
property :member_end_type,
|
25
|
-
from: "relationship",
|
26
|
-
transform_with: (lambda do |val|
|
27
|
-
val.dig("target", "type")
|
28
|
-
end)
|
29
|
-
property :owner_end_attribute_name,
|
30
|
-
from: "relationship",
|
31
|
-
transform_with: (lambda do |val|
|
32
|
-
val.dig("source", "attributes")&.keys&.first ||
|
33
|
-
val.dig("source", "attribute")&.keys&.first
|
34
|
-
end)
|
35
|
-
property :owner_end_cardinality,
|
36
|
-
from: "relationship",
|
37
|
-
transform_with: (lambda do |val|
|
38
|
-
res = val.dig("source", "attributes")&.values&.first ||
|
39
|
-
val.dig("source", "attribute")&.values&.first
|
40
|
-
res["cardinality"] if res
|
41
|
-
end)
|
42
|
-
property :owner_end_type,
|
43
|
-
from: "relationship",
|
44
|
-
transform_with: (lambda do |val|
|
45
|
-
val.dig("source", "type")
|
46
|
-
end)
|
47
|
-
property :action,
|
48
|
-
transform_with: (lambda do |val|
|
49
|
-
if val["direction"] == "target"
|
50
|
-
"#{val['verb']} ▶"
|
51
|
-
else
|
52
|
-
"◀ #{val['verb']}"
|
53
|
-
end
|
54
|
-
end)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "hashie"
|
4
|
-
|
5
|
-
module Lutaml
|
6
|
-
module Uml
|
7
|
-
module Serializers
|
8
|
-
class Base < Hashie::Dash
|
9
|
-
include Hashie::Extensions::Dash::PropertyTranslation
|
10
|
-
include Hashie::Extensions::Dash::IndifferentAccess
|
11
|
-
include Hashie::Extensions::Dash::Coercion
|
12
|
-
include Hashie::Extensions::IgnoreUndeclared
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lutaml/uml/serializers/base"
|
4
|
-
require "lutaml/uml/serializers/top_element_attribute"
|
5
|
-
require "lutaml/uml/serializers/association"
|
6
|
-
|
7
|
-
module Lutaml
|
8
|
-
module Uml
|
9
|
-
module Serializers
|
10
|
-
class Class < Base
|
11
|
-
property :attributes,
|
12
|
-
transform_with: (lambda do |entry|
|
13
|
-
entry
|
14
|
-
.to_a
|
15
|
-
.map do |(name, attributes)|
|
16
|
-
attributes.merge(name: name)
|
17
|
-
end
|
18
|
-
end)
|
19
|
-
property :associations,
|
20
|
-
from: :relations,
|
21
|
-
coerce: Array[::Lutaml::Uml::Serializers::Association]
|
22
|
-
property :name
|
23
|
-
# property :type, from: :modelType
|
24
|
-
# property :relations,
|
25
|
-
# coerce: Array[Relation]
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lutaml/uml/serializers/base"
|
4
|
-
require "lutaml/uml/serializers/class"
|
5
|
-
|
6
|
-
module Lutaml
|
7
|
-
module Uml
|
8
|
-
module Serializers
|
9
|
-
class YamlView < Base
|
10
|
-
property :name
|
11
|
-
property :title
|
12
|
-
property :caption
|
13
|
-
property :groups
|
14
|
-
property :fidelity
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/lutaml/uml/state.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lutaml
|
4
|
-
module Uml
|
5
|
-
class TopElement
|
6
|
-
include HasAttributes
|
7
|
-
|
8
|
-
attr_accessor :name,
|
9
|
-
:definition,
|
10
|
-
:xmi_id,
|
11
|
-
:xmi_uuid,
|
12
|
-
:namespace,
|
13
|
-
:keyword,
|
14
|
-
:stereotype,
|
15
|
-
:href,
|
16
|
-
:visibility,
|
17
|
-
:comments
|
18
|
-
|
19
|
-
# rubocop:disable Rails/ActiveRecordAliases
|
20
|
-
def initialize(attributes = {})
|
21
|
-
@visibility = "public"
|
22
|
-
@name = attributes["name"]
|
23
|
-
update_attributes(attributes)
|
24
|
-
end
|
25
|
-
# rubocop:enable Rails/ActiveRecordAliases
|
26
|
-
|
27
|
-
def full_name
|
28
|
-
if name == nil
|
29
|
-
return nil
|
30
|
-
end
|
31
|
-
|
32
|
-
the_name = name
|
33
|
-
next_namespace = namespace
|
34
|
-
|
35
|
-
while !next_namespace.nil?
|
36
|
-
the_name = if !next_namespace.name.nil?
|
37
|
-
next_namespace.name + "::" + the_name
|
38
|
-
else
|
39
|
-
"::" + the_name
|
40
|
-
end
|
41
|
-
next_namespace = next_namespace.namespace
|
42
|
-
end
|
43
|
-
|
44
|
-
the_name
|
45
|
-
end
|
46
|
-
|
47
|
-
def definition=(value)
|
48
|
-
@definition = value
|
49
|
-
.to_s
|
50
|
-
.gsub(/\\}/, '}')
|
51
|
-
.gsub(/\\{/, '{')
|
52
|
-
.split("\n")
|
53
|
-
.map(&:strip)
|
54
|
-
.join("\n")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lutaml
|
4
|
-
module Uml
|
5
|
-
class TopElementAttribute
|
6
|
-
include HasAttributes
|
7
|
-
include HasMembers
|
8
|
-
|
9
|
-
attr_accessor :name,
|
10
|
-
:visibility,
|
11
|
-
:type,
|
12
|
-
:definition,
|
13
|
-
:contain,
|
14
|
-
:static,
|
15
|
-
:cardinality,
|
16
|
-
:keyword,
|
17
|
-
:is_derived
|
18
|
-
|
19
|
-
# rubocop:disable Rails/ActiveRecordAliases
|
20
|
-
def initialize(attributes = {})
|
21
|
-
@visibility = "public"
|
22
|
-
update_attributes(attributes)
|
23
|
-
end
|
24
|
-
# rubocop:enable Rails/ActiveRecordAliases
|
25
|
-
|
26
|
-
def definition=(value)
|
27
|
-
@definition = value
|
28
|
-
.to_s
|
29
|
-
.gsub(/\\}/, '}')
|
30
|
-
.gsub(/\\{/, '{')
|
31
|
-
.split("\n")
|
32
|
-
.map(&:strip)
|
33
|
-
.join("\n")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/lutaml/uml/trigger.rb
DELETED
data/lib/lutaml/uml/value.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lutaml
|
4
|
-
module Uml
|
5
|
-
class Value
|
6
|
-
include HasAttributes
|
7
|
-
include HasMembers
|
8
|
-
|
9
|
-
attr_accessor :definition,
|
10
|
-
:name,
|
11
|
-
:type
|
12
|
-
|
13
|
-
# rubocop:disable Rails/ActiveRecordAliases
|
14
|
-
def initialize(attributes = {})
|
15
|
-
update_attributes(attributes)
|
16
|
-
end
|
17
|
-
# rubocop:enable Rails/ActiveRecordAliases
|
18
|
-
|
19
|
-
def definition=(value)
|
20
|
-
@definition = value
|
21
|
-
.to_s
|
22
|
-
.gsub(/\\}/, '}')
|
23
|
-
.gsub(/\\{/, '{')
|
24
|
-
.split("\n")
|
25
|
-
.map(&:strip)
|
26
|
-
.join("\n")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/lib/lutaml/uml/version.rb
DELETED
data/lib/lutaml/uml/vertex.rb
DELETED
data/lib/lutaml/uml.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "lutaml/uml/version"
|
4
|
-
require "lutaml/uml/parsers/dsl"
|
5
|
-
require "lutaml/uml/parsers/yaml"
|
6
|
-
require "lutaml/uml/parsers/attribute"
|
7
|
-
require "lutaml/uml/formatter"
|
8
|
-
|
9
|
-
module Lutaml
|
10
|
-
module Uml
|
11
|
-
class Error < StandardError; end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
modelType: class
|
2
|
-
# TODO
|
3
|
-
definition: |
|
4
|
-
An `AddressClassProfile` represents a profile of a `ProfileCompliantAddress`.
|
5
|
-
It corresponds to the concept of an `AddressClass` originally
|
6
|
-
expressed in <<ISO19160-1>> as a referenced codelist.
|
7
|
-
|
8
|
-
It represents additional attributes and restrictions to the
|
9
|
-
`ProfileCompliantAddress` model. It also represents metadata for the use of
|
10
|
-
the profile.
|
11
|
-
|
12
|
-
A single profile can include and support multiple types of
|
13
|
-
address formats, such as a numbered street address and a
|
14
|
-
"`PO Box`" address simultaneously. Each of these address formats
|
15
|
-
is represented as an interchange address class.
|
16
|
-
|
17
|
-
[example]
|
18
|
-
--
|
19
|
-
The US Numbered Thoroughfare Address with this syntax can be
|
20
|
-
represented as an address class profile:
|
21
|
-
|
22
|
-
*{sp}{ Complete Landmark Name or Complete Place Name } +
|
23
|
-
*{sp}{ Complete Address Number * } +
|
24
|
-
*{sp}{ Complete Street Name * } +
|
25
|
-
*{sp}{ Complete Subaddress } +
|
26
|
-
*{sp}{ Complete Place Name * } +
|
27
|
-
*{sp}{ State Name * } +
|
28
|
-
*{sp}{ Zip Code } +
|
29
|
-
*{sp}{ Zip Plus 4 } +
|
30
|
-
*{sp}{ Country Name }
|
31
|
-
--
|
32
|
-
attributes:
|
33
|
-
id:
|
34
|
-
definition: Unique identifier of this AddressClassProfile.
|
35
|
-
type: CharacterString
|
36
|
-
type:
|
37
|
-
definition: Intended usage of this profile.
|
38
|
-
type: CharacterString
|
39
|
-
description:
|
40
|
-
definition: Textual description of this profile.
|
41
|
-
type: CharacterString
|
42
|
-
localization:
|
43
|
-
definition: The language and script used within this profile.
|
44
|
-
type: Localization
|
45
|
-
signature:
|
46
|
-
definition: The digital signature to verify the integrity of this profile, and the identity of the publishing authority.
|
47
|
-
type: Signature
|
48
|
-
cardinality:
|
49
|
-
min: 0
|
50
|
-
max: 1
|
51
|
-
areaApplicability:
|
52
|
-
definition: The geographic representation of which this AddressClassProfile applies to. Overlapping geographic areas are allowed across different profiles.
|
53
|
-
type: iso19115MD_SpatialRepresentation
|
54
|
-
cardinality:
|
55
|
-
min: 0
|
56
|
-
max: "*"
|
57
|
-
timeToLive:
|
58
|
-
definition: The maximum time interval between refreshing of this profile via an authoritative source, in seconds.
|
59
|
-
type: Integer
|
60
|
-
validity:
|
61
|
-
definition: The period of date and time that this profile should be considered as valid.
|
62
|
-
type: Validity
|
63
|
-
relations:
|
64
|
-
- target: AttributeProfile
|
65
|
-
relationship:
|
66
|
-
source:
|
67
|
-
type: aggregation
|
68
|
-
attribute:
|
69
|
-
addressClassProfile:
|
70
|
-
target:
|
71
|
-
type: direct
|
72
|
-
attribute:
|
73
|
-
attributeProfile:
|
74
|
-
cardinality:
|
75
|
-
min: 0
|
76
|
-
max: '*'
|
77
|
-
|
78
|
-
- target: ProfileCompliantAddress
|
79
|
-
relationship:
|
80
|
-
source:
|
81
|
-
attribute:
|
82
|
-
profile:
|
83
|
-
cardinality:
|
84
|
-
min: 1
|
85
|
-
max: 1
|
86
|
-
target:
|
87
|
-
type: direct
|
88
|
-
action:
|
89
|
-
verb: compliesWith
|
90
|
-
direction: source
|