commonmeta-ruby 3.2.6 → 3.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +16 -2
  3. data/commonmeta.gemspec +1 -0
  4. data/lib/commonmeta/author_utils.rb +20 -3
  5. data/lib/commonmeta/cli.rb +2 -2
  6. data/lib/commonmeta/crossref_utils.rb +22 -18
  7. data/lib/commonmeta/readers/json_feed_reader.rb +27 -2
  8. data/lib/commonmeta/utils.rb +13 -1
  9. data/lib/commonmeta/version.rb +1 -1
  10. data/resources/crossref/common5.3.1.xsd +43 -35
  11. data/spec/author_utils_spec.rb +38 -0
  12. data/spec/cli_spec.rb +5 -5
  13. data/spec/fixtures/vcr_cassettes/Commonmeta_CLI/json_feed_unregistered/blog_post_uuid.yml +49 -0
  14. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed/unregistered_posts.yml +215 -0
  15. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/blogger_post.yml +20 -11
  16. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_author_name_suffix.yml +215 -0
  17. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_doi.yml +14 -9
  18. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml +9 -8
  19. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml +15 -10
  20. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/syldavia_gazette_post_with_references.yml +328 -0
  21. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/upstream_post_with_references.yml +824 -0
  22. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post.yml +14 -9
  23. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post_with_references.yml +390 -0
  24. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/{json_feed_url → json_feed_unregistered_url}/all_posts.yml +11 -11
  25. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/another_schema_org_from_front-matter.yml +103 -105
  26. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article.yml +5 -5
  27. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_from_datacite.yml +4 -4
  28. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_rogue_scholar_with_doi.yml +60 -9
  29. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_upstream_blog.yml +55 -7
  30. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_with_references.yml +824 -0
  31. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/posted_content.yml +17 -17
  32. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_another_science_blog.yml +12 -8
  33. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_front_matter.yml +178 -181
  34. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/schema_org_from_upstream_blog.yml +104 -92
  35. data/spec/readers/json_feed_reader_spec.rb +106 -12
  36. data/spec/utils_spec.rb +23 -5
  37. data/spec/writers/crossref_xml_writer_spec.rb +31 -3
  38. metadata +24 -8
  39. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/json_feed_url/front-matter_blog.yml +0 -221
  40. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_item_from_rogue_scholar_with_doi.yml +0 -163
  41. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_item_from_upstream_blog.yml +0 -243
  42. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_post_from_rogue_scholar_with_doi.yml +0 -210
  43. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_post_from_upstream_blog.yml +0 -290
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 575100d8bef2d51a19423453d3a5c3d7129903d5d7d23da7e7ac3c6c24ceb52b
4
- data.tar.gz: 9146bae365bf7f79c1f3ce05e781942749b29257433ed1d37196b3d0d1d2bf21
3
+ metadata.gz: 7a50ad8ff25b9ff753b60cc9a34f578ae064cedc2417a5db146898e8202f8dc3
4
+ data.tar.gz: cc7f32e49a6d0621a30884a8226a9dda04cd5b13ed6545aefc28fd8f19386acb
5
5
  SHA512:
6
- metadata.gz: 82f95b057c1b28d1dd344f31207fc43d43f6db65705bbdc3609b02c90b9a4ed8ffd2d6a3538f090589c615e9207ad78046625344b99a1e592e9a4a624f414e4e
7
- data.tar.gz: a6ff2bbe08b29b2641f35520e8fc46c8827f502e747b03b53f100235e7c0d639b8de4729ecfb6c7e41d1eee69e23fd9a6c0479e86471824797fe7bda1c78cc85
6
+ metadata.gz: 16d052d4e0dda3aed49235f43914f3d88e46627741500edb987cbf6dad00091234aa2304541f8ba6d713b05c9b158717d2c5632aa024e60dc694f7126752dda1
7
+ data.tar.gz: d6a7044f3b3722dc71f22f8c98e12d3f5c5e79b82bdf1aff745ccb74ecbd4febd2d53926924b635b97334c30df233dd793802dabfe0ea038f387488acf0ae4ef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.2.6)
4
+ commonmeta-ruby (3.2.7)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
6
  addressable (~> 2.8.1, < 2.8.2)
7
7
  base32-url (>= 0.5.0, < 1)
@@ -10,6 +10,7 @@ PATH
10
10
  citeproc-ruby (~> 2.0)
11
11
  csl-styles (~> 2.0)
12
12
  edtf (~> 3.0, >= 3.0.4)
13
+ feedparser (~> 2.2)
13
14
  gender_detector (~> 2.0)
14
15
  http (~> 5.1, >= 5.1.1)
15
16
  json-ld-preloaded (~> 3.2, >= 3.2.2)
@@ -57,7 +58,7 @@ GEM
57
58
  docile (1.4.0)
58
59
  domain_name (0.5.20190701)
59
60
  unf (>= 0.0.5, < 1.0.0)
60
- ebnf (2.3.3)
61
+ ebnf (2.3.4)
61
62
  htmlentities (~> 4.3)
62
63
  rdf (~> 3.2)
63
64
  scanf (~> 1.0)
@@ -65,6 +66,9 @@ GEM
65
66
  unicode-types (~> 1.8)
