isobib 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +10 -1
- data/Gemfile.lock +6 -6
- data/README.adoc +4 -4
- data/lib/isobib/iso_bibliography.rb +4 -4
- data/lib/isobib/scrapper.rb +1 -1
- data/lib/isobib/version.rb +1 -1
- data/lib/isobib.rb +4 -0
- data/lib/relaton/processor.rb +17 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e4b911fb007256f7871d81b0a2f1a16f4b5cb647
|
4
|
+
data.tar.gz: ca0cb5a9451254fd7d031393d8110ad7eb929a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed668d50ba8aefa7d96905859e3b95a3c030796e58c2fcc65c5b68a08a6f436ee210278661ca8445c071482afa1e3fb126928d495108eef734bbb7ac36ff0f74
|
7
|
+
data.tar.gz: aab7cf7186ae45f654392dbfc47d9f9fb4ac880e9412fb5f690dd41a8a134ce7435b8356a2ee6fd15a2b6e488032ac8491e66b9033ba4c8c33b6ec8c62d52f9f
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
isobib (0.1.
|
4
|
+
isobib (0.1.10)
|
5
5
|
algoliasearch
|
6
6
|
iso-bib-item (~> 0.1.10)
|
7
7
|
|
@@ -15,19 +15,18 @@ GEM
|
|
15
15
|
coderay (1.1.2)
|
16
16
|
diff-lcs (1.3)
|
17
17
|
docile (1.3.1)
|
18
|
-
duplicate (1.1.1)
|
19
18
|
equivalent-xml (0.6.0)
|
20
19
|
nokogiri (>= 1.4.3)
|
21
20
|
httpclient (2.8.3)
|
22
|
-
iso-bib-item (0.1.
|
23
|
-
duplicate
|
21
|
+
iso-bib-item (0.1.11)
|
24
22
|
isoics (~> 0.1.6)
|
25
|
-
nokogiri
|
23
|
+
nokogiri (~> 1.8.4)
|
24
|
+
ruby_deep_clone (~> 0.8.0)
|
26
25
|
isoics (0.1.6)
|
27
26
|
json (2.1.0)
|
28
27
|
method_source (0.9.0)
|
29
28
|
mini_portile2 (2.3.0)
|
30
|
-
nokogiri (1.8.
|
29
|
+
nokogiri (1.8.4)
|
31
30
|
mini_portile2 (~> 2.3.0)
|
32
31
|
pry (0.11.3)
|
33
32
|
coderay (~> 1.1.0)
|
@@ -49,6 +48,7 @@ GEM
|
|
49
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
50
49
|
rspec-support (~> 3.7.0)
|
51
50
|
rspec-support (3.7.1)
|
51
|
+
ruby_deep_clone (0.8.0)
|
52
52
|
simplecov (0.16.1)
|
53
53
|
docile (~> 1.1)
|
54
54
|
json (>= 1.8, < 3)
|
data/README.adoc
CHANGED
@@ -51,9 +51,9 @@ item.to_xml
|
|
51
51
|
=>"<bibitem type='international-standard' id='ISO19115-1'>
|
52
52
|
<title format='text/plain' language='en' script='Latn'>Geographic information -- Metadata -- Part 1: Fundamentals</title>
|
53
53
|
<title format='text/plain' language='fr' script='Latn'>Information géographique -- Métadonnées -- Partie 1: Principes de base</title>
|
54
|
-
<
|
55
|
-
<
|
56
|
-
<
|
54
|
+
<link type='src'>https://www.iso.org/standard/53798.html</link>
|
55
|
+
<link type='obp'>https://www.iso.org/obp/ui/#!iso:std:53798:en</link>
|
56
|
+
<link type='rss'>https://www.iso.org/contents/data/standard/05/37/53798.detail.rss</link>
|
57
57
|
<docidentifier>ISO 19115-1</docidentifier>
|
58
58
|
<date type='published'>
|
59
59
|
<on>2014</on>
|
@@ -154,7 +154,7 @@ item.to_xml
|
|
154
154
|
[source,ruby]
|
155
155
|
----
|
156
156
|
Isobib::IsoBibliography.get('ISO 19115', "2014", {all_parts: true})
|
157
|
-
=> => "<bibitem type=\"international-standard\" id=\"ISO19115\">\n <title format=\"text/plain\" language=\"en\" script=\"Latn\">Geographic information -- Metadata</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Information g\u00E9ographique -- M\u00E9tadonn\u00E9es</title>\n <
|
157
|
+
=> => "<bibitem type=\"international-standard\" id=\"ISO19115\">\n <title format=\"text/plain\" language=\"en\" script=\"Latn\">Geographic information -- Metadata</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Information g\u00E9ographique -- M\u00E9tadonn\u00E9es</title>\n <link type=\"src\">https://www.iso.org/standard/53798.html</link>\n <link type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:53798:en</link>\n <link type=\"rss\">https://www.iso.org/contents/data/standard/05/37/53798.detail.rss</link>\n <docidentifier>ISO 19115: All Parts</docidentifier>\n <date type=\"published\">\n <on>2014</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>1</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status>Published</status>\n <copyright>\n <from>2014</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 19115:2003</formattedref>\n <docidentifier>ISO 19115:2003</docidentifier>\n </bibitem>\n </relation>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 19115:2003/Cor 1:2006</formattedref>\n <docidentifier>ISO 19115:2003/Cor 1:2006</docidentifier>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem>\n <formattedref>ISO 19115-1:2014/Amd 1:2018</formattedref>\n <docidentifier>ISO 19115-1:2014/Amd 1:2018</docidentifier>\n </bibitem>\n </relation>\n <relation type=\"partOf\">\n <bibitem type=\"international-standard\">\n <title format=\"text/plain\" language=\"en\" script=\"Latn\">Geographic information -- Metadata -- Part 1: Fundamentals</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Information g\u00E9ographique -- M\u00E9tadonn\u00E9es -- Partie 1: Principes de base</title>\n <link type=\"src\">https://www.iso.org/standard/53798.html</link>\n <link type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:53798:en</link>\n <link type=\"rss\">https://www.iso.org/contents/data/standard/05/37/53798.detail.rss</link>\n <docidentifier>ISO 19115-1</docidentifier>\n <date type=\"published\">\n <on>2014</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>1</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <abstract format=\"plain\" language=\"en\" script=\"Latn\">ISO 19115-1:2014 defines the schema required for describing geographic information and services by means of metadata. It provides information about the identification, the extent, the quality, the spatial and temporal aspects, the content, the spatial reference, the portrayal, distribution, and other properties of digital geographic data and services.ISO 19115-1:2014 is applicable to:-the cataloguing of all types of resources, clearinghouse activities, and the full description of datasets and services;-geographic services, geographic datasets, dataset series, and individual geographic features and feature properties.ISO 19115-1:2014 defines:-mandatory and conditional metadata sections, metadata entities, and metadata elements;-the minimum set of metadata required to serve most metadata applications (data discovery, determining data fitness for use, data access, data transfer, and use of digital data and services);-optional metadata elements to allow for a more extensive standard description of resources, if required;-a method for extending metadata to fit specialized needs.Though ISO 19115-1:2014 is applicable to digital data and services, its principles can be extended to many other types of resources such as maps, charts, and textual documents as well as non-geographic data. Certain conditional metadata elements might not apply to these other forms of data.</abstract>\n <abstract format=\"plain\" language=\"fr\" script=\"Latn\">L'ISO 19115-1:2014 d\u00E9finit le sch\u00E9ma requis pour d\u00E9crire des informations g\u00E9ographiques et des services au moyen de m\u00E9tadonn\u00E9es. Elle fournit des informations concernant l'identification, l'\u00E9tendue, la qualit\u00E9, les aspects spatiaux et temporels, le contenu, la r\u00E9f\u00E9rence spatiale, la repr\u00E9sentation des donn\u00E9es, la distribution et d'autres propri\u00E9t\u00E9s des donn\u00E9es g\u00E9ographiques num\u00E9riques et des services.L'ISO 19115-1:2014 est applicable:-au catalogage de tous les types de ressources, des activit\u00E9s des centres d'informations et \u00E0 la description compl\u00E8te des jeux de donn\u00E9es et des services,-aux services g\u00E9ographiques, jeux de donn\u00E9es g\u00E9ographiques, s\u00E9ries de jeux de donn\u00E9es, entit\u00E9s g\u00E9ographiques individuelles et propri\u00E9t\u00E9s d'entit\u00E9s.L'ISO 19115-1:2014 d\u00E9finit:-des sections relatives aux m\u00E9tadonn\u00E9es obligatoires et facultatives, aux entit\u00E9s de m\u00E9tadonn\u00E9es et aux \u00E9l\u00E9ments de m\u00E9tadonn\u00E9es,-le jeu minimal de m\u00E9tadonn\u00E9es requis pour r\u00E9pondre au besoin de la plupart des applications des m\u00E9tadonn\u00E9es (la d\u00E9couverte des donn\u00E9es, la d\u00E9termination de l'ad\u00E9quation des donn\u00E9es \u00E0 une utilisation, l'acc\u00E8s aux donn\u00E9es, le transfert des donn\u00E9es et l'utilisation des donn\u00E9es num\u00E9riques et des services),-les \u00E9l\u00E9ments de m\u00E9tadonn\u00E9es facultatifs pour permettre une description standard plus pouss\u00E9e des ressources, si cela est n\u00E9cessaire,-un proc\u00E9d\u00E9 d'extension des m\u00E9tadonn\u00E9es pour s'adapter aux besoins sp\u00E9ciaux.L'ISO 19115-1:2014 est applicable aux donn\u00E9es num\u00E9riques et services, ses principes peuvent \u00EAtre \u00E9tendus \u00E0 bien d'autres types de ressources telles que les cartes, les graphes et les documents textes, de m\u00EAme qu'\u00E0 des donn\u00E9es non g\u00E9ographiques. Certains \u00E9l\u00E9ments de m\u00E9tadonn\u00E9es conditionnels peuvent ne pas s'appliquer \u00E0 ces autres formes de donn\u00E9es.</abstract>\n <status>Published</status>\n <copyright>\n <from>2014</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 19115:2003</formattedref>\n <docidentifier>ISO 19115:2003</docidentifier>\n </bibitem>\n </relation>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 19115:2003/Cor 1:2006</formattedref>\n <docidentifier>ISO 19115:2003/Cor 1:2006</docidentifier>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem>\n <formattedref>ISO 19115-1:2014/Amd 1:2018</formattedref>\n <docidentifier>ISO 19115-1:2014/Amd 1:2018</docidentifier>\n </bibitem>\n </relation>\n <ics>\n <code>35.240.70</code>\n <text>IT applications in science</text>\n </ics>\n </bibitem>\n </relation>\n <ics>\n <code>35.240.70</code>\n <text>IT applications in science</text>\n </ics>\n <allParts>true</allParts>\n</bibitem>"
|
158
158
|
----
|
159
159
|
|
160
160
|
== Development
|
@@ -25,7 +25,7 @@ module Isobib
|
|
25
25
|
# @param opts [Hash] options; restricted to :all_parts if all-parts reference is required
|
26
26
|
# @return [String] Relaton XML serialisation of reference
|
27
27
|
def get(code, year, opts)
|
28
|
-
return iev.to_xml if code.casecmp
|
28
|
+
return iev.to_xml if code.casecmp("IEV") == 0
|
29
29
|
code += "-1" if opts[:all_parts]
|
30
30
|
ret = isobib_get1(code, year, opts)
|
31
31
|
return nil if ret.nil?
|
@@ -42,7 +42,7 @@ module Isobib
|
|
42
42
|
"The code must be exactly like it is on the website."
|
43
43
|
warn "(There was no match for #{year}, though there were matches "\
|
44
44
|
"found for #{missed_years.join(', ')}.)" unless missed_years.empty?
|
45
|
-
if /\d-\d
|
45
|
+
if /\d-\d/ =~ code
|
46
46
|
warn "The provided document part may not exist, or the document "\
|
47
47
|
"may no longer be published in parts."
|
48
48
|
else
|
@@ -70,7 +70,7 @@ module Isobib
|
|
70
70
|
ret = page.select do |i|
|
71
71
|
i.hit["title"] &&
|
72
72
|
i.hit["title"].match(docidrx).to_s == code &&
|
73
|
-
!corrigrx
|
73
|
+
!(corrigrx =~ i.hit["title"])
|
74
74
|
end
|
75
75
|
return ret unless ret.empty?
|
76
76
|
end
|
@@ -137,7 +137,7 @@ module Isobib
|
|
137
137
|
end
|
138
138
|
|
139
139
|
def isobib_get1(code, year, opts)
|
140
|
-
return iev if code.casecmp
|
140
|
+
return iev if code.casecmp("IEV") == 0
|
141
141
|
result = isobib_search_filter(code) or return nil
|
142
142
|
ret = isobib_results_filter(result, year)
|
143
143
|
return ret[:ret] if ret[:ret]
|
data/lib/isobib/scrapper.rb
CHANGED
@@ -279,7 +279,7 @@ module Isobib
|
|
279
279
|
when 1
|
280
280
|
intro, main, part = nil, titles[0], nil
|
281
281
|
when 2
|
282
|
-
if /^(Part|Partie) \d
|
282
|
+
if /^(Part|Partie) \d+:/ =~ titles[1]
|
283
283
|
intro, main, part = nil, titles[0], titles[1]
|
284
284
|
else
|
285
285
|
intro, main, part = titles[0], titles[1], nil
|
data/lib/isobib/version.rb
CHANGED
data/lib/isobib.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "relaton/processor"
|
2
|
+
|
3
|
+
module Relaton
|
4
|
+
module Isobib
|
5
|
+
class Processor < Relaton::Processor
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@short = :isobib
|
9
|
+
@prefix = %r{^(ISO|IEC)[ /]|^IEV($| )}
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(code, date, opts)
|
13
|
+
::Isobib::IsoBibliography.get(code, date, opts)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isobib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- lib/isobib/scrapper.rb
|
175
175
|
- lib/isobib/version.rb
|
176
176
|
- lib/isobib/workers_pool.rb
|
177
|
+
- lib/relaton/processor.rb
|
177
178
|
homepage: https://github.com/riboseinc/isobib
|
178
179
|
licenses:
|
179
180
|
- MIT
|
@@ -194,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
195
|
version: '0'
|
195
196
|
requirements: []
|
196
197
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.6.12
|
198
199
|
signing_key:
|
199
200
|
specification_version: 4
|
200
201
|
summary: 'IsoBib: retrieve ISO Standards for bibliographic use using the BibliographicItem
|