relaton-bsi 1.8.1 → 1.9.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/rake.yml +1 -11
- data/.rubocop.yml +1 -1
- data/README.adoc +7 -7
- data/grammars/biblio.rng +1 -0
- data/grammars/bsi.rng +30 -18
- data/grammars/isodoc.rng +246 -10
- data/grammars/isostandard.rng +19 -3
- data/grammars/reqt.rng +31 -2
- data/lib/relaton_bsi/bsi_bibliographic_item.rb +13 -14
- data/lib/relaton_bsi/bsi_bibliography.rb +8 -15
- data/lib/relaton_bsi/hit_collection.rb +24 -13
- data/lib/relaton_bsi/processor.rb +1 -1
- data/lib/relaton_bsi/schema.json +24882 -0
- data/lib/relaton_bsi/scrapper.rb +137 -78
- data/lib/relaton_bsi/version.rb +1 -1
- data/lib/relaton_bsi/xml_parser.rb +1 -3
- data/relaton_bsi.gemspec +5 -11
- metadata +23 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7956b847d798601ca7e8d1f0d08ad59ff0904f9b8319bfff428a3365f686af67
|
4
|
+
data.tar.gz: 4b33279c2c90e6be9cf718fd4770de6ca067d7a890b018b61350f0a3f644b92e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f93174899ac9ad8ae5462c127dfee8213703a1721d660875e4d3e548134b3001dbc7756f607f2923d2583979a1a8c416c90d741903be125ac36e3a20ca197918
|
7
|
+
data.tar.gz: 285774c1eee290f9fb18af06b9f256bd80357c8ceef98189eb9c5fc022850809bc87e6efdb60ecd46ad083703b5850f8de7aa35184c0c4645beca31ac8b44090
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
@@ -33,7 +33,7 @@ Or install it yourself as:
|
|
33
33
|
----
|
34
34
|
require 'relaton_bsi'
|
35
35
|
|
36
|
-
hit_collection = RelatonBsi::BsiBibliography.search("
|
36
|
+
hit_collection = RelatonBsi::BsiBibliography.search("BS EN ISO 8848")
|
37
37
|
=> <RelatonBsi::HitCollection:0x007fead49fe1f8 @ref=BS EN ISO 8848 @fetched=false>
|
38
38
|
|
39
39
|
item = hit_collection[1].fetch
|
@@ -118,15 +118,15 @@ item.to_xml bibdata: true
|
|
118
118
|
[source,ruby]
|
119
119
|
----
|
120
120
|
RelatonBsi::BsiBibliographicItem RelatonBsi::BsiBibliography
|
121
|
-
[7] pry(main)> RelatonBsi::BsiBibliography.get "
|
122
|
-
[relaton-bsi] ("
|
123
|
-
[relaton-bsi] ("
|
121
|
+
[7] pry(main)> RelatonBsi::BsiBibliography.get "BS EN ISO 8848:2021"
|
122
|
+
[relaton-bsi] ("BS EN ISO 8848:2021") fetching...
|
123
|
+
[relaton-bsi] ("BS EN ISO 8848:2021") found BS EN ISO 8848:2021
|
124
124
|
=> #<RelatonBsi::BsiBibliographicItem:0x007feb14814ca8
|
125
125
|
...
|
126
126
|
|
127
|
-
RelatonBsi::BsiBibliography.get "
|
128
|
-
[relaton-bsi] ("
|
129
|
-
[relaton-bsi] ("
|
127
|
+
RelatonBsi::BsiBibliography.get "BS EN ISO 8848", "2021"
|
128
|
+
[relaton-bsi] ("BS EN ISO 8848") fetching...
|
129
|
+
[relaton-bsi] ("BS EN ISO 8848") found BS EN ISO 8848:2021
|
130
130
|
=> #<RelatonBsi::BsiBibliographicItem:0x007feaf59188a8
|
131
131
|
...
|
132
132
|
----
|
data/grammars/biblio.rng
CHANGED
data/grammars/bsi.rng
CHANGED
@@ -7,18 +7,36 @@
|
|
7
7
|
</start>
|
8
8
|
<define name="DocumentType">
|
9
9
|
<choice>
|
10
|
-
<value>
|
11
|
-
<value>
|
12
|
-
<value>
|
10
|
+
<value>british-standard</value>
|
11
|
+
<value>draft-for-development</value>
|
12
|
+
<value>published-document</value>
|
13
|
+
<value>privately-subscribed-standard</value>
|
14
|
+
<value>publicly-available-specification</value>
|
15
|
+
<value>flex-standard</value>
|
16
|
+
<value>international-standard</value>
|
17
|
+
<value>technical-specification</value>
|
18
|
+
<value>technical-report</value>
|
13
19
|
<value>guide</value>
|
20
|
+
<value>international-workshop-agreement</value>
|
21
|
+
<value>industry-technical-agreement</value>
|
22
|
+
<value>standard</value>
|
23
|
+
<value>european-workshop-agreement</value>
|
24
|
+
</choice>
|
25
|
+
</define>
|
26
|
+
<define name="DocumentSubtype">
|
27
|
+
<choice>
|
28
|
+
<value>specification</value>
|
14
29
|
<value>method-of-test</value>
|
15
30
|
<value>method-of-specifying</value>
|
16
31
|
<value>vocabulary</value>
|
17
|
-
<value>
|
32
|
+
<value>code-of-practice</value>
|
18
33
|
</choice>
|
19
34
|
</define>
|
20
35
|
<define name="BibDataExtensionType">
|
21
36
|
<ref name="doctype"/>
|
37
|
+
<optional>
|
38
|
+
<ref name="docsubtype"/>
|
39
|
+
</optional>
|
22
40
|
<ref name="editorialgroup"/>
|
23
41
|
<zeroOrMore>
|
24
42
|
<ref name="ics"/>
|
@@ -27,12 +45,9 @@
|
|
27
45
|
<optional>
|
28
46
|
<ref name="stagename"/>
|
29
47
|
</optional>
|
30
|
-
<
|
31
|
-
<ref name="
|
32
|
-
</
|
33
|
-
<optional>
|
34
|
-
<ref name="cen-processing"/>
|
35
|
-
</optional>
|
48
|
+
<zeroOrMore>
|
49
|
+
<ref name="coverimages"/>
|
50
|
+
</zeroOrMore>
|
36
51
|
</define>
|
37
52
|
<define name="admonition">
|
38
53
|
<element name="admonition">
|
@@ -71,14 +86,11 @@
|
|
71
86
|
<define name="AdmonitionType" combine="choice">
|
72
87
|
<value>commentary</value>
|
73
88
|
</define>
|
74
|
-
<define name="
|
75
|
-
<element name="
|
76
|
-
<
|
77
|
-
|
78
|
-
|
79
|
-
<define name="cen-processing">
|
80
|
-
<element name="cen-processing">
|
81
|
-
<data type="boolean"/>
|
89
|
+
<define name="coverimages">
|
90
|
+
<element name="coverimages">
|
91
|
+
<oneOrMore>
|
92
|
+
<ref name="image"/>
|
93
|
+
</oneOrMore>
|
82
94
|
</element>
|
83
95
|
</define>
|
84
96
|
<!--
|
data/grammars/isodoc.rng
CHANGED
@@ -45,6 +45,11 @@
|
|
45
45
|
<optional>
|
46
46
|
<attribute name="alt"/>
|
47
47
|
</optional>
|
48
|
+
<optional>
|
49
|
+
<attribute name="updatetype">
|
50
|
+
<data type="boolean"/>
|
51
|
+
</attribute>
|
52
|
+
</optional>
|
48
53
|
<text/>
|
49
54
|
</element>
|
50
55
|
</define>
|
@@ -199,6 +204,18 @@
|
|
199
204
|
</zeroOrMore>
|
200
205
|
</element>
|
201
206
|
</define>
|
207
|
+
<define name="dt">
|
208
|
+
<element name="dt">
|
209
|
+
<optional>
|
210
|
+
<attribute name="id">
|
211
|
+
<data type="ID"/>
|
212
|
+
</attribute>
|
213
|
+
</optional>
|
214
|
+
<zeroOrMore>
|
215
|
+
<ref name="TextElement"/>
|
216
|
+
</zeroOrMore>
|
217
|
+
</element>
|
218
|
+
</define>
|
202
219
|
<define name="example">
|
203
220
|
<element name="example">
|
204
221
|
<attribute name="id">
|
@@ -543,6 +560,9 @@
|
|
543
560
|
</define>
|
544
561
|
<define name="BibDataExtensionType">
|
545
562
|
<ref name="doctype"/>
|
563
|
+
<optional>
|
564
|
+
<ref name="docsubtype"/>
|
565
|
+
</optional>
|
546
566
|
<optional>
|
547
567
|
<ref name="editorialgroup"/>
|
548
568
|
</optional>
|
@@ -876,8 +896,28 @@
|
|
876
896
|
</zeroOrMore>
|
877
897
|
</element>
|
878
898
|
</define>
|
899
|
+
<define name="pagebreak">
|
900
|
+
<element name="pagebreak">
|
901
|
+
<optional>
|
902
|
+
<attribute name="orientation">
|
903
|
+
<choice>
|
904
|
+
<value>landscape</value>
|
905
|
+
<value>portrait</value>
|
906
|
+
</choice>
|
907
|
+
</attribute>
|
908
|
+
</optional>
|
909
|
+
</element>
|
910
|
+
</define>
|
879
911
|
</include>
|
880
912
|
<!-- end overrides -->
|
913
|
+
<define name="docsubtype">
|
914
|
+
<element name="subdoctype">
|
915
|
+
<ref name="DocumentSubtype"/>
|
916
|
+
</element>
|
917
|
+
</define>
|
918
|
+
<define name="DocumentSubtype">
|
919
|
+
<text/>
|
920
|
+
</define>
|
881
921
|
<define name="colgroup">
|
882
922
|
<element name="colgroup">
|
883
923
|
<oneOrMore>
|
@@ -927,7 +967,34 @@
|
|
927
967
|
<define name="concept">
|
928
968
|
<element name="concept">
|
929
969
|
<optional>
|
930
|
-
<attribute name="
|
970
|
+
<attribute name="ital">
|
971
|
+
<data type="boolean"/>
|
972
|
+
</attribute>
|
973
|
+
</optional>
|
974
|
+
<optional>
|
975
|
+
<attribute name="ref">
|
976
|
+
<data type="boolean"/>
|
977
|
+
</attribute>
|
978
|
+
</optional>
|
979
|
+
<optional>
|
980
|
+
<element name="refterm">
|
981
|
+
<zeroOrMore>
|
982
|
+
<choice>
|
983
|
+
<ref name="PureTextElement"/>
|
984
|
+
<ref name="stem"/>
|
985
|
+
</choice>
|
986
|
+
</zeroOrMore>
|
987
|
+
</element>
|
988
|
+
</optional>
|
989
|
+
<optional>
|
990
|
+
<element name="renderterm">
|
991
|
+
<zeroOrMore>
|
992
|
+
<choice>
|
993
|
+
<ref name="PureTextElement"/>
|
994
|
+
<ref name="stem"/>
|
995
|
+
</choice>
|
996
|
+
</zeroOrMore>
|
997
|
+
</element>
|
931
998
|
</optional>
|
932
999
|
<choice>
|
933
1000
|
<ref name="eref"/>
|
@@ -943,8 +1010,173 @@
|
|
943
1010
|
<ref name="permission"/>
|
944
1011
|
<ref name="imagemap"/>
|
945
1012
|
<ref name="svgmap"/>
|
1013
|
+
<ref name="inputform"/>
|
946
1014
|
</choice>
|
947
1015
|
</define>
|
1016
|
+
<define name="inputform">
|
1017
|
+
<element name="form">
|
1018
|
+
<attribute name="id">
|
1019
|
+
<data type="ID"/>
|
1020
|
+
</attribute>
|
1021
|
+
<attribute name="name"/>
|
1022
|
+
<attribute name="action"/>
|
1023
|
+
<optional>
|
1024
|
+
<attribute name="class"/>
|
1025
|
+
</optional>
|
1026
|
+
<zeroOrMore>
|
1027
|
+
<choice>
|
1028
|
+
<ref name="TextElement"/>
|
1029
|
+
<ref name="FormInput"/>
|
1030
|
+
</choice>
|
1031
|
+
</zeroOrMore>
|
1032
|
+
</element>
|
1033
|
+
</define>
|
1034
|
+
<define name="FormInput">
|
1035
|
+
<choice>
|
1036
|
+
<ref name="input"/>
|
1037
|
+
<ref name="formlabel"/>
|
1038
|
+
<ref name="select"/>
|
1039
|
+
<ref name="textarea"/>
|
1040
|
+
</choice>
|
1041
|
+
</define>
|
1042
|
+
<define name="InputType">
|
1043
|
+
<choice>
|
1044
|
+
<value>button</value>
|
1045
|
+
<value>checkbox</value>
|
1046
|
+
<value>date</value>
|
1047
|
+
<value>file</value>
|
1048
|
+
<value>password</value>
|
1049
|
+
<value>radio</value>
|
1050
|
+
<value>submit</value>
|
1051
|
+
<value>text</value>
|
1052
|
+
</choice>
|
1053
|
+
</define>
|
1054
|
+
<define name="input">
|
1055
|
+
<element name="input">
|
1056
|
+
<attribute name="type">
|
1057
|
+
<ref name="InputType"/>
|
1058
|
+
</attribute>
|
1059
|
+
<optional>
|
1060
|
+
<attribute name="checked">
|
1061
|
+
<data type="boolean"/>
|
1062
|
+
</attribute>
|
1063
|
+
</optional>
|
1064
|
+
<optional>
|
1065
|
+
<attribute name="disabled">
|
1066
|
+
<data type="boolean"/>
|
1067
|
+
</attribute>
|
1068
|
+
</optional>
|
1069
|
+
<optional>
|
1070
|
+
<attribute name="readonly">
|
1071
|
+
<data type="boolean"/>
|
1072
|
+
</attribute>
|
1073
|
+
</optional>
|
1074
|
+
<optional>
|
1075
|
+
<attribute name="maxlength">
|
1076
|
+
<data type="int"/>
|
1077
|
+
</attribute>
|
1078
|
+
</optional>
|
1079
|
+
<optional>
|
1080
|
+
<attribute name="minlength">
|
1081
|
+
<data type="int"/>
|
1082
|
+
</attribute>
|
1083
|
+
</optional>
|
1084
|
+
<optional>
|
1085
|
+
<attribute name="name"/>
|
1086
|
+
</optional>
|
1087
|
+
<optional>
|
1088
|
+
<attribute name="value"/>
|
1089
|
+
</optional>
|
1090
|
+
<optional>
|
1091
|
+
<attribute name="id">
|
1092
|
+
<data type="ID"/>
|
1093
|
+
</attribute>
|
1094
|
+
</optional>
|
1095
|
+
</element>
|
1096
|
+
</define>
|
1097
|
+
<define name="formlabel">
|
1098
|
+
<element name="label">
|
1099
|
+
<attribute name="for">
|
1100
|
+
<data type="IDREF"/>
|
1101
|
+
</attribute>
|
1102
|
+
<zeroOrMore>
|
1103
|
+
<ref name="PureTextElement"/>
|
1104
|
+
</zeroOrMore>
|
1105
|
+
</element>
|
1106
|
+
</define>
|
1107
|
+
<define name="select">
|
1108
|
+
<element name="select">
|
1109
|
+
<optional>
|
1110
|
+
<attribute name="name"/>
|
1111
|
+
</optional>
|
1112
|
+
<optional>
|
1113
|
+
<attribute name="value"/>
|
1114
|
+
</optional>
|
1115
|
+
<optional>
|
1116
|
+
<attribute name="id">
|
1117
|
+
<data type="ID"/>
|
1118
|
+
</attribute>
|
1119
|
+
</optional>
|
1120
|
+
<optional>
|
1121
|
+
<attribute name="disabled">
|
1122
|
+
<data type="boolean"/>
|
1123
|
+
</attribute>
|
1124
|
+
</optional>
|
1125
|
+
<optional>
|
1126
|
+
<attribute name="multiple">
|
1127
|
+
<data type="boolean"/>
|
1128
|
+
</attribute>
|
1129
|
+
</optional>
|
1130
|
+
<optional>
|
1131
|
+
<attribute name="size">
|
1132
|
+
<data type="int"/>
|
1133
|
+
</attribute>
|
1134
|
+
</optional>
|
1135
|
+
<oneOrMore>
|
1136
|
+
<ref name="option"/>
|
1137
|
+
</oneOrMore>
|
1138
|
+
</element>
|
1139
|
+
</define>
|
1140
|
+
<define name="option">
|
1141
|
+
<element name="option">
|
1142
|
+
<optional>
|
1143
|
+
<attribute name="disabled">
|
1144
|
+
<data type="boolean"/>
|
1145
|
+
</attribute>
|
1146
|
+
</optional>
|
1147
|
+
<optional>
|
1148
|
+
<attribute name="value"/>
|
1149
|
+
</optional>
|
1150
|
+
<zeroOrMore>
|
1151
|
+
<ref name="PureTextElement"/>
|
1152
|
+
</zeroOrMore>
|
1153
|
+
</element>
|
1154
|
+
</define>
|
1155
|
+
<define name="textarea">
|
1156
|
+
<element name="textarea">
|
1157
|
+
<optional>
|
1158
|
+
<attribute name="name"/>
|
1159
|
+
</optional>
|
1160
|
+
<optional>
|
1161
|
+
<attribute name="value"/>
|
1162
|
+
</optional>
|
1163
|
+
<optional>
|
1164
|
+
<attribute name="id">
|
1165
|
+
<data type="ID"/>
|
1166
|
+
</attribute>
|
1167
|
+
</optional>
|
1168
|
+
<optional>
|
1169
|
+
<attribute name="rows">
|
1170
|
+
<data type="int"/>
|
1171
|
+
</attribute>
|
1172
|
+
</optional>
|
1173
|
+
<optional>
|
1174
|
+
<attribute name="cols">
|
1175
|
+
<data type="int"/>
|
1176
|
+
</attribute>
|
1177
|
+
</optional>
|
1178
|
+
</element>
|
1179
|
+
</define>
|
948
1180
|
<define name="bibliography">
|
949
1181
|
<element name="bibliography">
|
950
1182
|
<oneOrMore>
|
@@ -1017,13 +1249,17 @@
|
|
1017
1249
|
</define>
|
1018
1250
|
<define name="IsoWorkgroup">
|
1019
1251
|
<optional>
|
1020
|
-
<attribute name="number"
|
1021
|
-
<data type="int"/>
|
1022
|
-
</attribute>
|
1252
|
+
<attribute name="number"/>
|
1023
1253
|
</optional>
|
1024
1254
|
<optional>
|
1025
1255
|
<attribute name="type"/>
|
1026
1256
|
</optional>
|
1257
|
+
<optional>
|
1258
|
+
<attribute name="identifier"/>
|
1259
|
+
</optional>
|
1260
|
+
<optional>
|
1261
|
+
<attribute name="prefix"/>
|
1262
|
+
</optional>
|
1027
1263
|
<text/>
|
1028
1264
|
</define>
|
1029
1265
|
<define name="ics">
|
@@ -1285,26 +1521,26 @@
|
|
1285
1521
|
<optional>
|
1286
1522
|
<ref name="section-title"/>
|
1287
1523
|
</optional>
|
1288
|
-
<
|
1524
|
+
<choice>
|
1289
1525
|
<choice>
|
1290
1526
|
<group>
|
1291
|
-
<
|
1527
|
+
<oneOrMore>
|
1292
1528
|
<ref name="BasicBlock"/>
|
1293
|
-
</
|
1529
|
+
</oneOrMore>
|
1294
1530
|
<zeroOrMore>
|
1295
1531
|
<ref name="note"/>
|
1296
1532
|
</zeroOrMore>
|
1297
1533
|
</group>
|
1298
1534
|
<ref name="amend"/>
|
1299
1535
|
</choice>
|
1300
|
-
<
|
1536
|
+
<oneOrMore>
|
1301
1537
|
<choice>
|
1302
1538
|
<ref name="clause-subsection"/>
|
1303
1539
|
<ref name="terms"/>
|
1304
1540
|
<ref name="definitions"/>
|
1305
1541
|
</choice>
|
1306
|
-
</
|
1307
|
-
</
|
1542
|
+
</oneOrMore>
|
1543
|
+
</choice>
|
1308
1544
|
</define>
|
1309
1545
|
<define name="Annex-Section">
|
1310
1546
|
<optional>
|