relaton-render 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +1 -1
- data/lib/relaton/render/general/config.yml +10 -10
- data/lib/relaton/render/parse/parse_extract.rb +7 -5
- data/lib/relaton/render/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: 582bd299999942dc5919461f4bde4d4ea90418708be1cda926903aa05659baa2
|
4
|
+
data.tar.gz: 5c8f8e6346a911b28bca037a9f6f931dd997d562400a615b9bbfd9f66a653848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5994cb6fbfac2a14e0ad9e34c5acd3f33b12e2f983ac2e9de2d34cf8392b8e5e11fa1802eb5bc21dce0b545d1ac2d36b9a50a75e6344b962c207dba31a923cb
|
7
|
+
data.tar.gz: 6363973667df0ba2751b7d87dd6abd7d3f4f733cdb1cbac6c6543ea0cd79befea3cfb5003ae6b50753132c2aebf826f846e0fc12e0985aa84163a88e91c92874
|
data/README.adoc
CHANGED
@@ -158,7 +158,7 @@ drawn from the bibliographic item:
|
|
158
158
|
| authoritative_identifier | ./docidentifier[not(@type = 'metanorma' or @type = 'ordinal' or @type = 'ISBN' or @type = 'ISSN' or @type = 'DOI')] | Y | |
|
159
159
|
| other_identifier | ./docidentifier[@type = 'ISBN' or @type = 'ISSN' or @type = 'DOI'] | Y | | By default, each such identifier is prefixed with its type and colon
|
160
160
|
| status | ./status | | | Rendering varies by flavour
|
161
|
-
| uri | ./uri[@type = 'citation' or @type = '
|
161
|
+
| uri | ./uri[@type = 'citation' or @type = 'uri' or @type = 'src' or true] | | | If multiples, prioritise language match. Always exclude DOI: that is not where the resource is available from
|
162
162
|
| access_location | ./accessLocation | | Y |
|
163
163
|
| extent | ./extent | Y | | Render with standard abbreviations for pp, vols, with n-dash, with delimiting of multiple locations
|
164
164
|
| creatornames | ./contributor[role/@type = 'author'] \| ./contributor[role/@type = 'performer'] \| ./contributor[role/@type = 'adapter'] \| ./contributor[role/@type = 'translator'] \| ./contributor[role/@type = 'editor'] \| ./contributor[role/@type = 'distributor'] \| ./contributor | Y | | <<nametemplate,`nametemplate`>> applied to each name; joining template from internationalisation applied to multiple names
|
@@ -31,35 +31,35 @@ sizetemplate:
|
|
31
31
|
language: en
|
32
32
|
script: Latn
|
33
33
|
template:
|
34
|
-
book: "{{ creatornames }} ({{role}}) . {{labels['qq-open']}}
|
34
|
+
book: "{{ creatornames }} ({{role}}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} [{{medium}}] . {{ edition | capitalize_first }}. ({{ series }}.) {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]. {{size}}. {{extent}}."
|
35
35
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, rights metadata, distributor, item attributes, relationships
|
36
36
|
booklet: book
|
37
37
|
manual: book
|
38
38
|
proceedings: book
|
39
|
-
inbook: "{{ creatornames }} ({{role}}) . {{labels['q-open']}}
|
39
|
+
inbook: "{{ creatornames }} ({{role}}) . {{labels['q-open']}}{{ title }}{{labels['q-close']}} . {{ labels['in'] | capitalize }}: {{ host_creatornames}} ({{ host_role}}) : {{labels['qq-open']}}{{host_title}}{{labels['qq-close']}} [{{medium}}] . {{ edition | capitalize_first }}. ({{ series }}.) {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{size}}. {{extent}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
40
40
|
inproceedings: inbook
|
41
41
|
incollection: inbook
|
42
42
|
# TODO: omitted: author ids, additional info for component part, subsidiary titles of host resource, rights metadata, distributor, relationships
|
43
|
-
journal: "{{labels['qq-open']}}
|
43
|
+
journal: "{{labels['qq-open']}}{{ title}}{{labels['qq-close']}} [{{medium}}] . {{ edition | capitalize_first }}. {{place}}: {{publisher}}. {{date}}. {{size}}. {{extent}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
44
44
|
# TODO subsidiary titles, rights metadata, item attributes, relationships
|
45
|
-
article: "{{ creatornames }} ({{role}}) . {{labels['q-open']}}
|
45
|
+
article: "{{ creatornames }} ({{role}}) . {{labels['q-open']}}{{ title }}{{labels['q-close']}}. {{ series }} [{{medium}}] . {{ edition | capitalize_first }}. {{size}}. {{ extent }}. {{place}}: {{publisher}}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
46
46
|
# TODO: omitted: author ids, subsidiary titles, rights metadata, distributor, item attributes, relationships; newspapers
|
47
|
-
software: "{{ creatornames }} ({{ role}}) . {{labels['qq-open']}}
|
47
|
+
software: "{{ creatornames }} ({{ role}}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{medium | capitalize}}. {{place}}: {{publisher}}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{size}}. {{ extent}}. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
48
48
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, copyright, license, distributor, system requirements, relationships
|
49
49
|
electronic resource: software
|
50
|
-
standard: "{{ creatornames }} ({{ role}}) . {{ authoritative_identifier | join '|' }}: {{labels['qq-open']}}
|
50
|
+
standard: "{{ creatornames }} ({{ role}}) . {{ authoritative_identifier | join '|' }}: {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ labels['in'] | capitalize }}:_{{ series_title }}. {{ medium | capitalize }}. {{ edition | capitalize_first }}. {{ place }}: {{ publisher }}. {{date}}. {{size}}. {{ extent }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
51
51
|
# TODO: omitted: author ids, subsidiary titles, rights metadata, distributor, persistent identifier, item attributes, relationships
|
52
52
|
techreport: standard
|
53
|
-
dataset: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}
|
53
|
+
dataset: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{medium | capitalize }}. {{ labels['in'] | capitalize }}:_{{series}}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. {{ size }}. {{ extent}}. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
54
54
|
# TODO: omitted: author ids, system requirements, host archive, copyright, license, data source, distributor, usage instructions, relationships, provenance
|
55
|
-
website: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}
|
55
|
+
website: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{medium | capitalize }}. {{ place }}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
56
56
|
# TODO: omitted: author ids, page title, system requirements, subsidiary creator, rights metadata, distributor, persistent identifier, archive location, archive date and time, relationships
|
57
57
|
webresource: website
|
58
58
|
# TODO: component part
|
59
|
-
unpublished: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}
|
59
|
+
unpublished: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ medium | capitalize }}. {{ date }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
60
60
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, host archive, item attributes, relationships
|
61
61
|
presentation: unpublished
|
62
|
-
thesis: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}
|
62
|
+
thesis: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ medium | capitalize }}. {{ place }}: {{ publisher }}. {{ date }}. {{ labels['at'] | capitalize}}:_{{ access_location }}. {{ authoritative_identifier | join: '. ' }}. {{ other_identifier | join: '. ' }}. {{ uri }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
|
63
63
|
misc: "{{ creatornames }} ({{ role }}) . {{labels['qq-open']}}{{ title }}{{labels['qq-close']}} . {{ date }}."
|
64
64
|
# following are # unsupported types:
|
65
65
|
map: misc
|
@@ -113,11 +113,13 @@ module Relaton
|
|
113
113
|
|
114
114
|
def uri(doc)
|
115
115
|
uri = nil
|
116
|
-
%w(citation
|
116
|
+
%w(citation uri src).each do |t|
|
117
117
|
uri = uri_type_select(doc, t) and break
|
118
118
|
end
|
119
|
-
uri ||= doc.link.detect
|
120
|
-
|
119
|
+
uri ||= doc.link.detect do |u|
|
120
|
+
u.language == @lang && !u.type&.casecmp("doi")&.zero?
|
121
|
+
end
|
122
|
+
uri ||= doc.link.detect { |u| !u.type&.casecmp("doi")&.zero? }
|
121
123
|
return nil unless uri
|
122
124
|
|
123
125
|
uri.content.to_s
|
@@ -125,9 +127,9 @@ module Relaton
|
|
125
127
|
|
126
128
|
def uri_type_select(doc, type)
|
127
129
|
uri = doc.link.detect do |u|
|
128
|
-
u.type == type && u.language == @lang
|
130
|
+
u.type&.downcase == type && u.language == @lang
|
129
131
|
end and return uri
|
130
|
-
uri = doc.link.detect { |u| u.type == type } and return uri
|
132
|
+
uri = doc.link.detect { |u| u.type&.downcase == type } and return uri
|
131
133
|
nil
|
132
134
|
end
|
133
135
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-render
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
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-
|
11
|
+
date: 2022-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|