bolognese 0.9.48 → 0.9.50

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 903902cc9d9d2073110c35825e464acd2b4e52ee
4
- data.tar.gz: 5f33ff35922d87ee31bf9b85868a78f24ee8065b
3
+ metadata.gz: bd2837b30a082d4677ebee66a96d451b13cf7fdd
4
+ data.tar.gz: 3a8974f65f8e03246e481e8d582414bcb9685bea
5
5
  SHA512:
6
- metadata.gz: 62a1627fd5ae1098c14c6d11375118c2e9466962302c28b664691f9a15ad6ece68a782a1ea9b2ec014fb21c6339cf3f90354d3dcb1116adaca4ec0e87418d530
7
- data.tar.gz: c5034a49640bfb65975fd4186c3ec1eff9b342dcd127ae1e3ba17816f36592371a862536e0e772f3d39d77c3af6f56a3ced7a7f81b3d4abe0771d9bcb82349ea
6
+ metadata.gz: 7b6d279ec212fa429603a38f550c3266b86196c0ddf52c34f456a95b383c64a4149692c6bfadc630a111e31fed1ae1c8b58e60a10b093ce73f692db8776d2ced
7
+ data.tar.gz: 9611c1db3887c80637fd3ac8fdd558b3d01f9c40250223f14a8bf879c325de873c87a6956275bc931f182601d338f49402ee6009ea32415d17cd9b765be8c55b
data/Gemfile.lock CHANGED
@@ -23,13 +23,13 @@ PATH
23
23
  GEM
24
24
  remote: https://rubygems.org/
25
25
  specs:
26
- activesupport (5.1.3)
26
+ activesupport (5.1.4)
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
28
  i18n (~> 0.7)
29
29
  minitest (~> 5.1)
30
30
  tzinfo (~> 1.1)
31
- addressable (2.5.1)
32
- public_suffix (~> 2.0, >= 2.0.2)
31
+ addressable (2.5.2)
32
+ public_suffix (>= 2.0.2, < 4.0)
33
33
  benchmark_methods (0.7)
34
34
  bibtex-ruby (4.4.4)
35
35
  latex-decode (~> 0.0)
@@ -54,7 +54,7 @@ GEM
54
54
  faraday (>= 0.7.4, < 1.0)
55
55
  gender_detector (0.1.2)
56
56
  unicode_utils (>= 1.3.0)
57
- haml (5.0.2)
57
+ haml (5.0.3)
58
58
  temple (>= 0.8.0)
59
59
  tilt
60
60
  hamster (3.0.0)
@@ -87,7 +87,7 @@ GEM
87
87
  oj (>= 2.8.3)
88
88
  mini_portile2 (2.1.0)
89
89
  minitest (5.10.3)
90
- multi_json (1.12.1)
90
+ multi_json (1.12.2)
91
91
  multipart-post (2.0.0)
92
92
  namae (0.11.3)
93
93
  nokogiri (1.7.2)
@@ -101,8 +101,8 @@ GEM
101
101
  rack (2.0.3)
102
102
  rack-test (0.7.0)
103
103
  rack (>= 1.0, < 3)
104
- rake (12.0.0)
105
- rdf (2.2.7)
104
+ rake (12.1.0)
105
+ rdf (2.2.9)
106
106
  hamster (~> 3.0)
107
107
  link_header (~> 0.0, >= 0.0.8)
108
108
  rdf-aggregate-repo (2.2.0)
@@ -11,8 +11,8 @@ module Bolognese
11
11
  name_identifiers = get_name_identifiers(author)
12
12
  id = author.fetch("id", nil).presence || name_identifiers.first
13
13
  identifier = name_identifiers.length > 1 ? name_identifiers.unwrap : nil
14
- name = author.fetch("creatorName", nil) ||
15
- author.fetch("contributorName", nil) ||
14
+ name = parse_attributes(author.fetch("creatorName", nil)) ||
15
+ parse_attributes(author.fetch("contributorName", nil)) ||
16
16
  author.fetch("name", nil)
17
17
 
18
18
  if name.include?("; ")
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.9.48"
2
+ VERSION = "0.9.50"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
3
- 2013-05 v3.0: Addition of ID to simpleType element; addition of value "Collected"; deleted "StartDate" & "EndDate"-->
3
+ 2013-05 v3.0: Addition of ID to simpleType element; addition of value "Collected"; deleted "StartDate" & "EndDate"
4
+ 2017-09-14 v4.1: Addition of value "Other"-->
4
5
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-4" targetNamespace="http://datacite.org/schema/kernel-4" elementFormDefault="qualified">
5
6
  <xs:simpleType name="dateType" id="dateType">
6
7
  <xs:annotation>
@@ -13,6 +14,7 @@
13
14
  <xs:enumeration value="Copyrighted"/>
