lutaml 0.9.6 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/parsers/xml.rb +43 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d1677e27d1216994f6619acc558721d9b2d6107dd30fd6776232965d6d1d219
|
4
|
+
data.tar.gz: e8999116cdee14d6316f9bedaa781893ae2d27b88f93aef514fdda435e8d29b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37c0d7fb4a3676a45fc8ebbab3bfab3e993ad84e005a8a7d642a1af66c3600271d1a03b723a2b7ff8462a96a75605c5bce06425393047c9fcdcd16c38c1b603f
|
7
|
+
data.tar.gz: e287823e6e238754223823ccabaebe31f13332b26efb67ac97d1c3f103cdf512f5a7be9276653f826983fe87e991b221772115b1c3d0bb09bb5745db1f2b0dd2
|
data/lib/lutaml/version.rb
CHANGED
@@ -337,12 +337,28 @@ module Lutaml
|
|
337
337
|
source_or_target = :target
|
338
338
|
end
|
339
339
|
|
340
|
-
member_end =
|
341
|
-
connector_name_by_source_or_target(xmi_id, source_or_target)
|
342
|
-
|
340
|
+
member_end = member_end_name(xmi_id, source_or_target, link.name)
|
343
341
|
[member_end, xmi_id]
|
344
342
|
end
|
345
343
|
|
344
|
+
# @param xmi_id [String]
|
345
|
+
# @param source_or_target [Symbol]
|
346
|
+
# @return [String]
|
347
|
+
def member_end_name(xmi_id, source_or_target, link_name)
|
348
|
+
connector_label = connector_labels(xmi_id, source_or_target)
|
349
|
+
entity_name = lookup_entity_name(xmi_id)
|
350
|
+
connector_name = connector_name_by_source_or_target(
|
351
|
+
xmi_id, source_or_target
|
352
|
+
)
|
353
|
+
|
354
|
+
case link_name
|
355
|
+
when "Aggregation"
|
356
|
+
connector_label || entity_name || connector_name
|
357
|
+
else
|
358
|
+
entity_name || connector_name
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
346
362
|
# @param owner_xmi_id [String]
|
347
363
|
# @param link [Shale::Mapper]
|
348
364
|
# @param link_member_name [String]
|
@@ -402,8 +418,7 @@ module Lutaml
|
|
402
418
|
source_or_target = :target
|
403
419
|
end
|
404
420
|
|
405
|
-
member_end =
|
406
|
-
connector_name_by_source_or_target(xmi_id, source_or_target)
|
421
|
+
member_end = member_end_name(xmi_id, source_or_target, link.name)
|
407
422
|
|
408
423
|
member_end_cardinality, _member_end_attribute_name =
|
409
424
|
fetch_owned_attribute_node(xmi_id)
|
@@ -535,15 +550,32 @@ module Lutaml
|
|
535
550
|
# @param xmi_id [String]
|
536
551
|
# @param source_or_target [String]
|
537
552
|
# @return [String]
|
538
|
-
def
|
539
|
-
|
553
|
+
def connector_node_by_id(xmi_id, source_or_target)
|
554
|
+
@xmi_root_model.extension.connectors.connector.find do |con|
|
540
555
|
con.send(source_or_target.to_sym).idref == xmi_id
|
541
556
|
end
|
542
|
-
|
543
|
-
|
544
|
-
|
557
|
+
end
|
558
|
+
|
559
|
+
# @param xmi_id [String]
|
560
|
+
# @param source_or_target [String]
|
561
|
+
# @return [String]
|
562
|
+
def connector_name_by_source_or_target(xmi_id, source_or_target)
|
563
|
+
node = connector_node_by_id(xmi_id, source_or_target)
|
564
|
+
return if node.nil? ||
|
565
|
+
node.send(source_or_target.to_sym).nil? ||
|
566
|
+
node.send(source_or_target.to_sym).model.nil?
|
567
|
+
|
568
|
+
node.send(source_or_target.to_sym).model.name
|
569
|
+
end
|
570
|
+
|
571
|
+
# @param xmi_id [String]
|
572
|
+
# @param source_or_target [String]
|
573
|
+
# @return [String]
|
574
|
+
def connector_labels(xmi_id, source_or_target)
|
575
|
+
node = connector_node_by_id(xmi_id, source_or_target)
|
576
|
+
return if node.nil?
|
545
577
|
|
546
|
-
node.
|
578
|
+
node.labels&.rt || node.labels&.lt
|
547
579
|
end
|
548
580
|
|
549
581
|
# @param xmi_id [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: expressir
|