stepmod-utils 0.3.29 → 0.3.30
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/stepmod/utils/terms_extractor.rb +19 -9
- data/lib/stepmod/utils/version.rb +1 -1
- 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: 94969385c7a15c9c97396a1f41bb772001e7114cef8896cf3a4291635f6b0087
|
|
4
|
+
data.tar.gz: 568556c9711f6b04cd6dbb83bfc1ba3d14da334711f841dbed2609014eb6b642
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dd2832e232332d5062e368e6e74bb8bbdb1a0bc76ab2e171e1351a83b684fbca26a0a6f16f346d82b1d2e8cce2a76fe7febc2d5b0684642b8864ebbf36a1dd1
|
|
7
|
+
data.tar.gz: 05727db1fdd1631ebe6cb19fac8f09306cacab603c03ade34c6c5683be9a2283f13e22e364a3580952414d132554adfbc2238c3d951f9cc92ac02a76fa5880c3
|
|
@@ -243,13 +243,15 @@ module Stepmod
|
|
|
243
243
|
bibdata: bibdata,
|
|
244
244
|
# See: metanorma/iso-10303-2#90
|
|
245
245
|
domain_prefix: "application module",
|
|
246
|
+
schema_type: type,
|
|
246
247
|
)
|
|
247
248
|
when "module_mim"
|
|
248
249
|
mim_concepts = parse_annotated_module(
|
|
249
250
|
schema: schema,
|
|
250
251
|
bibdata: bibdata,
|
|
251
252
|
# See: metanorma/iso-10303-2#90
|
|
252
|
-
domain_prefix: "application
|
|
253
|
+
domain_prefix: "application module",
|
|
254
|
+
schema_type: type,
|
|
253
255
|
)
|
|
254
256
|
when "resource"
|
|
255
257
|
parse_annotated_resource(schema: schema, bibdata: bibdata)
|
|
@@ -268,7 +270,7 @@ module Stepmod
|
|
|
268
270
|
}[match.captures[0]] || "resource"
|
|
269
271
|
end
|
|
270
272
|
|
|
271
|
-
def parse_annotated_module(schema:, bibdata:, domain_prefix:)
|
|
273
|
+
def parse_annotated_module(schema:, bibdata:, domain_prefix:, schema_type:)
|
|
272
274
|
log "INFO: parse_annotated_module: " \
|
|
273
275
|
"Processing modules schema #{schema.file}"
|
|
274
276
|
|
|
@@ -285,6 +287,7 @@ module Stepmod
|
|
|
285
287
|
"name" => schema.id,
|
|
286
288
|
"type" => "module",
|
|
287
289
|
"path" => extract_file_path(entity.parent.file),
|
|
290
|
+
"schema_type" => schema_type
|
|
288
291
|
},
|
|
289
292
|
document: {
|
|
290
293
|
"type" => "module",
|
|
@@ -330,6 +333,7 @@ module Stepmod
|
|
|
330
333
|
"name" => schema.id,
|
|
331
334
|
"type" => "resource",
|
|
332
335
|
"path" => extract_file_path(entity.parent.file),
|
|
336
|
+
"schema_type" => "resource"
|
|
333
337
|
},
|
|
334
338
|
document: {
|
|
335
339
|
"type" => "resource",
|
|
@@ -363,7 +367,8 @@ module Stepmod
|
|
|
363
367
|
# rubocop:disable Metrics/MethodLength
|
|
364
368
|
def generate_concept_from_entity(entity:, schema:, domain:, bibdata:, document:)
|
|
365
369
|
old_definition = trim_definition(entity.remarks.first)
|
|
366
|
-
|
|
370
|
+
schema_type = schema["schema_type"]
|
|
371
|
+
definition = generate_entity_definition(entity, domain, schema_type)
|
|
367
372
|
|
|
368
373
|
notes = [old_definition].reject { |note| redundant_note?(note) }
|
|
369
374
|
|
|
@@ -515,15 +520,20 @@ module Stepmod
|
|
|
515
520
|
# end
|
|
516
521
|
|
|
517
522
|
# rubocop:disable Layout/LineLength
|
|
518
|
-
def generate_entity_definition(entity, domain)
|
|
523
|
+
def generate_entity_definition(entity, domain, schema_type)
|
|
519
524
|
return "" if entity.nil?
|
|
520
525
|
|
|
521
526
|
# See: metanorma/iso-10303-2#90
|
|
522
|
-
entity_type =
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
+
entity_type = case schema_type
|
|
528
|
+
when "module_arm"
|
|
529
|
+
"{{application object}}"
|
|
530
|
+
when "module_mim"
|
|
531
|
+
"{{entity data type}}"
|
|
532
|
+
when "resource", "business_object_model"
|
|
533
|
+
"{{entity data type}}"
|
|
534
|
+
else
|
|
535
|
+
raise Error.new("[stepmod-utils] encountered unsupported schema_type")
|
|
536
|
+
end
|
|
527
537
|
|
|
528
538
|
if entity.subtype_of.size.zero?
|
|
529
539
|
"#{entity_type} " \
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stepmod-utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.30
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-07-
|
|
11
|
+
date: 2023-07-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|