66
67
  edtf (3.1.1)
67
68
  activesupport (>= 3.0, < 8.0)
69
+ feedparser (2.2.0)
70
+ logutils (>= 0.6.1)
71
+ textutils (>= 1.0.0)
68
72
  ffi (1.15.5)
69
73
  ffi-compiler (1.0.1)
70
74
  ffi (>= 1.0.0)
@@ -86,6 +90,7 @@ GEM
86
90
  http-form_data (2.3.0)
87
91
  i18n (1.14.1)
88
92
  concurrent-ruby (~> 1.0)
93
+ iniparser (1.0.1)
89
94
  json (2.6.3)
90
95
  json-canonicalization (0.3.2)
91
96
  json-ld (3.2.5)
@@ -110,6 +115,7 @@ GEM
110
115
  llhttp-ffi (0.4.0)
111
116
  ffi-compiler (~> 1.0)
112
117
  rake (~> 13.0)
118
+ logutils (0.6.1)
113
119
  loofah (2.21.3)
114
120
  crass (~> 1.0.2)
115
121
  nokogiri (>= 1.12.0)
@@ -129,6 +135,8 @@ GEM
129
135
  addressable (>= 2.4.0)
130
136
  nokogiri (>= 1.8.0)
131
137
  public_suffix (>= 4.0.0, < 5)
138
+ props (1.2.0)
139
+ iniparser (>= 0.1.0)
132
140
  public_suffix (4.0.7)
133
141
  racc (1.7.0)
134
142
  rack (3.0.7)
@@ -205,6 +213,7 @@ GEM
205
213
  rubocop-capybara (~> 2.17)
206
214
  rubocop-factory_bot (~> 2.22)
207
215
  ruby-progressbar (1.13.0)
216
+ rubyzip (2.3.2)
208
217
  scanf (1.0.0)
209
218
  simplecov (0.22.0)
210
219
  docile (~> 1.1)
@@ -218,6 +227,11 @@ GEM
218
227
  matrix (~> 0.4)
219
228
  rdf (~> 3.2)
220
229
  temple (0.10.2)
230
+ textutils (1.4.0)
231
+ activesupport
232
+ logutils (>= 0.6.1)
233
+ props (>= 1.1.2)
234
+ rubyzip (>= 1.0.0)
221
235
  thor (1.2.2)
222
236
  tilt (2.2.0)
223
237
  tzinfo (2.0.6)
data/commonmeta.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency 'citeproc-ruby', '~> 2.0'
27
27
  s.add_dependency 'csl-styles', '~> 2.0'
28
28
  s.add_dependency 'edtf', '~> 3.0', '>= 3.0.4'
29
+ s.add_dependency 'feedparser', '~> 2.2'
29
30
  s.add_dependency 'gender_detector', '~> 2.0'
30
31
  s.add_dependency 'http', '~> 5.1', '>= 5.1.1'
31
32
  s.add_dependency 'json-ld-preloaded', '~> 3.2', '>= 3.2.2'
@@ -24,6 +24,8 @@ module Commonmeta
24
24
  family_name = parse_attributes(author.fetch('familyName', nil)) ||
25
25
  parse_attributes(author.fetch('family', nil))
26
26
 
27
+ name = cleanup_author(name)
28
+
27
29
  # parse author identifier
28
30
  id = parse_attributes(author.fetch('id', nil), first: true) ||
29
31
  parse_attributes(author.fetch('identifier', nil), first: true) ||
@@ -62,8 +64,6 @@ module Commonmeta
62
64
  # parse author contributor role
63
65
  contributor_type = parse_attributes(author.fetch('contributorType', nil))
64
66
 
65
- name = cleanup_author(name)
66
-
67
67
  # split name for type Person into given/family name if not already provided
68
68
  if type == 'Person' && given_name.blank? && family_name.blank?
69
69
  Namae.options[:include_particle_in_family] = true
@@ -98,6 +98,19 @@ module Commonmeta
98
98
  author = author.gsub(/[[:space:]]([A-Z]\.)?(-?[A-Z]\.)$/, ', \1\2')
99
99
  end
100
100
 
101
+ # strip suffixes, e.g. "John Smith, MD" as the named parser doesn't handle them
102
+ author = author.split(',').first if %w[MD PhD].include? author.split(', ').last
103
+
104
+ # remove email addresses
105
+ email = validate_email(author)
106
+ author = author.gsub(email, '') if email.present?
107
+
108
+ # strip spaces at the beginning and end of string
109
+ author = author.strip
110
+
111
+ # remove parentheses around names
112
+ author = author[1..-2] if author[0] == '(' && author[-1] == ')'
113
+
101
114
  # remove spaces around hyphens
102
115
  author = author.gsub(' - ', '-')
103
116
 
@@ -113,12 +126,16 @@ module Commonmeta
113
126
  # check if a name has only one word, e.g. "FamousOrganization"
114
127
  return false if name.to_s.split(' ').size == 1
115
128
 
129
+ # check for suffixes, e.g. "John Smith, MD"
130
+ return true if %w[MD PhD].include? name.split(', ').last
131
+
116
132
  # check of name can be parsed into given/family name
117
133
  Namae.options[:include_particle_in_family] = true
118
134
  names = Namae.parse(name)
