bolognese 1.5.19 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile.lock +16 -13
  4. data/lib/bolognese/datacite_utils.rb +27 -3
  5. data/lib/bolognese/metadata_utils.rb +1 -0
  6. data/lib/bolognese/readers/bibtex_reader.rb +2 -1
  7. data/lib/bolognese/readers/citeproc_reader.rb +5 -3
  8. data/lib/bolognese/readers/codemeta_reader.rb +6 -4
  9. data/lib/bolognese/readers/crossref_reader.rb +1 -1
  10. data/lib/bolognese/readers/datacite_reader.rb +20 -15
  11. data/lib/bolognese/readers/ris_reader.rb +4 -2
  12. data/lib/bolognese/readers/schema_org_reader.rb +10 -6
  13. data/lib/bolognese/utils.rb +184 -9
  14. data/lib/bolognese/version.rb +1 -1
  15. data/lib/bolognese/writers/bibtex_writer.rb +2 -1
  16. data/lib/bolognese/writers/codemeta_writer.rb +2 -1
  17. data/resources/oecd/for-mappings.json +1101 -0
  18. data/resources/oecd/fos-mappings.json +198 -0
  19. data/resources/spdx/licenses.json +5297 -0
  20. data/spec/datacite_utils_spec.rb +32 -8
  21. data/spec/fixtures/datacite-example-affiliation.xml +1 -1
  22. data/spec/fixtures/datacite-funderIdentifier.xml +4 -0
  23. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_match.yml +44 -0
  24. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_match.yml +44 -0
  25. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_no_match.yml +44 -0
  26. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_for_match.yml +44 -0
  27. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_match.yml +44 -0
  28. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_no_match.yml +44 -0
  29. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml +97 -0
  30. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml +107 -0
  31. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme_FOR.yml +110 -0
  32. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml +49 -0
  33. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_formats/insert.yml +49 -0
  34. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_given_and_family_name.yml +49 -0
  35. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_sizes/insert.yml +49 -0
  36. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml +44 -0
  37. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml +44 -0
  38. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +44 -0
  39. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/to_https.yml +44 -0
  40. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +44 -0
  41. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml +44 -0
  42. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml +44 -0
  43. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml +44 -0
  44. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml +44 -0
  45. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml +44 -0
  46. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_not_found.yml +44 -0
  47. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/http.yml +44 -0
  48. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/uri.yml +44 -0
  49. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/with_trailing_slash.yml +44 -0
  50. data/spec/readers/bibtex_reader_spec.rb +5 -1
  51. data/spec/readers/codemeta_reader_spec.rb +20 -0
  52. data/spec/readers/crossref_reader_spec.rb +21 -5
  53. data/spec/readers/datacite_reader_spec.rb +150 -10
  54. data/spec/readers/schema_org_reader_spec.rb +15 -1
  55. data/spec/utils_spec.rb +108 -0
  56. data/spec/writers/bibtex_writer_spec.rb +6 -0
  57. data/spec/writers/citeproc_writer_spec.rb +10 -0
  58. data/spec/writers/crosscite_writer_spec.rb +5 -1
  59. data/spec/writers/datacite_json_writer_spec.rb +5 -1
  60. data/spec/writers/datacite_writer_spec.rb +30 -6
  61. data/spec/writers/schema_org_writer_spec.rb +11 -0
  62. metadata +32 -2
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: 1.5.19
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -722,7 +722,10 @@ files:
722
722
  - resources/kernel-4/include/datacite-titleType-v4.xsd
723
723
  - resources/kernel-4/include/xml.xsd
724
724
  - resources/kernel-4/metadata.xsd
725
+ - resources/oecd/for-mappings.json
726
+ - resources/oecd/fos-mappings.json
725
727
  - resources/schema_org/jsonldcontext.json
728
+ - resources/spdx/licenses.json
726
729
  - resources/xml.xsd
727
730
  - spec/array_spec.rb
728
731
  - spec/author_utils_spec.rb
@@ -874,6 +877,12 @@ files:
874
877
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml
875
878
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml
876
879
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml
880
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_match.yml
881
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_match.yml
882
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_no_match.yml
883
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_for_match.yml
884
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_match.yml
885
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_no_match.yml
877
886
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml
878
887
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/with_affiliation.yml
879
888
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/without_affiliation.yml
@@ -935,15 +944,18 @@ files:
935
944
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml
936
945
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml
937
946
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml
947
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml
938
948
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_references.yml
939
949
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml
940
950
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml
941
951
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml
942
952
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml
953
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml
943
954
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml
944
955
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml
945
956
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/series-information.yml
946
957
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme.yml
958
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme_FOR.yml
947
959
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/xs_string_attributes.yml
948
960
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date/publication_date.yml
949
961
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml
@@ -994,9 +1006,12 @@ files:
994
1006
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_alternate_identifiers/insert.yml
995
1007
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml
996
1008
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml
1009
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml
997
1010
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml
1011
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_formats/insert.yml
998
1012
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml
999
1013
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_language/insert.yml
1014
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_given_and_family_name.yml
1000
1015
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml
1001
1016
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml
1002
1017
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml
@@ -1004,6 +1019,7 @@ files:
1004
1019
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml
1005
1020
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml
1006
1021
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml
1022
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_sizes/insert.yml
1007
1023
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml
1008
1024
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml
1009
1025
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml
@@ -1018,6 +1034,9 @@ files:
1018
1034
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml
1019
1035
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml
1020
1036
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml
1037
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml
1038
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml
1039
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml
1021
1040
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml
1022
1041
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml
1023
1042
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml
@@ -1045,8 +1064,10 @@ files:
1045
1064
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml
1046
1065
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml
1047
1066
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml
1067
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/to_https.yml
1048
1068
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml
1049
1069
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml
1070
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml
1050
1071
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml
1051
1072
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml
1052
1073
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml
@@ -1055,8 +1076,17 @@ files:
1055
1076
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml
1056
1077
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml
1057
1078
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml
1079
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml
1080
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml
1081
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml
1082
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml
1083
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml
1084
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_not_found.yml
1058
1085
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml
1059
1086
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml
1087
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/http.yml
1088
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/uri.yml
1089
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/url_to_https/with_trailing_slash.yml
1060
1090
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml
1061
1091
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml
1062
1092
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml