relaton-calconnect 1.20.1 → 2.0.0.pre.alpha.1
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/.rubocop.yml +1 -1
- data/README.adoc +32 -38
- data/grammars/basicdoc.rng +1559 -671
- data/grammars/biblio-standoc.rng +107 -46
- data/grammars/biblio.rng +1010 -375
- data/grammars/relaton-cc.rng +0 -30
- data/lib/{relaton_calconnect/cc_bibliography.rb → relaton/calconnect/bibliography.rb} +7 -7
- data/lib/{relaton_calconnect → relaton/calconnect}/data_fetcher.rb +26 -39
- data/lib/relaton/calconnect/hit.rb +14 -0
- data/lib/{relaton_calconnect → relaton/calconnect}/hit_collection.rb +4 -5
- data/lib/relaton/calconnect/item_data.rb +12 -0
- data/lib/relaton/calconnect/model/bibdata.rb +7 -0
- data/lib/relaton/calconnect/model/bibitem.rb +7 -0
- data/lib/relaton/calconnect/model/doctype.rb +11 -0
- data/lib/relaton/calconnect/model/ext.rb +16 -0
- data/lib/relaton/calconnect/model/item.rb +13 -0
- data/lib/{relaton_calconnect → relaton/calconnect}/processor.rb +18 -12
- data/lib/relaton/calconnect/scraper.rb +268 -0
- data/lib/relaton/calconnect/util.rb +8 -0
- data/lib/relaton/calconnect/version.rb +5 -0
- data/lib/relaton/calconnect.rb +26 -0
- data/relaton_calconnect.gemspec +9 -8
- metadata +39 -27
- data/lib/relaton_calconnect/cc_bibliographic_item.rb +0 -19
- data/lib/relaton_calconnect/document_type.rb +0 -19
- data/lib/relaton_calconnect/hash_converter.rb +0 -21
- data/lib/relaton_calconnect/hit.rb +0 -14
- data/lib/relaton_calconnect/scrapper.rb +0 -111
- data/lib/relaton_calconnect/technical_committee.rb +0 -8
- data/lib/relaton_calconnect/util.rb +0 -6
- data/lib/relaton_calconnect/version.rb +0 -3
- data/lib/relaton_calconnect/xml_parser.rb +0 -29
- data/lib/relaton_calconnect.rb +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 803e07dc91ba1ffdfe2c89f5606cc459f6516bb9eb1c04e075a27870f57c5275
|
|
4
|
+
data.tar.gz: c3968d159b71bcc5bd2e4a89018ccc5764397670b99619c9d00e3fad7337859c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61e15b91ccd5f635805b2ef5b4c33f0c1cd4b8a05fd55ca8972ac1107f4f2f87f8b6ff707d157571c4334aa4f6c1ad1d5ae79623b923e1b2d6fbb40f7549e740
|
|
7
|
+
data.tar.gz: fda1c744d76894938b77cb9c5e97f665c993d1252353357a3192ed4e559d99f3ab7d5af7f413e93e75cc7b9b84b16a2209347822dfa1d1d01614972c6beeb2dd
|
data/.rubocop.yml
CHANGED
data/README.adoc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Relaton::Calconnect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Relaton::Calconnect is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-iso#iso-bibliographic-item[IsoBibliographicItem model].
|
|
4
4
|
|
|
5
5
|
You can use it to retrieve metadata of Calconnect Standards from https://standards.calconnect.org, and access such metadata through the `CcBibliographicItem` object.
|
|
6
6
|
|
|
@@ -27,14 +27,14 @@ Or install it yourself as:
|
|
|
27
27
|
|
|
28
28
|
[source,ruby]
|
|
29
29
|
----
|
|
30
|
-
require '
|
|
30
|
+
require 'relaton/calconnect'
|
|
31
31
|
=> true
|
|
32
32
|
|
|
33
|
-
hits =
|
|
34
|
-
=> <
|
|
33
|
+
hits = Relaton::Calconnect::Bibliography.search("CC/DIR 10005:2019")
|
|
34
|
+
=> <Relaton::Calconnect::HitCollection:0x00000000002df0 @ref=CC/DIR 10005:2019 @fetched=false>
|
|
35
35
|
|
|
36
|
-
item = hits[0].
|
|
37
|
-
=> #<
|
|
36
|
+
item = hits[0].item
|
|
37
|
+
=> #<Relaton::Calconnect::ItemData:0x000000011104c998
|
|
38
38
|
...
|
|
39
39
|
----
|
|
40
40
|
|
|
@@ -43,10 +43,9 @@ item = hits[0].fetch
|
|
|
43
43
|
[source,ruby]
|
|
44
44
|
----
|
|
45
45
|
item.to_xml
|
|
46
|
-
=> "<bibitem id="CC-DIR10005-2019" type="standard" schema-version="v1.
|
|
47
|
-
<title
|
|
48
|
-
<
|
|
49
|
-
<uri type="pdf">https://standards.calconnect.org/csd/cc-10005.pdf</uri>
|
|
46
|
+
=> "<bibitem id="CC-DIR10005-2019" type="standard" schema-version="v1.4.1">
|
|
47
|
+
<title language="en">Guidelines for the implementation of the CalConnect patent policy</title>
|
|
48
|
+
<docidentifier type="CalConnect" primary="true">CC/DIR 10005:2019</docidentifier>
|
|
50
49
|
...
|
|
51
50
|
</bibitem>"
|
|
52
51
|
----
|
|
@@ -54,17 +53,15 @@ With argument `bibdata: true` it outputs XML wrapped by `bibdata` element and ad
|
|
|
54
53
|
[source,ruby]
|
|
55
54
|
----
|
|
56
55
|
item.to_xml bibdata: true
|
|
57
|
-
=> "<bibdata type="standard" schema-version="v1.
|
|
58
|
-
<title
|
|
59
|
-
<
|
|
56
|
+
=> "<bibdata type="standard" schema-version="v1.4.1">
|
|
57
|
+
<title language="en">Guidelines for the implementation of the CalConnect patent policy</title>
|
|
58
|
+
<docidentifier type="CalConnect" primary="true">CC/DIR 10005:2019</docidentifier>
|
|
60
59
|
...
|
|
61
60
|
<ext schema-version="v1.0.0">
|
|
62
|
-
<doctype>directive</doctype>
|
|
63
|
-
<
|
|
64
|
-
<committee>PUBLISH</committee>
|
|
65
|
-
</editorialgroup>
|
|
61
|
+
<doctype abbreviation="DIR">directive</doctype>
|
|
62
|
+
<flavor>calconnect</flavor>
|
|
66
63
|
</ext>
|
|
67
|
-
|
|
64
|
+
</bibdata>
|
|
68
65
|
----
|
|
69
66
|
|
|
70
67
|
=== Typed links
|
|
@@ -79,41 +76,37 @@ Each Calconnect document has link types:
|
|
|
79
76
|
|
|
80
77
|
[source,ruby]
|
|
81
78
|
----
|
|
82
|
-
item.
|
|
83
|
-
=> [#<
|
|
84
|
-
#<
|
|
85
|
-
#<
|
|
86
|
-
#<
|
|
87
|
-
#<
|
|
79
|
+
item.source
|
|
80
|
+
=> [#<Relaton::Bib::Uri:0x00007ff2d4b009e0 @content=#<Addressable::URI:0x668 URI:https://standards.calconnect.org/csd/cc-10005.xml>, @type="xml">,
|
|
81
|
+
#<Relaton::Bib::Uri:0x00007ff2d4b00378 @content=#<Addressable::URI:0x67c URI:https://standards.calconnect.org/csd/cc-10005.pdf>, @type="pdf">,
|
|
82
|
+
#<Relaton::Bib::Uri:0x00007ff2d4b00058 @content=#<Addressable::URI:0x690 URI:https://standards.calconnect.org/csd/cc-10005.doc>, @type="doc">,
|
|
83
|
+
#<Relaton::Bib::Uri:0x00007ff2d4b23d28 @content=#<Addressable::URI:0x6a4 URI:https://standards.calconnect.org/csd/cc-10005.html>, @type="html">,
|
|
84
|
+
#<Relaton::Bib::Uri:0x00007ff2d4b23a08 @content=#<Addressable::URI:0x6b8 URI:https://standards.calconnect.org/csd/cc-10005.rxl>, @type="rxl">]
|
|
88
85
|
----
|
|
89
86
|
|
|
90
87
|
=== Get document by code and year
|
|
91
88
|
[source,ruby]
|
|
92
89
|
----
|
|
93
|
-
|
|
94
|
-
[relaton-calconnect] (CC/DIR 10005) Fetching from Relaton repository ...
|
|
95
|
-
[relaton-calconnect] (CC/DIR 10005) Found: `CC/DIR 10005:2019`
|
|
96
|
-
=> #<
|
|
90
|
+
Relaton::Calconnect::Bibliography.get "CC/DIR 10005", "2019"
|
|
91
|
+
[relaton-calconnect] INFO: (CC/DIR 10005) Fetching from Relaton repository ...
|
|
92
|
+
[relaton-calconnect] INFO: (CC/DIR 10005) Found: `CC/DIR 10005:2019`
|
|
93
|
+
=> #<Relaton::Calconnect::ItemData:0x0000000111944b18
|
|
97
94
|
...
|
|
98
95
|
----
|
|
99
96
|
|
|
100
97
|
=== Create bibliographic item from XML
|
|
101
98
|
[source,ruby]
|
|
102
99
|
----
|
|
103
|
-
|
|
104
|
-
=> #<
|
|
100
|
+
Relaton::Calconnect::Item.from_xml File.read('spec/fixtures/cc_dir_10005_2019.xml')
|
|
101
|
+
=> #<Relaton::Calconnect::ItemData:0x000000010ec81040
|
|
105
102
|
...
|
|
106
103
|
----
|
|
107
104
|
|
|
108
105
|
=== Create bibliographic item from YAML
|
|
109
106
|
[source,ruby]
|
|
110
107
|
----
|
|
111
|
-
|
|
112
|
-
=>
|
|
113
|
-
...
|
|
114
|
-
|
|
115
|
-
RelatonCalconnect::CcBibliographicItem.from_hash hash
|
|
116
|
-
=> #<RelatonCalconnect::CcBibliographicItem:0x007fc5a0109f88
|
|
108
|
+
Relaton::Calconnect::Item.from_yaml File.read('spec/fixtures/item.yaml')
|
|
109
|
+
=> #<Relaton::Calconnect::ItemData:0x000000010fe5e600
|
|
117
110
|
...
|
|
118
111
|
----
|
|
119
112
|
|
|
@@ -129,7 +122,8 @@ Arguments:
|
|
|
129
122
|
|
|
130
123
|
[source,ruby]
|
|
131
124
|
----
|
|
132
|
-
|
|
125
|
+
require "relaton/calconnect/data_fetcher"
|
|
126
|
+
Relaton::Calconnect::DataFetcher.fetch
|
|
133
127
|
Started at: 2021-09-09 16:03:51 +0200
|
|
134
128
|
Stopped at: 2021-09-09 16:04:12 +0200
|
|
135
129
|
Done in: 20 sec.
|