135
+
119
136
  parsed_name = names.first
120
137
  return true if parsed_name && parsed_name.given
121
-
138
+
122
139
  false
123
140
  end
124
141
 
@@ -82,8 +82,8 @@ module Commonmeta
82
82
 
83
83
  desc "", "json_feed"
84
84
 
85
- def json_feed
86
- puts get_json_feed
85
+ def json_feed_unregistered
86
+ puts get_json_feed_unregistered
87
87
  end
88
88
 
89
89
  default_task :convert
@@ -61,7 +61,6 @@ module Commonmeta
61
61
  insert_crossref_publication_date(xml)
62
62
  insert_crossref_abstract(xml)
63
63
  insert_crossref_issn(xml)
64
- insert_crossref_alternate_identifiers(xml)
65
64
  insert_crossref_access_indicators(xml)
66
65
  insert_doi_data(xml)
67
66
  insert_citation_list(xml)
@@ -78,8 +77,8 @@ module Commonmeta
78
77
  insert_crossref_titles(xml)
79
78
  insert_posted_date(xml)
80
79
  insert_institution(xml)
80
+ insert_publisher_item(xml)
81
81
  insert_crossref_abstract(xml)
82
- insert_crossref_alternate_identifiers(xml)
83
82
  insert_crossref_access_indicators(xml)
84
83
  insert_doi_data(xml)
85
84
  insert_citation_list(xml)
@@ -132,13 +131,14 @@ module Commonmeta
132
131
  xml.citation_list do
133
132
  Array.wrap(references).each do |ref|
134
133
  xml.citation('key' => ref['key']) do
135
- xml.journal_article(ref['journal_title'])
136
- xml.author(ref['author'])
137
- xml.volume(ref['volume'])
138
- xml.first_page(ref['first_page'])
139
- xml.cYear(ref['cYear'])
140
- xml.article_title(ref['article_title'])
134
+ xml.journal_article(ref['journal_title']) if ref['journal_title'].present?
135
+ xml.author(ref['author']) if ref['author'].present?
136
+ xml.volume(ref['volume']) if ref['volume'].present?
137
+ xml.first_page(ref['first_page']) if ref['first_page'].present?
138
+ xml.cYear(ref['cYear']) if ref['cYear'].present?
139
+ xml.article_title(ref['article_title']) if ref['article_title'].present?
141
140
  xml.doi(ref['doi']) if ref['doi'].present?
141
+ xml.unstructured_citation(ref['url']) if ref['url'].present?
142
142
  end
143
143
  end
144
144
  end
@@ -159,16 +159,6 @@ module Commonmeta
159
159
  # 'resourceTypeGeneral' => types["resourceTypeGeneral"] || Metadata::SO_TO_DC_TRANSLATIONS[types["schemaOrg"]] || "Other")
160
160
  # end
161
161
 
162
- def insert_crossref_alternate_identifiers(xml)
163
- alternate_identifier = Array.wrap(alternate_identifiers).reject do |r|
164
- %w[DOI, URL].include?(r['alternate_identifier_type'])
165
- end.first
166
- return xml if alternate_identifier.blank?
167
-
168
- xml.item_number(alternate_identifier['alternateIdentifier'],
169
- 'item_number_type' => alternate_identifier['alternateIdentifierType'])
170
- end
171
-
172
162
  def insert_crossref_access_indicators(xml)
173
163
  return xml if license.blank?
174
164
 
@@ -265,6 +255,20 @@ module Commonmeta
265
255
  end
266
256
  end
267
257
 
258
+ def insert_publisher_item(xml)
259
+ return xml if alternate_identifiers.blank?
260
+
261
+ xml.publisher_item do
262
+ alternate_identifiers.each do |alternate_identifier|
263
+ attributes = {
264
+ 'item_number_type' => alternate_identifier['alternateIdentifierType'] ? alternate_identifier['alternateIdentifierType'].downcase : nil
265
+ }.compact
266
+
267
+ xml.item_number(alternate_identifier['alternateIdentifier'], attributes)
268
+ end
269
+ end
270
+ end
271
+
268
272
  def insert_doi_data(xml)
269
273
  return xml if doi_from_url(id).blank? || url.blank?
270
274
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require "uri"
2
3
 
3
4
  module Commonmeta
4
5
  module Readers
@@ -58,6 +59,8 @@ module Commonmeta
58
59
 
59
60
  sum
60
61
  end
62
+ references = get_references(meta)
63
+ alternate_identifiers = [{ "alternateIdentifier" => meta["uuid"], "alternateIdentifierType" => "UUID" }]
61
64
 
62
65
  { "id" => id,
63
66
  "type" => type,
@@ -71,13 +74,35 @@ module Commonmeta
71
74
  "descriptions" => descriptions,
72
75
  "license" => license,
73
76
  "subjects" => subjects.presence,
77
+ "references" => references.presence,
78
+ "alternate_identifiers" => alternate_identifiers,
74
79
  "state" => state }.compact.merge(read_options)
75
80
  end
76
81
 
77
- def get_json_feed
82
+ def get_references(meta)
83
+ # check that references resolve
84
+ Array.wrap(meta["references"]).reduce([]) do |sum, reference|
85
+ sum << reference if [200, 301, 302].include? HTTP.head(reference["doi"] || reference["url"]).status
86
+
87
+ sum
88
+ end
89
+ end
90
+
91
+ def get_json_feed_unregistered
78
92
  # get JSON Feed items not registered as DOIs
79
93
 
80
- url = json_feed_url
94
+ url = json_feed_unregistered_url
95
+ response = HTTP.get(url)
96
+ return { "string" => nil, "state" => "not_found" } unless response.status.success?
97
+
98
+ posts = JSON.parse(response.body.to_s)
99
+ posts.map { |post| post["uuid"] }.first
100
+ end
101
+
102
+ def get_json_feed_updated
103
+ # get JSON Feed items updated since last check
104
+
105
+ url = json_feed_unregistered_url
81
106
  response = HTTP.get(url)
82
107
  return { "string" => nil, "state" => "not_found" } unless response.status.success?
83
108
 
@@ -557,6 +557,12 @@ module Commonmeta
557
557
  end
558
558
  end
559
559
 
560
+ def validate_email(str)
561
+ email_regex = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i
562
+ parsed_emails = str.scan(email_regex)
563
+ parsed_emails.first
564
+ end
565
+
560
566
  def parse_attributes(element, options = {})
561
567
  content = options[:content] || "__content__"
562
568
 
@@ -604,6 +610,12 @@ module Commonmeta
604
610
  # clean up URL
605
611
  uri.path = PostRank::URI.clean(uri.path)
606
612
 
613
+ # optionally remove query and fragment
614
+ if options[:remove_query_string]
615
+ uri.query = nil
616
+ uri.fragment = nil
617
+ end
618
+
607
619
  uri.to_s
608
620
  rescue Addressable::URI::InvalidURIError
609
621
  nil
@@ -1381,7 +1393,7 @@ module Commonmeta
1381
1393
  Base32::URL.decode(id)
1382
1394
  end
1383
1395
 
1384
- def json_feed_url
1396
+ def json_feed_unregistered_url
1385
1397
  "https://rogue-scholar.org/api/posts/unregistered"
1386
1398
  end
1387
1399
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmeta
4
- VERSION = '3.2.6'
4
+ VERSION = '3.2.7'
5
5
  end
@@ -1,4 +1,9 @@
1
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://www.crossref.org/fundref.xsd" xmlns:ct="http://www.crossref.org/clinicaltrials.xsd" xmlns:ai="http://www.crossref.org/AccessIndicators.xsd" xmlns:mml="http://www.w3.org/1998/Math/MathML"><!-- *************************************************************
1
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
2
+ xmlns:fr="http://www.crossref.org/fundref.xsd"
3
+ xmlns:ct="http://www.crossref.org/clinicaltrials.xsd"
4
+ xmlns:ai="http://www.crossref.org/AccessIndicators.xsd"
5
+ xmlns:mml="http://www.w3.org/1998/Math/MathML">
6
+ <!--*************************************************************
2
7
  Crossref Metadata Input Schema, common file v. 5.3.1
3
8
  *************************************************************
4
9
 
@@ -8,7 +13,7 @@ As of version 4.5.0 all changes are noted in the release notes for the schema re
8
13
 
9
14
  Prior updates are noted as comments within previous schema versions.
10
15
 
11
- -->
16
+ -->
12
17
  <xsd:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="http://www.w3.org/Math/XMLSchema/mathml3/mathml3.xsd"/>
13
18
  <xsd:import namespace="http://www.crossref.org/fundref.xsd" schemaLocation="fundref.xsd"/>
14
19
  <xsd:import namespace="http://www.crossref.org/AccessIndicators.xsd" schemaLocation="AccessIndicators.xsd"/>
@@ -20,7 +25,7 @@ Prior updates are noted as comments within previous schema versions.
20
25
  </xsd:complexType>
21
26
  <xsd:group name="face_markup">
22
27
  <xsd:annotation>
23
- <xsd:documentation>The following are basic data types for face markup. Face markup that appears in the title, subtitle, and original_language_title elements should be retained when depositing metadata. Face markup in other elements (e.g. small caps in author names) must be dropped. Face markup support includes bold (b), italic (i), underline (u), over-line (ovl), superscript (sup), subscript (sub), small caps (scp), and typewriter text (tt). See https://support.crossref.org/hc/en-us/articles/214532023 MathML may also be included using the &apos;mml&apos; namespace prefix.</xsd:documentation>
28
+ <xsd:documentation>The following are basic data types for face markup. Face markup that appears in the title, subtitle, and original_language_title elements should be retained when depositing metadata. Face markup in other elements (e.g. small caps in author names) must be dropped. Face markup support includes bold (b), italic (i), underline (u), over-line (ovl), superscript (sup), subscript (sub), small caps (scp), and typewriter text (tt). See https://support.crossref.org/hc/en-us/articles/214532023 MathML may also be included using the 'mml' namespace prefix.</xsd:documentation>
24
29
  </xsd:annotation>
25
30
  <xsd:choice>
26
31
  <xsd:element ref="b"/>
@@ -50,7 +55,7 @@ Prior updates are noted as comments within previous schema versions.
50
55
  <xsd:element name="font" type="xrefFaces"/>
51
56
  <xsd:element name="a">