14
15
  <xs:enumeration value="Created"/>
15
16
  <xs:enumeration value="Issued"/>
17
+ <xs:enumeration value="Other"/>
16
18
  <xs:enumeration value="Submitted"/>
17
19
  <xs:enumeration value="Updated"/>
18
20
  <xs:enumeration value="Valid"/>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Version 4.1 - Created 2017-9-14 -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-4" targetNamespace="http://datacite.org/schema/kernel-4" elementFormDefault="qualified">
4
+ <xs:simpleType name="nameType" id="nameType">
5
+ <xs:restriction base="xs:string">
6
+ <xs:enumeration value="Organizational"/>
7
+ <xs:enumeration value="Personal"/>
8
+ </xs:restriction>
9
+ </xs:simpleType>
10
+ </xs:schema>
@@ -2,7 +2,8 @@
2
2
  <!--
3
3
  2011-01-13 v1.0 - FZ, TIB, Germany
4
4
  2013-05 v3.0: Addition of ID to simpleType element, addition of values "IsIdenticalTo", "HasMetadata" & "IsMetadataFor"
5
- 2014-08-20 v3.1: Addition of values "Reviews" & "IsReviewedBy" and "IsDerivedFrom" & "IsSourceOf"-->
5
+ 2014-08-20 v3.1: Addition of values "Reviews" & "IsReviewedBy" and "IsDerivedFrom" & "IsSourceOf"
6
+ 2017-09-14 v.4.1: Addition of values "Describes", "IsDescribedBy", "HasVersion", "IsVersionOf", "Requires", "IsRequiredBy" -->
6
7
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-4" targetNamespace="http://datacite.org/schema/kernel-4" elementFormDefault="qualified">
7
8
  <xs:simpleType name="relationType" id="relationType">
8
9
  <xs:annotation>
@@ -34,6 +35,12 @@
34
35
  <xs:enumeration value="IsReviewedBy"/>
35
36
  <xs:enumeration value="IsDerivedFrom"/>
36
37
  <xs:enumeration value="IsSourceOf"/>
38
+ <xs:enumeration value="Describes"/>
39
+ <xs:enumeration value="IsDescribedBy"/>
40
+ <xs:enumeration value="HasVersion"/>
41
+ <xs:enumeration value="IsVersionof"/>
42
+ <xs:enumeration value="Requires"/>
43
+ <xs:enumeration value="IsRequiredBy"/>
37
44
  </xs:restriction>
38
45
  </xs:simpleType>
39
46
  </xs:schema>
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany
3
- 2013-05 v3.0: Addition of ID to simpleType element; added values "Audiovisual", "Workflow" & "Other"; deleted value "Film" -->
3
+ 2013-05 v3.0: Addition of ID to simpleType element; added values "Audiovisual", "Workflow" & "Other"; deleted value "Film"
4
+ 2017-09-14 v4.1: Addition of value "DataPaper" -->
4
5
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-4" targetNamespace="http://datacite.org/schema/kernel-4" elementFormDefault="qualified">
5
6
  <xs:simpleType name="resourceType" id="resourceType">
6
7
  <xs:annotation>
@@ -9,6 +10,7 @@
9
10
  <xs:restriction base="xs:string">
10
11
  <xs:enumeration value="Audiovisual"/>
11
12
  <xs:enumeration value="Collection"/>
13
+ <xs:enumeration value="DataPaper"/>
12
14
  <xs:enumeration value="Dataset"/>
13
15
  <xs:enumeration value="Event"/>
14
16
  <xs:enumeration value="Image"/>
@@ -12,12 +12,13 @@
12
12
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
13
13
  <xs:include schemaLocation="include/datacite-titleType-v4.xsd"/>
14
14
  <xs:include schemaLocation="include/datacite-contributorType-v4.xsd"/>
15
- <xs:include schemaLocation="include/datacite-dateType-v4.xsd"/>
16
- <xs:include schemaLocation="include/datacite-resourceType-v4.xsd"/>
17
- <xs:include schemaLocation="include/datacite-relationType-v4.xsd"/>
15
+ <xs:include schemaLocation="include/datacite-dateType-v4.1.xsd"/>
16
+ <xs:include schemaLocation="include/datacite-resourceType-v4.1.xsd"/>
17
+ <xs:include schemaLocation="include/datacite-relationType-v4.1.xsd"/>
18
18
  <xs:include schemaLocation="include/datacite-relatedIdentifierType-v4.xsd"/>
19
19
  <xs:include schemaLocation="include/datacite-funderIdentifierType-v4.xsd"/>
20
20
  <xs:include schemaLocation="include/datacite-descriptionType-v4.xsd"/>
21
+ <xs:include schemaLocation="include/datacite-nameType-v4.1.xsd"/>
21
22
  <xs:element name="resource">
22
23
  <xs:annotation>
23
24
  <xs:documentation>
@@ -53,9 +54,13 @@
53
54
  <xs:complexType>
54
55
  <xs:sequence>
55
56
  <xs:element name="creatorName">
56
- <xs:simpleType>
57
- <xs:restriction base="nonemptycontentStringType"/>
58
- </xs:simpleType>
57
+ <xs:complexType>
58
+ <xs:simpleContent>
59
+ <xs:extension base="nonemptycontentStringType">
60
+ <xs:attribute name="nameType" type="nameType" use="optional"/>
61
+ </xs:extension>
62
+ </xs:simpleContent>
63
+ </xs:complexType>
59
64
  </xs:element>
60
65
  <xs:element name="givenName" minOccurs="0"/>
61
66
  <xs:element name="familyName" minOccurs="0"/>
@@ -160,11 +165,13 @@
160
165
  <xs:complexType>
161
166
  <xs:sequence>
162
167
  <xs:element name="contributorName">
163
- <xs:simpleType>
164
- <xs:restriction base="xs:string">
165
- <xs:minLength value="1"/>
166
- </xs:restriction>
167
- </xs:simpleType>
168
+ <xs:complexType>
169
+ <xs:simpleContent>
170
+ <xs:extension base="nonemptycontentStringType">
171
+ <xs:attribute name="nameType" type="nameType" use="optional"/>
172
+ </xs:extension>
173
+ </xs:simpleContent>
174
+ </xs:complexType>
168
175
  </xs:element>
169
176
  <xs:element name="givenName" minOccurs="0"/>
170
177
  <xs:element name="familyName" minOccurs="0"/>
@@ -198,6 +205,7 @@
198
205
  <xs:simpleContent>
199
206
  <xs:extension base="xs:string">
200
207
  <xs:attribute name="dateType" type="dateType" use="required"/>
208
+ <xs:attribute name="dateInformation" use="optional"/>
201
209
  </xs:extension>
202
210
  </xs:simpleContent>
203
211
  </xs:complexType>
@@ -238,6 +246,7 @@
238
246
  <xs:complexType>
239
247
  <xs:simpleContent>
240
248
  <xs:extension base="xs:string">
249
+ <xs:attribute name="resourceTypeGeneral" type="resourceType" use="optional"/>
241
250
  <xs:attribute name="relatedIdentifierType" type="relatedIdentifierType" use="required"/>
242
251
  <xs:attribute name="relationType" type="relationType" use="required"/>
243
252
  <xs:attribute name="relatedMetadataScheme" use="optional"/>
@@ -291,6 +300,7 @@ Use the complete title of a license and include version information if applicabl
291
300
  <xs:simpleContent>
292
301
  <xs:extension base="xs:string">
293
302
  <xs:attribute name="rightsURI" type="xs:anyURI" use="optional"/>
303
+ <xs:attribute ref="xml:lang"/>
294
304
  </xs:extension>
295
305
  </xs:simpleContent>
296
306
  </xs:complexType>
@@ -0,0 +1,57 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
3
+ <identifier identifierType="DOI">10.5072/testpub</identifier>
4
+ <creators>
5
+ <creator>
6
+ <creatorName nameType="Personal">Smith, John</creatorName>
7
+ </creator>
8
+ <creator>
9
+ <creatorName>つまらないものですが</creatorName>
10
+ <nameIdentifier nameIdentifierScheme="ISNI" schemeURI="http://isni.org/isni/">0000000134596520</nameIdentifier>
11
+ </creator>
12
+ </creators>
13
+ <titles>
14
+ <title>Właściwości rzutowań podprzestrzeniowych</title>
15
+ <title titleType="TranslatedTitle">Translation of Polish titles</title>
16
+ </titles>
17
+ <publisher>Springer</publisher>
18
+ <publicationYear>2010</publicationYear>
19
+ <subjects>
20
+ <subject subjectScheme="DDC">830 German &amp; related literatures</subject>
21
+ <subject>Polish Literature</subject>
22
+ </subjects>
23
+ <dates>
24
+ <date dateType="Other" dateInformation="Correction">2012-12-13</date>
25
+ </dates>
26
+ <contributors>
27
+ <contributor contributorType="DataCollector">
28
+ <contributorName>Doe, John</contributorName>
29
+ <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="http://orcid.org/">0000-0001-5393-1421</nameIdentifier>
30
+ </contributor>
31
+ </contributors>
32
+ <language>GER</language>
33
+ <resourceType resourceTypeGeneral="Text">Monograph</resourceType>
34
+ <alternateIdentifiers>
35
+ <alternateIdentifier alternateIdentifierType="ISBN">937-0-4523-12357-6</alternateIdentifier>
36
+ </alternateIdentifiers>
37
+ <relatedIdentifiers>
38
+ <relatedIdentifier resourceTypeGeneral="Text" relatedIdentifierType="DOI" relationType="IsPartOf">10.5272/oldertestpub</relatedIdentifier>
39
+ </relatedIdentifiers>
40
+ <sizes>
41
+ <size>256 pages</size>
42
+ </sizes>
43
+ <formats>
44
+ <format>pdf</format>
45
+ </formats>
46
+ <version>2</version>
47
+ <rightsList>
48
+ <rights xml:lang="eng" rightsURI="http://creativecommons.org/licenses/by-nd/2.0/">Creative Commons Attribution-NoDerivs 2.0 Generic</rights>
49
+ </rightsList>
50
+ <descriptions>
51
+ <description descriptionType="Abstract">
52
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
53
+ takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
54
+ et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
55
+ </description>
56
+ </descriptions>
57
+ </resource>
@@ -242,6 +242,24 @@ describe Bolognese::Metadata, vcr: true do
242
242
  expect(subject.provider).to eq("DataCite")
243
243
  end
244
244
 
245
+ it "Schema 4.1 from string" do
246
+ input = fixture_path + "datacite-example-complicated-v4.1.xml"
247
+ subject = Bolognese::Metadata.new(input: input)
248
+ expect(subject.valid?).to be true
249
+ expect(subject.id).to eq("https://doi.org/10.5072/testpub")
250
+ expect(subject.type).to eq("ScholarlyArticle")
251
+ expect(subject.additional_type).to eq("Monograph")
252
+ expect(subject.resource_type_general).to eq("Text")
253
+ expect(subject.author).to eq([{"type"=>"Person", "name"=>"John Smith", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
254
+ expect(subject.title).to eq(["Właściwości rzutowań podprzestrzeniowych", {"title_type"=>"TranslatedTitle", "text"=>"Translation of Polish titles"}])
255
+ expect(subject.alternate_name).to eq("type"=>"ISBN", "name"=>"937-0-4523-12357-6")
256
+ expect(subject.date_published).to eq("2010")
257
+ expect(subject.is_part_of).to eq("type"=>"CreativeWork", "id"=>"https://doi.org/10.5272/oldertestpub")
258
+ expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by-nd/2.0", "name"=>"Creative Commons Attribution-NoDerivs 2.0 Generic")
259
+ expect(subject.publisher).to eq("Springer")
260
+ expect(subject.provider).to eq("DataCite")
261
+ end
262
+
245
263
  it "empty subject" do
246
264
  input = "https://doi.org/10.18169/PAPDEOTTX00502"
247
265
  subject = Bolognese::Metadata.new(input: input)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.48
4
+ version: 0.9.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -521,12 +521,13 @@ files:
521
521
  - resources/kernel-3/include/datacite-titleType-v3.xsd
522
522
  - resources/kernel-3/metadata.xsd
523
523
  - resources/kernel-4/include/datacite-contributorType-v4.xsd
524
- - resources/kernel-4/include/datacite-dateType-v4.xsd
524
+ - resources/kernel-4/include/datacite-dateType-v4.1.xsd
525
525
  - resources/kernel-4/include/datacite-descriptionType-v4.xsd
526
526
  - resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd
527
+ - resources/kernel-4/include/datacite-nameType-v4.1.xsd
527
528
  - resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd
528
- - resources/kernel-4/include/datacite-relationType-v4.xsd
529
- - resources/kernel-4/include/datacite-resourceType-v4.xsd
529
+ - resources/kernel-4/include/datacite-relationType-v4.1.xsd
530
+ - resources/kernel-4/include/datacite-resourceType-v4.1.xsd
530
531
  - resources/kernel-4/include/datacite-titleType-v4.xsd
531
532
  - resources/kernel-4/metadata.xsd
532
533
  - resources/schema_org/jsonldcontext.json
@@ -541,6 +542,7 @@ files:
541
542
  - spec/fixtures/crossref.bib
542
543
  - spec/fixtures/crossref.ris
543
544
  - spec/fixtures/crossref.xml
545
+ - spec/fixtures/datacite-example-complicated-v4.1.xml
544
546
  - spec/fixtures/datacite.json
545
547
  - spec/fixtures/datacite.xml
546
548
  - spec/fixtures/datacite_dataset.xml
@@ -859,7 +861,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
859
861
  version: '0'
860
862
  requirements: []
861
863
  rubyforge_project:
862
- rubygems_version: 2.4.5
864
+ rubygems_version: 2.6.13
863
865
  signing_key:
864
866
  specification_version: 4
865
867
  summary: Ruby client library for conversion of DOI Metadata