relaton-iec 1.11.2 → 1.11.3
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/grammars/biblio.rng +38 -9
- data/lib/data/61360-4_DB.yaml +63 -0
- data/lib/relaton_iec/hit.rb +2 -0
- data/lib/relaton_iec/hit_collection.rb +9 -1
- data/lib/relaton_iec/iec_bibliographic_item.rb +7 -7
- data/lib/relaton_iec/iec_bibliography.rb +11 -11
- data/lib/relaton_iec/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b06795307ed2232e78986c9ff0bfcd0012a326c9938373842791492d558a344
|
4
|
+
data.tar.gz: f88a3d9ceed53b9b31974ac994479a2904c9be82e57a03728b7730c0991655fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49e1c8c651adf7df75a9befc1b75bf82d1de7194707069e20e50997656e98ac121f3526dda355fbb95593beccdcd4ce6aa1d0a9dfd220b9186871fce62d4624b
|
7
|
+
data.tar.gz: ad92bc78b02e45959df21be7060777b4a60c7497e851a8218806c557d8bf0ccfd2bed6a95c672ebfb248ce38538cfa96119f58f59d645c57fa32a98525f44c90
|
data/grammars/biblio.rng
CHANGED
@@ -527,7 +527,7 @@
|
|
527
527
|
</define>
|
528
528
|
<define name="LocalityType">
|
529
529
|
<data type="string">
|
530
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
530
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
|
531
531
|
</data>
|
532
532
|
</define>
|
533
533
|
<define name="referenceFrom">
|
@@ -851,17 +851,46 @@
|
|
851
851
|
</define>
|
852
852
|
<define name="bplace">
|
853
853
|
<element name="place">
|
854
|
-
<
|
855
|
-
<
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
854
|
+
<choice>
|
855
|
+
<text/>
|
856
|
+
<group>
|
857
|
+
<ref name="bibliocity"/>
|
858
|
+
<zeroOrMore>
|
859
|
+
<ref name="biblioregion"/>
|
860
|
+
</zeroOrMore>
|
861
|
+
<zeroOrMore>
|
862
|
+
<ref name="bibliocountry"/>
|
863
|
+
</zeroOrMore>
|
864
|
+
</group>
|
865
|
+
</choice>
|
866
|
+
</element>
|
867
|
+
</define>
|
868
|
+
<define name="bibliocity">
|
869
|
+
<element name="city">
|
862
870
|
<text/>
|
863
871
|
</element>
|
864
872
|
</define>
|
873
|
+
<define name="biblioregion">
|
874
|
+
<element name="region">
|
875
|
+
<ref name="RegionType"/>
|
876
|
+
</element>
|
877
|
+
</define>
|
878
|
+
<define name="bibliocountry">
|
879
|
+
<element name="country">
|
880
|
+
<ref name="RegionType"/>
|
881
|
+
</element>
|
882
|
+
</define>
|
883
|
+
<define name="RegionType">
|
884
|
+
<optional>
|
885
|
+
<attribute name="iso"/>
|
886
|
+
</optional>
|
887
|
+
<optional>
|
888
|
+
<attribute name="recommended">
|
889
|
+
<data type="boolean"/>
|
890
|
+
</attribute>
|
891
|
+
</optional>
|
892
|
+
<text/>
|
893
|
+
</define>
|
865
894
|
<define name="bprice">
|
866
895
|
<element name="price">
|
867
896
|
<attribute name="currency"/>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
id: IEC61360-4DB
|
2
|
+
title:
|
3
|
+
- type: title-intro
|
4
|
+
content: IEC/SC 3D
|
5
|
+
langage:
|
6
|
+
- en
|
7
|
+
script:
|
8
|
+
- Latn
|
9
|
+
format: text/plain
|
10
|
+
- type: title-main
|
11
|
+
content: Common Data Dictionary (CDD - V2.0015.0001)
|
12
|
+
langage:
|
13
|
+
- en
|
14
|
+
script:
|
15
|
+
- Latn
|
16
|
+
format: text/plain
|
17
|
+
- type: main
|
18
|
+
content: IEC/SC 3D - Common Data Dictionary (CDD - V2.0015.0001)
|
19
|
+
langage:
|
20
|
+
- en
|
21
|
+
script:
|
22
|
+
- Latn
|
23
|
+
format: text/plain
|
24
|
+
link:
|
25
|
+
- content: https://cdd.iec.ch
|
26
|
+
type: src
|
27
|
+
type: standard
|
28
|
+
docid:
|
29
|
+
- id: IEC 61360-4 DB
|
30
|
+
type: IEC
|
31
|
+
primary: true
|
32
|
+
contributor:
|
33
|
+
- organization:
|
34
|
+
name:
|
35
|
+
- International Electrotechnical Commission
|
36
|
+
abbreviation: IEC
|
37
|
+
url: www.iec.ch
|
38
|
+
role:
|
39
|
+
- publisher
|
40
|
+
edition: V2.0015.0001
|
41
|
+
language:
|
42
|
+
- en
|
43
|
+
script:
|
44
|
+
- Latn
|
45
|
+
abstract:
|
46
|
+
- content: |
|
47
|
+
Business processes in all domains and especially in electric/ electronic industries are increasingly being conducted electronically;
|
48
|
+
a situation which applies to internal processes as well as to the interaction with external partners.
|
49
|
+
To support the necessary information transfer the use of common concepts based on information/classification models is inevitable.
|
50
|
+
|
51
|
+
Concepts specified on a global basis support error-free information sharing. In addition, the dictionaries of concepts may be used as
|
52
|
+
reference collections for setting up master data repositories for product data that serve as company internal information backbones.
|
53
|
+
Thus, costly interpretation and conversion errors may be minimized.
|
54
|
+
|
55
|
+
From the market side, pressure is increasingly being exerted to supply product data in electronic form using commonly agreed concepts
|
56
|
+
and as this pressure grows, it will have a considerable impact on all business processes. For this reason, a seamless exchange of
|
57
|
+
product data, i.e., an exchange that is free from media discontinuities requires a unified, joint approach both for exchanging product
|
58
|
+
data internally within a company or for exchanging product data with suppliers or customers.
|
59
|
+
language:
|
60
|
+
- en
|
61
|
+
script:
|
62
|
+
- Latn
|
63
|
+
format: text/plain
|
data/lib/relaton_iec/hit.rb
CHANGED
@@ -43,7 +43,15 @@ module RelatonIec
|
|
43
43
|
# @param ref [String]
|
44
44
|
# @param year [String, nil]
|
45
45
|
# @return [Array<RelatonIec::Hit>]
|
46
|
-
def hits(ref, year)
|
46
|
+
def hits(ref, year) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
47
|
+
file = "../data/#{ref.sub(/^IEC\s/, '').gsub(' ', '_').upcase}.yaml"
|
48
|
+
path = File.expand_path file, __dir__
|
49
|
+
if File.exist? path
|
50
|
+
hash = YAML.safe_load File.read(path, encoding: "utf-8")
|
51
|
+
hit = Hit.new({ code: ref }, self)
|
52
|
+
hit.fetch = IecBibliographicItem.from_hash hash
|
53
|
+
return [hit]
|
54
|
+
end
|
47
55
|
from, to = nil
|
48
56
|
if year
|
49
57
|
from = Date.strptime year, "%Y"
|
@@ -43,7 +43,7 @@ module RelatonIec
|
|
43
43
|
# @return [RelatonIsoBib::IecBibliographicItem]
|
44
44
|
def self.from_hash(hash)
|
45
45
|
item_hash = ::RelatonIec::HashConverter.hash_to_bib(hash)
|
46
|
-
new
|
46
|
+
new(**item_hash)
|
47
47
|
end
|
48
48
|
|
49
49
|
# @param opts [Hash]
|
@@ -52,7 +52,7 @@ module RelatonIec
|
|
52
52
|
# @option opts [String] :lang language
|
53
53
|
# @return [String] XML
|
54
54
|
def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
55
|
-
super
|
55
|
+
super(**opts) do |b|
|
56
56
|
if opts[:bibdata]
|
57
57
|
b.ext do
|
58
58
|
b.doctype doctype if doctype
|
@@ -63,16 +63,16 @@ module RelatonIec
|
|
63
63
|
structuredidentifier&.to_xml b
|
64
64
|
b.stagename stagename if stagename
|
65
65
|
if updates_document_type
|
66
|
-
b.send("updates-document-type", updates_document_type)
|
66
|
+
b.send(:"updates-document-type", updates_document_type)
|
67
67
|
end
|
68
68
|
unless accessibility_color_inside.nil?
|
69
|
-
b.send("accessibility-color-inside", accessibility_color_inside)
|
69
|
+
b.send(:"accessibility-color-inside", accessibility_color_inside)
|
70
70
|
end
|
71
|
-
b.send("price-code", price_code) if price_code
|
72
|
-
b.send("cen-processing", cen_processing) unless cen_processing.nil?
|
71
|
+
b.send(:"price-code", price_code) if price_code
|
72
|
+
b.send(:"cen-processing", cen_processing) unless cen_processing.nil?
|
73
73
|
b.secretary secretary if secretary
|
74
74
|
if interest_to_committees
|
75
|
-
b.send("interest-to-committees", interest_to_committees)
|
75
|
+
b.send(:"interest-to-committees", interest_to_committees)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
@@ -58,19 +58,19 @@ module RelatonIec
|
|
58
58
|
def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
|
59
59
|
id = year ? "#{code}:#{year}" : code
|
60
60
|
warn "[relaton-iec] WARNING: no match found online for #{id}. "\
|
61
|
-
|
61
|
+
"The code must be exactly like it is on the standards website."
|
62
62
|
unless missed_years.empty?
|
63
63
|
warn "[relaton-iec] (There was no match for #{year}, though there "\
|
64
|
-
|
64
|
+
"were matches found for #{missed_years.join(', ')}.)"
|
65
65
|
end
|
66
66
|
if /\d-\d/.match? code
|
67
67
|
warn "[relaton-iec] The provided document part may not exist, or "\
|
68
|
-
|
68
|
+
"the document may no longer be published in parts."
|
69
69
|
else
|
70
70
|
warn "[relaton-iec] If you wanted to cite all document parts for "\
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
"the reference, use \"#{code} (all parts)\".\nIf the document "\
|
72
|
+
"is not a standard, use its document type abbreviation (TS, "\
|
73
|
+
"TR, PAS, Guide)."
|
74
74
|
end
|
75
75
|
nil
|
76
76
|
end
|
@@ -91,7 +91,7 @@ module RelatonIec
|
|
91
91
|
# @return [RelatonIec::HitCollection]
|
92
92
|
def search_filter(ref, year) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
93
93
|
%r{
|
94
|
-
^(?<code>\S+[^\d]*\s\d+(?:-\w+)*)
|
94
|
+
^(?<code>\S+[^\d]*\s\d+(?:-\w+)*(?:\s[A-Z]+)?)
|
95
95
|
(?::(?<year1>\d{4}))?
|
96
96
|
(?<bundle>\+[^\s/]+)?
|
97
97
|
(?:/(?<corr>AMD\s\d+))?
|
@@ -106,10 +106,10 @@ module RelatonIec
|
|
106
106
|
end
|
107
107
|
result = search code if result.empty?
|
108
108
|
code = result.text.dup
|
109
|
-
code&.sub!(/(
|
109
|
+
code&.sub!(/(?:-\w+)+(?:\s[A-Z]+)?/, "")
|
110
110
|
result.select do |i|
|
111
111
|
%r{
|
112
|
-
^(?<code2>\S+[^\d]*\s\d+)(?:-\w+)*(?::\d{4})?
|
112
|
+
^(?<code2>\S+[^\d]*\s\d+)(?:-\w+)*(?:\s[A-Z]+)?(?::\d{4})?
|
113
113
|
(?<bundle2>\+[^\s/]+)?
|
114
114
|
(?:/(?<corr2>AMD\d+))?
|
115
115
|
}x =~ i.hit[:code]
|
@@ -191,8 +191,8 @@ module RelatonIec
|
|
191
191
|
# @return [Array<String, nil>]
|
192
192
|
def code_year(ref, part)
|
193
193
|
%r{
|
194
|
-
^(?<code>\S+[^\d]*\s\d+(
|
195
|
-
(
|
194
|
+
^(?<code>\S+[^\d]*\s\d+(?:-\w+)*)
|
195
|
+
(?::(?<year>\d{4}))?
|
196
196
|
}x =~ ref
|
197
197
|
code.sub!(/-\d+/, "") if part
|
198
198
|
[code, year]
|
data/lib/relaton_iec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- grammars/isodoc.rng
|
176
176
|
- grammars/isostandard.rng
|
177
177
|
- grammars/reqt.rng
|
178
|
+
- lib/data/61360-4_DB.yaml
|
178
179
|
- lib/relaton_iec.rb
|
179
180
|
- lib/relaton_iec/basic_block/alignment.rb
|
180
181
|
- lib/relaton_iec/basic_block/basic_block.rb
|