52
57
  <xsd:annotation>
53
- <xsd:documentation> content is &quot;Inline&quot; except that anchors shouldn&apos;t be nested </xsd:documentation>
58
+ <xsd:documentation> content is "Inline" except that anchors shouldn't be nested </xsd:documentation>
54
59
  </xsd:annotation>
55
60
  <xsd:complexType mixed="true">
56
61
  <xsd:simpleContent>
@@ -133,7 +138,7 @@ Prior updates are noted as comments within previous schema versions.
133
138
  </xsd:element>
134
139
  <xsd:element name="edition_number">
135
140
  <xsd:annotation>
136
- <xsd:documentation>The edition number of a book. edition_number should include only a number and not additional text such as &quot;edition&quot;. For example, you should submit &quot;3&quot;, not &quot;third edition&quot; or &quot;3rd edition&quot;. Roman numerals are acceptable.</xsd:documentation>
141
+ <xsd:documentation>The edition number of a book. edition_number should include only a number and not additional text such as "edition". For example, you should submit "3", not "third edition" or "3rd edition". Roman numerals are acceptable.</xsd:documentation>
137
142
  </xsd:annotation>
138
143
  <xsd:simpleType>
139
144
  <xsd:restriction base="xsd:string">
@@ -141,11 +146,12 @@ Prior updates are noted as comments within previous schema versions.
141
146
  <xsd:minLength value="1"/>
142
147
  </xsd:restriction>
143
148
  </xsd:simpleType>
144
- </xsd:element><!-- =============================================================
149
+ </xsd:element>
150
+ <!-- =============================================================
145
151
 
146
152
  5. Journal elements
147
153
 
148
- ============================================================= -->
154
+ ============================================================= -->
149
155
  <xsd:element name="issue">
150
156
  <xsd:annotation>
151
157
  <xsd:documentation>The issue number or name in which an article is published. The issue number takes precedence over any other name. For example, if an issue has only a seasonal name, then the season should be listed in issue.</xsd:documentation>
@@ -156,11 +162,12 @@ Prior updates are noted as comments within previous schema versions.
156
162
  <xsd:minLength value="1"/>
157
163
  </xsd:restriction>
158
164
  </xsd:simpleType>
159
- </xsd:element><!-- =============================================================
165
+ </xsd:element>
166
+ <!-- =============================================================
160
167
 
161
168
  6. Elements shared by content types
162
169
 
163
- ============================================================= -->
170
+ ============================================================= -->
164
171
  <xsd:element name="doi_data">
165
172
  <xsd:annotation>
166
173
  <xsd:documentation>The container for elements related directly to a DOI. </xsd:documentation>
@@ -203,10 +210,9 @@ Prior updates are noted as comments within previous schema versions.
203
210
  </xsd:simpleType>
204
211
  <xsd:element name="collection">
205
212
  <xsd:annotation>
206
- <xsd:documentation>
207
- Container for item elements containing non-primary URIs associated with the item being registered. Collections are supported for the following (defined in the property attribute):
208
- <ul>
209
- <li>list-based: Multiple Resolution, more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/</li>
213
+ <xsd:documentation>Container for item elements containing non-primary URIs associated with the item being registered. Collections are supported for the following (defined in the property attribute):
214
+ <ul>
215
+ <li>list-based: Multiple Resolution, more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/</li>
210
216
  <li>country-based: more info: https://www.crossref.org/education/content-registration/creating-and-managing-dois/multiple-resolution/#00130</li>
211
217
  <li>crawler-based: for Similarity Check URLs, more info: https://www.crossref.org/education/similarity-check/participate/urls-for-new-deposits/</li>
212
218
  <li>text-mining: supply specific URLs for text and data mining, more info: https://www.crossref.org/education/retrieve-metadata/rest-api/text-and-data-mining-for-members/</li>
@@ -540,7 +546,7 @@ Container for item elements containing non-primary URIs associated with the item
540
546
  </xsd:element>
541
547
  <xsd:attributeGroup name="reference_distribution_opts.att">
542
548
  <xsd:annotation>
543
- <xsd:documentation>NOTE: not currently supported. Use to flag references for distribution. &quot;none&quot; is the default and follows current protocol - references are only distributed to everyone if the prefix level permission is set, otherwise reference distribution is limited to the DOI owner. Setting the value to &quot;query&quot; releases references to anyone making a query request (this overrides any established prefix level permission). Value &quot;any&quot; allows bulk distribution to anyone (using a Crossref query account) using the OAI-PMH protocol, and also releases references to anyone making a query request.</xsd:documentation>
549
+ <xsd:documentation>NOTE: not currently supported. Use to flag references for distribution. "none" is the default and follows current protocol - references are only distributed to everyone if the prefix level permission is set, otherwise reference distribution is limited to the DOI owner. Setting the value to "query" releases references to anyone making a query request (this overrides any established prefix level permission). Value "any" allows bulk distribution to anyone (using a Crossref query account) using the OAI-PMH protocol, and also releases references to anyone making a query request.</xsd:documentation>
544
550
  </xsd:annotation>
545
551
  <xsd:attribute name="reference_distribution_opts" use="optional" default="none">
546
552
  <xsd:simpleType>
@@ -551,7 +557,9 @@ Container for item elements containing non-primary URIs associated with the item
551
557
  </xsd:restriction>
552
558
  </xsd:simpleType>
553
559
  </xsd:attribute>
554
- </xsd:attributeGroup><!-- END NAME ELEMENTs --><!-- ============ end various dates ========== -->
560
+ </xsd:attributeGroup>
561
+ <!--END NAME ELEMENTs-->
562
+ <!--============ end various dates ========== -->
555
563
  <xsd:simpleType name="doi_t">
556
564
  <xsd:restriction base="xsd:string">
557
565
  <xsd:maxLength value="2048"/>
@@ -703,7 +711,7 @@ Container for item elements containing non-primary URIs associated with the item
703
711
  </xsd:complexType>
704
712
  <xsd:element name="citation">
705
713
  <xsd:annotation>
706
- <xsd:documentation>citation is used to deposit each reference in the reference list of the item for which the DOI is being deposited. For details see: https://www.crossref.org/education/metadata-stewardship/maintaining-your-metadata/add-references/ </xsd:documentation>
714
+ <xsd:documentation>citation is used to deposit each reference in the reference list of the item for which the DOI is being deposited. For details see: https://www.crossref.org/education/metadata-stewardship/maintaining-your-metadata/add-references/ </xsd:documentation>
707
715
  </xsd:annotation>
708
716
  <xsd:complexType>
709
717
  <xsd:complexContent>
@@ -729,7 +737,7 @@ Container for item elements containing non-primary URIs associated with the item
729
737
  </xsd:attributeGroup>
730
738
  <xsd:element name="unstructured_citation">
731
739
  <xsd:annotation>
732
- <xsd:documentation>A citation to an item that is not structured with the Crossref citation model. &apos;unstructured_citation&apos; supports deposit of references for which no structural information is available. </xsd:documentation>
740
+ <xsd:documentation>A citation to an item that is not structured with the Crossref citation model. 'unstructured_citation' supports deposit of references for which no structural information is available. </xsd:documentation>
733
741
  </xsd:annotation>
734
742
  <xsd:complexType mixed="true">
735
743
  <xsd:choice minOccurs="0" maxOccurs="unbounded">
@@ -783,7 +791,7 @@ Container for item elements containing non-primary URIs associated with the item
783
791
  <xsd:element ref="crossmark_domains" minOccurs="0" maxOccurs="unbounded"/>
784
792
  <xsd:element ref="crossmark_domain_exclusive" minOccurs="0">
785
793
  <xsd:annotation>
786
- <xsd:documentation>Some publishers encourage broad third party hosting of the publisher&apos;s content. Other publishers do not. And still others vary their policy depending on whether a particular article has been published under an OA policy or not. This boolean flag allows the publisher to indicate whether the Crossmarked content will only legitimately be updated on the Crossmark domain (true) or whether the publisher encourages updating the content on other sites as well (false).</xsd:documentation>
794
+ <xsd:documentation>Some publishers encourage broad third party hosting of the publisher's content. Other publishers do not. And still others vary their policy depending on whether a particular article has been published under an OA policy or not. This boolean flag allows the publisher to indicate whether the Crossmarked content will only legitimately be updated on the Crossmark domain (true) or whether the publisher encourages updating the content on other sites as well (false).</xsd:documentation>
787
795
  </xsd:annotation>
788
796
  </xsd:element>
789
797
  <xsd:sequence minOccurs="0">
@@ -795,13 +803,13 @@ Container for item elements containing non-primary URIs associated with the item
795
803
  </xsd:element>
796
804
  <xsd:element name="crossmark_policy" type="doi_t">
797
805
  <xsd:annotation>
798
- <xsd:documentation>A DOI which points to a publisher&apos;s CrossMark policy document. Publishers might have different policies for different publications.</xsd:documentation>
806
+ <xsd:documentation>A DOI which points to a publisher's CrossMark policy document. Publishers might have different policies for different publications.</xsd:documentation>
799
807
  </xsd:annotation>
800
808
  </xsd:element>
801
809
  <xsd:element name="crossmark_version" type="xsd:string"/>
802
810
  <xsd:element name="crossmark_domains">
803
811
  <xsd:annotation>
804
- <xsd:documentation>Container element for crossmark_domain. A list of domains where the publisher maintains updates and corrections to their content. Minimally, one of these should include the Internet domain name of the publisher&apos;s web site(s), but the publisher might also decide to include 3rd party aggregators (e.g. Ebsco, IngentaConnect) or archives with which the publisher has agreements to update the content </xsd:documentation>
812
+ <xsd:documentation>Container element for crossmark_domain. A list of domains where the publisher maintains updates and corrections to their content. Minimally, one of these should include the Internet domain name of the publisher's web site(s), but the publisher might also decide to include 3rd party aggregators (e.g. Ebsco, IngentaConnect) or archives with which the publisher has agreements to update the content </xsd:documentation>
805
813
  </xsd:annotation>
806
814
  <xsd:complexType>
807
815
  <xsd:sequence>
@@ -811,7 +819,7 @@ Container for item elements containing non-primary URIs associated with the item
811
819
  </xsd:element>
812
820
  <xsd:element name="crossmark_domain">
813
821
  <xsd:annotation>
814
- <xsd:documentation>This should be a simple Internet domain name or subdomain name (e.g. www.psychoceramics.org or psychoceramics.org). It is used to identify when a referring URL is coming from a Crossmark domain. A &quot;crossmark_domain&quot; is made up of two subelements; a &quot;domain&quot; and a &quot;filter&quot;. The filter is only needed for use in situations where content from multiple publishers/publications is on the same host with the same domain name (e.g. an aggregator) and one needs to use the referrer&apos;s URI &quot;path&quot; to further determine whether the content in a crossmark domain.</xsd:documentation>
822
+ <xsd:documentation>This should be a simple Internet domain name or subdomain name (e.g. www.psychoceramics.org or psychoceramics.org). It is used to identify when a referring URL is coming from a Crossmark domain. A "crossmark_domain" is made up of two subelements; a "domain" and a "filter". The filter is only needed for use in situations where content from multiple publishers/publications is on the same host with the same domain name (e.g. an aggregator) and one needs to use the referrer's URI "path" to further determine whether the content in a crossmark domain.</xsd:documentation>
815
823
  </xsd:annotation>
816
824
  <xsd:complexType>
817
825
  <xsd:sequence>
@@ -827,7 +835,7 @@ Container for item elements containing non-primary URIs associated with the item
827
835
  </xsd:element>
828
836
  <xsd:element name="filter" type="xsd:string">
829
837
  <xsd:annotation>
830
- <xsd:documentation>The filter element is used to disambiguate content in situations where multiple publishers share the same host (e.g. when on an aggregated platform). It should contain a substring of the path that can be used to uniquely identify a publisher&apos;s or publication&apos;s content. For instance, using the string &quot;alpsp&quot; here would help the CrossMark system distinguish between ALPSP publications on the ingentaconnect host and other publications on the same host.</xsd:documentation>
838
+ <xsd:documentation>The filter element is used to disambiguate content in situations where multiple publishers share the same host (e.g. when on an aggregated platform). It should contain a substring of the path that can be used to uniquely identify a publisher's or publication's content. For instance, using the string "alpsp" here would help the CrossMark system distinguish between ALPSP publications on the ingentaconnect host and other publications on the same host.</xsd:documentation>
831
839
  </xsd:annotation>
832
840
  </xsd:element>
833
841
  <xsd:element name="crossmark_domain_exclusive" type="xsd:boolean"/>
@@ -843,16 +851,15 @@ Container for item elements containing non-primary URIs associated with the item
843
851
  </xsd:element>
844
852
  <xsd:element name="update">
845
853
  <xsd:annotation>
846
- <xsd:documentation>The DOI of the content being updated (e.g. corrected, retracted, etc.) In the CrossMark Terms and Conditions &quot;updates&quot; are defined as changes that are likely to &quot;change the reader’s interpretation or crediting of the work.&quot; That is, *editorially significant* changes. &quot;Updates&quot; should not include minor changes to spelling, punctuation, formatting, etc. </xsd:documentation>
854
+ <xsd:documentation>The DOI of the content being updated (e.g. corrected, retracted, etc.) In the CrossMark Terms and Conditions "updates" are defined as changes that are likely to "change the reader’s interpretation or crediting of the work." That is, *editorially significant* changes. "Updates" should not include minor changes to spelling, punctuation, formatting, etc. </xsd:documentation>
847
855
  </xsd:annotation>
848
856
  <xsd:complexType mixed="true">
849
857
  <xsd:simpleContent>
850
858
  <xsd:extension base="doi_t">
851
859
  <xsd:attribute name="type" use="required" type="cm_update_type">
852
860
  <xsd:annotation>
853
- <xsd:documentation>
854
- This attribute should be used to list the update type. Allowed update types are:
855
- <ul>
861
+ <xsd:documentation>This attribute should be used to list the update type. Allowed update types are:
862
+ <ul>
856
863
  <li>addendum</li>
857
864
  <li>clarification</li>
858
865
  <li>correction</li>
@@ -913,27 +920,27 @@ This attribute should be used to list the update type. Allowed update types are:
913
920
  </xsd:choice>
914
921
  <xsd:attribute name="explanation" type="xsd:anyURI">
915
922
  <xsd:annotation>
916
- <xsd:documentation>If the publisher wants to provide a further explanation of what the particular &quot;assertion&quot; means, they can link to such an explanation by providing an appropriate url on the &quot;explanation&quot; attribute.</xsd:documentation>
923
+ <xsd:documentation>If the publisher wants to provide a further explanation of what the particular "assertion" means, they can link to such an explanation by providing an appropriate url on the "explanation" attribute.</xsd:documentation>
917
924
  </xsd:annotation>
918
925
  </xsd:attribute>
919
926
  <xsd:attribute name="group_label" type="cm_assertion_group_label">
920
927
  <xsd:annotation>
921
- <xsd:documentation>This is the human-readable form of the &quot;group_name&quot; attribute. This is what will be displayed in the group headings on the Crossmark metadata record dialog.</xsd:documentation>
928
+ <xsd:documentation>This is the human-readable form of the "group_name" attribute. This is what will be displayed in the group headings on the Crossmark metadata record dialog.</xsd:documentation>
922
929
  </xsd:annotation>
923
930
  </xsd:attribute>
924
931
  <xsd:attribute name="group_name" type="cm_assertion_group_name">
925
932
  <xsd:annotation>
926
- <xsd:documentation>Some assertions could be logically &quot;grouped&quot; together in the CrossMark dialog. For instance, if the publisher is recording several pieces of metadata related to funding sources (source name, percentage, grant number), they may want to make sure that these three assertions are grouped next to each-other in the CrossMark dialog. The group_name attribute is the machine-readable value that will be used for grouping such assertions.</xsd:documentation>
933
+ <xsd:documentation>Some assertions could be logically "grouped" together in the CrossMark dialog. For instance, if the publisher is recording several pieces of metadata related to funding sources (source name, percentage, grant number), they may want to make sure that these three assertions are grouped next to each-other in the CrossMark dialog. The group_name attribute is the machine-readable value that will be used for grouping such assertions.</xsd:documentation>
927
934
  </xsd:annotation>
928
935
  </xsd:attribute>
929
936
  <xsd:attribute name="label" type="cm_assertion_label">
930
937
  <xsd:annotation>
931
- <xsd:documentation>This is the human-readable version of the name attribute which will be displayed in the CrossMark dialog. If this attribute is missing, then the value of the assertion will *not* be displayed in the dialog. Publishers may want to &quot;hide&quot; assertions this way in cases where the assertion value is too large or too complex to display in the dialog, but where the assertion is nonetheless valuable enough to include in API queries and metadata dumps (e.g. detailed licensing terms)</xsd:documentation>
938
+ <xsd:documentation>This is the human-readable version of the name attribute which will be displayed in the CrossMark dialog. If this attribute is missing, then the value of the assertion will *not* be displayed in the dialog. Publishers may want to "hide" assertions this way in cases where the assertion value is too large or too complex to display in the dialog, but where the assertion is nonetheless valuable enough to include in API queries and metadata dumps (e.g. detailed licensing terms)</xsd:documentation>
932
939
  </xsd:annotation>
933
940
  </xsd:attribute>
934
941
  <xsd:attribute name="name" use="required" type="cm_assertion_name">
935
942
  <xsd:annotation>
936
- <xsd:documentation>This is the machine-readable name of the assertion. Use the &quot;label&quot; attribute to provide a human-readable version of the name.</xsd:documentation>
943
+ <xsd:documentation>This is the machine-readable name of the assertion. Use the "label" attribute to provide a human-readable version of the name.</xsd:documentation>
937
944
  </xsd:annotation>
938
945
  </xsd:attribute>
939
946
  <xsd:attribute name="order" type="xsd:integer">
@@ -1024,7 +1031,7 @@ This attribute should be used to list the update type. Allowed update types are:
1024
1031
  </xsd:element>
1025
1032
  <xsd:element name="std_family_designator" type="std_designator_t">
1026
1033
  <xsd:annotation>
1027
- <xsd:documentation>Provides for defining a DOI for a broad grouping of standards. </xsd:documentation>
1034
+ <xsd:documentation>Provides for defining a DOI for a broad grouping of standards. </xsd:documentation>
1028
1035
  </xsd:annotation>
1029
1036
  </xsd:element>
1030
1037
  <xsd:element name="std_set_designator">
@@ -1059,12 +1066,12 @@ This attribute should be used to list the update type. Allowed update types are:
1059
1066
  </xsd:element>
1060
1067
  <xsd:element name="std_adopted_from" type="std_designatorvalue_t">
1061
1068
  <xsd:annotation>
1062
- <xsd:documentation>Designator for standard from which the current deposit is adopted. </xsd:documentation>
1069
+ <xsd:documentation>Designator for standard from which the current deposit is adopted. </xsd:documentation>
1063
1070
  </xsd:annotation>
1064
1071
  </xsd:element>
1065
1072
  <xsd:element name="std_revision_of" type="std_designatorvalue_t">
1066
1073
  <xsd:annotation>
1067
- <xsd:documentation>Designator for the previous revision of the standard being deposited. (note: use alt_as_published for revisions within designators having common stem) </xsd:documentation>
1074
+ <xsd:documentation>Designator for the previous revision of the standard being deposited. (note: use alt_as_published for revisions within designators having common stem) </xsd:documentation>
1068
1075
  </xsd:annotation>
1069
1076
  </xsd:element>
1070
1077
  <xsd:element name="standards_body">
@@ -1103,7 +1110,8 @@ This attribute should be used to list the update type. Allowed update types are:
1103
1110
  </xsd:complexType>
1104
1111
  <xsd:element name="std_designator" type="std_designatorvalue_t"/>
1105
1112
  <xsd:element name="std_alt_script" type="std_designatorvalue_t"/>
1106
- <xsd:element name="std_variant_form" type="std_designatorvalue_t"/><!-- ================SCN policy ============================= -->
1113
+ <xsd:element name="std_variant_form" type="std_designatorvalue_t"/>
1114
+ <!-- ================SCN policy ============================= -->
1107
1115
  <xsd:element name="scn_policies">
1108
1116
  <xsd:annotation>
1109
1117
  <xsd:documentation>A wrapper for Scholarly Sharing Network (SCN) policy information</xsd:documentation>