commonmeta-ruby 3.2.14 → 3.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/commonmeta/readers/json_feed_reader.rb +5 -1
- data/lib/commonmeta/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/substack_post_with_broken_reference.yml +1316 -0
- data/spec/readers/json_feed_reader_spec.rb +204 -178
- metadata +2 -1
@@ -1,244 +1,270 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
describe Commonmeta::Metadata, vcr: true do
|
6
6
|
subject { described_class.new }
|
7
7
|
|
8
|
-
context
|
9
|
-
it
|
10
|
-
input =
|
8
|
+
context "get json_feed_item metadata" do
|
9
|
+
it "blogger post" do
|
10
|
+
input = "https://rogue-scholar.org/api/posts/f3629c86-06e0-42c0-844a-266b03a91ef1"
|
11
11
|
subject = described_class.new(input: input)
|
12
12
|
expect(subject.valid?).to be true
|
13
|
-
expect(subject.id).to eq(
|
14
|
-
expect(subject.url).to eq(
|
15
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"f3629c86-06e0-42c0-844a-266b03a91ef1", "alternateIdentifierType"=>"UUID"}])
|
16
|
-
expect(subject.type).to eq(
|
13
|
+
expect(subject.id).to eq("https://iphylo.blogspot.com/2023/05/ten-years-and-million-links.html")
|
14
|
+
expect(subject.url).to eq("https://iphylo.blogspot.com/2023/05/ten-years-and-million-links.html")
|
15
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "f3629c86-06e0-42c0-844a-266b03a91ef1", "alternateIdentifierType" => "UUID" }])
|
16
|
+
expect(subject.type).to eq("Article")
|
17
17
|
expect(subject.creators.length).to eq(1)
|
18
|
-
expect(subject.creators.first).to eq("familyName"=>"Page", "givenName"=>"Roderic", "type"=>"Person")
|
19
|
-
expect(subject.titles).to eq([{"title"=>"Ten years and a million links"}])
|
20
|
-
expect(subject.license).to eq(
|
21
|
-
|
22
|
-
expect(subject.date).to eq(
|
23
|
-
expect(subject.descriptions.first[
|
24
|
-
expect(subject.publisher).to eq(
|
25
|
-
expect(subject.subjects).to eq([{"subject"=>"Natural sciences"},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
expect(subject.language).to eq(
|
30
|
-
expect(subject.container).to eq("identifier"=>"https://iphylo.blogspot.com/", "identifierType"=>"URL", "title"=>"iPhylo", "type"=>"Periodical")
|
18
|
+
expect(subject.creators.first).to eq("familyName" => "Page", "givenName" => "Roderic", "type" => "Person")
|
19
|
+
expect(subject.titles).to eq([{ "title" => "Ten years and a million links" }])
|
20
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
21
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
22
|
+
expect(subject.date).to eq("published" => "2023-05-31")
|
23
|
+
expect(subject.descriptions.first["description"]).to start_with("As trailed on a Twitter thread last week I’ve been working on a manuscript describing the efforts to map taxonomic names to their original descriptions in the taxonomic literature.")
|
24
|
+
expect(subject.publisher).to eq("name" => "iPhylo")
|
25
|
+
expect(subject.subjects).to eq([{ "subject" => "Natural sciences" },
|
26
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
27
|
+
"subject" => "FOS: Natural sciences",
|
28
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
29
|
+
expect(subject.language).to eq("en")
|
30
|
+
expect(subject.container).to eq("identifier" => "https://iphylo.blogspot.com/", "identifierType" => "URL", "title" => "iPhylo", "type" => "Periodical")
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
34
|
-
input =
|
33
|
+
it "ghost post with doi" do
|
34
|
+
input = "https://rogue-scholar.org/api/posts/5bb66e92-5cb9-4659-8aca-20e486b695c9"
|
35
35
|
subject = described_class.new(input: input)
|
36
36
|
expect(subject.valid?).to be true
|
37
|
-
expect(subject.id).to eq(
|
38
|
-
expect(subject.url).to eq(
|
39
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"5bb66e92-5cb9-4659-8aca-20e486b695c9", "alternateIdentifierType"=>"UUID"}])
|
40
|
-
expect(subject.type).to eq(
|
37
|
+
expect(subject.id).to eq("https://doi.org/10.53731/4nwxn-frt36")
|
38
|
+
expect(subject.url).to eq("https://blog.front-matter.io/posts/does-it-compose")
|
39
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "5bb66e92-5cb9-4659-8aca-20e486b695c9", "alternateIdentifierType" => "UUID" }])
|
40
|
+
expect(subject.type).to eq("Article")
|
41
41
|
expect(subject.creators.length).to eq(1)
|
42
|
-
expect(subject.creators.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName"=>"Fenner", "givenName"=>"Martin", "type"=>"Person")
|
43
|
-
expect(subject.titles).to eq([{"title"=>"Does it compose?"}])
|
44
|
-
expect(subject.license).to eq(
|
45
|
-
|
46
|
-
expect(subject.date).to eq(
|
47
|
-
expect(subject.descriptions.first[
|
48
|
-
expect(subject.publisher).to eq(
|
49
|
-
expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
expect(subject.language).to eq(
|
54
|
-
expect(subject.container).to eq("identifier"=>"https://blog.front-matter.io", "identifierType"=>"URL", "title"=>"Front Matter", "type"=>"Periodical")
|
42
|
+
expect(subject.creators.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person")
|
43
|
+
expect(subject.titles).to eq([{ "title" => "Does it compose?" }])
|
44
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
45
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
46
|
+
expect(subject.date).to eq("published" => "2023-05-16", "updated" => "2023-05-16")
|
47
|
+
expect(subject.descriptions.first["description"]).to start_with("One question I have increasingly asked myself in the past few years. Meaning Can I run this open source software using Docker containers and a Docker Compose file?")
|
48
|
+
expect(subject.publisher).to eq("name" => "Front Matter")
|
49
|
+
expect(subject.subjects).to eq([{ "subject" => "Engineering and technology" },
|
50
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
51
|
+
"subject" => "FOS: Engineering and technology",
|
52
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
53
|
+
expect(subject.language).to eq("en")
|
54
|
+
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
55
55
|
end
|
56
56
|
|
57
|
-
it
|
58
|
-
input =
|
57
|
+
it "ghost post without doi" do
|
58
|
+
input = "https://rogue-scholar.org/api/posts/c3095752-2af0-40a4-a229-3ceb7424bce2"
|
59
59
|
subject = described_class.new(input: input)
|
60
60
|
expect(subject.valid?).to be true
|
61
|
-
expect(subject.id).to eq(
|
62
|
-
expect(subject.url).to eq(
|
63
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"c3095752-2af0-40a4-a229-3ceb7424bce2", "alternateIdentifierType"=>"UUID"}])
|
64
|
-
expect(subject.type).to eq(
|
61
|
+
expect(subject.id).to eq("https://www.ideasurg.pub/residency-visual-abstract")
|
62
|
+
expect(subject.url).to eq("https://www.ideasurg.pub/residency-visual-abstract")
|
63
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "c3095752-2af0-40a4-a229-3ceb7424bce2", "alternateIdentifierType" => "UUID" }])
|
64
|
+
expect(subject.type).to eq("Article")
|
65
65
|
expect(subject.creators.length).to eq(1)
|
66
|
-
expect(subject.creators.first).to eq("familyName"=>"Sathe", "givenName"=>"Tejas S.", "type"=>"Person")
|
67
|
-
expect(subject.titles).to eq([{"title"=>"The Residency Visual Abstract"}])
|
68
|
-
expect(subject.license).to eq(
|
69
|
-
|
70
|
-
expect(subject.date).to eq(
|
71
|
-
expect(subject.descriptions.first[
|
72
|
-
expect(subject.publisher).to eq(
|
73
|
-
expect(subject.subjects).to eq([{"subject"=>"Medical and health sciences"},
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
expect(subject.language).to eq(
|
78
|
-
expect(subject.container).to eq("identifier"=>"https://www.ideasurg.pub/", "identifierType"=>"URL", "title"=>"I.D.E.A.S.", "type"=>"Periodical")
|
66
|
+
expect(subject.creators.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.", "type" => "Person")
|
67
|
+
expect(subject.titles).to eq([{ "title" => "The Residency Visual Abstract" }])
|
68
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
69
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
70
|
+
expect(subject.date).to eq("published" => "2023-04-08")
|
71
|
+
expect(subject.descriptions.first["description"]).to start_with("A graphical, user-friendly tool for programs to highlight important data to prospective applicants")
|
72
|
+
expect(subject.publisher).to eq("name" => "I.D.E.A.S.")
|
73
|
+
expect(subject.subjects).to eq([{ "subject" => "Medical and health sciences" },
|
74
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
75
|
+
"subject" => "FOS: Medical and health sciences",
|
76
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
77
|
+
expect(subject.language).to eq("en")
|
78
|
+
expect(subject.container).to eq("identifier" => "https://www.ideasurg.pub/", "identifierType" => "URL", "title" => "I.D.E.A.S.", "type" => "Periodical")
|
79
79
|
end
|
80
80
|
|
81
|
-
it
|
82
|
-
input =
|
81
|
+
it "ghost post with author name suffix" do
|
82
|
+
input = "https://rogue-scholar.org/api/posts/6179ad80-cc7f-4904-9260-0ecb3c3a90ba"
|
83
83
|
subject = described_class.new(input: input)
|
84
84
|
expect(subject.valid?).to be true
|
85
|
-
expect(subject.id).to eq(
|
86
|
-
expect(subject.url).to eq(
|
87
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"6179ad80-cc7f-4904-9260-0ecb3c3a90ba", "alternateIdentifierType"=>"UUID"}])
|
88
|
-
expect(subject.type).to eq(
|
85
|
+
expect(subject.id).to eq("https://www.ideasurg.pub/academic-powerhouse")
|
86
|
+
expect(subject.url).to eq("https://www.ideasurg.pub/academic-powerhouse")
|
87
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "6179ad80-cc7f-4904-9260-0ecb3c3a90ba", "alternateIdentifierType" => "UUID" }])
|
88
|
+
expect(subject.type).to eq("Article")
|
89
89
|
expect(subject.creators.length).to eq(1)
|
90
|
-
expect(subject.creators.first).to eq("familyName"=>"Sathe", "givenName"=>"Tejas S.", "type"=>"Person")
|
91
|
-
expect(subject.titles).to eq([{"title"=>"How to Build an Academic Powerhouse: Let's Study Who's Doing it"}])
|
92
|
-
expect(subject.license).to eq(
|
93
|
-
|
94
|
-
expect(subject.date).to eq(
|
95
|
-
expect(subject.descriptions.first[
|
96
|
-
expect(subject.publisher).to eq(
|
97
|
-
expect(subject.subjects).to eq([{"subject"=>"Medical and health sciences"},
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
expect(subject.language).to eq(
|
102
|
-
expect(subject.container).to eq("identifier"=>"https://www.ideasurg.pub/", "identifierType"=>"URL", "title"=>"I.D.E.A.S.", "type"=>"Periodical")
|
90
|
+
expect(subject.creators.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.", "type" => "Person")
|
91
|
+
expect(subject.titles).to eq([{ "title" => "How to Build an Academic Powerhouse: Let's Study Who's Doing it" }])
|
92
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
93
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
94
|
+
expect(subject.date).to eq("published" => "2023-06-03")
|
95
|
+
expect(subject.descriptions.first["description"]).to start_with("A Data Exploration with Public Data from the Academic Surgical Congress")
|
96
|
+
expect(subject.publisher).to eq("name" => "I.D.E.A.S.")
|
97
|
+
expect(subject.subjects).to eq([{ "subject" => "Medical and health sciences" },
|
98
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
99
|
+
"subject" => "FOS: Medical and health sciences",
|
100
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
101
|
+
expect(subject.language).to eq("en")
|
102
|
+
expect(subject.container).to eq("identifier" => "https://www.ideasurg.pub/", "identifierType" => "URL", "title" => "I.D.E.A.S.", "type" => "Periodical")
|
103
103
|
expect(subject.references).to be_nil
|
104
104
|
end
|
105
105
|
|
106
|
-
it
|
107
|
-
input =
|
106
|
+
it "syldavia gazette post with references" do
|
107
|
+
input = "https://rogue-scholar.org/api/posts/0022b9ef-525a-4a79-81ad-13411697f58a"
|
108
108
|
subject = described_class.new(input: input)
|
109
109
|
expect(subject.valid?).to be true
|
110
|
-
expect(subject.id).to eq(
|
111
|
-
expect(subject.url).to eq(
|
112
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"0022b9ef-525a-4a79-81ad-13411697f58a", "alternateIdentifierType"=>"UUID"}])
|
113
|
-
expect(subject.type).to eq(
|
110
|
+
expect(subject.id).to eq("https://doi.org/10.53731/ffbx660-083tnag")
|
111
|
+
expect(subject.url).to eq("https://syldavia-gazette.org/guinea-worms-chatgpt-neanderthals")
|
112
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "0022b9ef-525a-4a79-81ad-13411697f58a", "alternateIdentifierType" => "UUID" }])
|
113
|
+
expect(subject.type).to eq("Article")
|
114
114
|
expect(subject.creators.length).to eq(1)
|
115
|
-
expect(subject.creators.first).to eq("familyName"=>"Fenner", "givenName"=>"Martin", "id"=>"https://orcid.org/0000-0003-1419-2405", "type"=>"Person")
|
116
|
-
expect(subject.titles).to eq([{"title"=>"Guinea Worms, ChatGPT, Neanderthals, Plagiarism, Tidyverse"}])
|
117
|
-
expect(subject.license).to eq(
|
118
|
-
|
119
|
-
expect(subject.date).to eq(
|
120
|
-
expect(subject.descriptions.first[
|
121
|
-
expect(subject.publisher).to eq(
|
122
|
-
expect(subject.subjects).to eq([{"subject"=>"Humanities"}, {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf", "subject"=>"FOS: Humanities", "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
|
123
|
-
expect(subject.language).to eq(
|
124
|
-
expect(subject.container).to eq("identifier"=>"https://syldavia-gazette.org", "identifierType"=>"URL", "title"=>"Syldavia Gazette", "type"=>"Periodical")
|
115
|
+
expect(subject.creators.first).to eq("familyName" => "Fenner", "givenName" => "Martin", "id" => "https://orcid.org/0000-0003-1419-2405", "type" => "Person")
|
116
|
+
expect(subject.titles).to eq([{ "title" => "Guinea Worms, ChatGPT, Neanderthals, Plagiarism, Tidyverse" }])
|
117
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
118
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
119
|
+
expect(subject.date).to eq("published" => "2023-02-01", "updated" => "2023-04-13")
|
120
|
+
expect(subject.descriptions.first["description"]).to start_with("Guinea worm disease reaches all-time low: only 13* human cases reported in 2022")
|
121
|
+
expect(subject.publisher).to eq("name" => "Syldavia Gazette")
|
122
|
+
expect(subject.subjects).to eq([{ "subject" => "Humanities" }, { "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf", "subject" => "FOS: Humanities", "subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
123
|
+
expect(subject.language).to eq("en")
|
124
|
+
expect(subject.container).to eq("identifier" => "https://syldavia-gazette.org", "identifierType" => "URL", "title" => "Syldavia Gazette", "type" => "Periodical")
|
125
125
|
expect(subject.references.length).to eq(5)
|
126
|
-
expect(subject.references.first).to eq("key"=>"ref1", "url"=>"https://cartercenter.org/news/pr/2023/2022-guinea-worm-worldwide-cases-announcement.html")
|
126
|
+
expect(subject.references.first).to eq("key" => "ref1", "url" => "https://cartercenter.org/news/pr/2023/2022-guinea-worm-worldwide-cases-announcement.html")
|
127
127
|
end
|
128
128
|
|
129
|
-
it
|
130
|
-
input =
|
129
|
+
it "wordpress post" do
|
130
|
+
input = "https://rogue-scholar.org/api/posts/1c578558-1324-4493-b8af-84c49eabc52f"
|
131
131
|
subject = described_class.new(input: input)
|
132
132
|
expect(subject.valid?).to be true
|
133
|
-
expect(subject.id).to eq(
|
134
|
-
expect(subject.url).to eq(
|
135
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"1c578558-1324-4493-b8af-84c49eabc52f", "alternateIdentifierType"=>"UUID"}])
|
136
|
-
expect(subject.type).to eq(
|
133
|
+
expect(subject.id).to eq("http://wisspub.net/?p=20455")
|
134
|
+
expect(subject.url).to eq("https://wisspub.net/2023/05/23/eu-mitgliedstaaten-betonen-die-rolle-von-wissenschaftsgeleiteten-open-access-modellen-jenseits-von-apcs")
|
135
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "1c578558-1324-4493-b8af-84c49eabc52f", "alternateIdentifierType" => "UUID" }])
|
136
|
+
expect(subject.type).to eq("Article")
|
137
137
|
expect(subject.creators.length).to eq(1)
|
138
|
-
expect(subject.creators.first).to eq("familyName"=>"Pampel", "givenName"=>"Heinz", "id"=>"https://orcid.org/0000-0003-3334-2771", "type"=>"Person")
|
139
|
-
expect(subject.titles).to eq([{"title"=>"EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs"}])
|
140
|
-
expect(subject.license).to eq(
|
141
|
-
|
142
|
-
expect(subject.date).to eq(
|
143
|
-
expect(subject.descriptions.first[
|
144
|
-
expect(subject.publisher).to eq(
|
145
|
-
expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
expect(subject.language).to eq(
|
150
|
-
expect(subject.container).to eq("identifier"=>"https://wisspub.net", "identifierType"=>"URL", "title"=>"wisspub.net", "type"=>"Periodical")
|
138
|
+
expect(subject.creators.first).to eq("familyName" => "Pampel", "givenName" => "Heinz", "id" => "https://orcid.org/0000-0003-3334-2771", "type" => "Person")
|
139
|
+
expect(subject.titles).to eq([{ "title" => "EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs" }])
|
140
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
141
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
142
|
+
expect(subject.date).to eq("published" => "2023-05-23", "updated" => "2023-05-23")
|
143
|
+
expect(subject.descriptions.first["description"]).to start_with("Die EU-Wissenschaftsministerien haben sich auf ihrer heutigen Sitzung in Brüssel unter dem Titel “Council conclusions on high-quality, transparent, open, trustworthy and equitable scholarly publishing”")
|
144
|
+
expect(subject.publisher).to eq("name" => "wisspub.net")
|
145
|
+
expect(subject.subjects).to eq([{ "subject" => "Engineering and technology" },
|
146
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
147
|
+
"subject" => "FOS: Engineering and technology",
|
148
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
149
|
+
expect(subject.language).to eq("de")
|
150
|
+
expect(subject.container).to eq("identifier" => "https://wisspub.net", "identifierType" => "URL", "title" => "wisspub.net", "type" => "Periodical")
|
151
151
|
end
|
152
152
|
|
153
|
-
it
|
154
|
-
input =
|
153
|
+
it "wordpress post with references" do
|
154
|
+
input = "https://rogue-scholar.org/api/posts/4e4bf150-751f-4245-b4ca-fe69e3c3bb24"
|
155
155
|
subject = described_class.new(input: input)
|
156
156
|
expect(subject.valid?).to be true
|
157
|
-
expect(subject.id).to eq(
|
158
|
-
expect(subject.url).to eq(
|
159
|
-
expect(subject.type).to eq(
|
157
|
+
expect(subject.id).to eq("http://svpow.com/?p=20992")
|
158
|
+
expect(subject.url).to eq("https://svpow.com/2023/06/09/new-paper-curtice-et-al-2023-on-the-first-haplocanthosaurus-from-dry-mesa")
|
159
|
+
expect(subject.type).to eq("Article")
|
160
160
|
expect(subject.creators.length).to eq(1)
|
161
|
-
expect(subject.creators.first).to eq("familyName"=>"Wedel", "givenName"=>"Matt", "type"=>"Person")
|
162
|
-
expect(subject.titles).to eq([{"title"=>"New paper: Curtice et al. (2023) on the first Haplocanthosaurus from Dry Mesa"}])
|
163
|
-
expect(subject.license).to eq(
|
164
|
-
|
165
|
-
expect(subject.date).to eq(
|
166
|
-
expect(subject.descriptions.first[
|
167
|
-
expect(subject.publisher).to eq(
|
168
|
-
expect(subject.subjects).to eq([{"subject"=>"Natural sciences"},
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
expect(subject.language).to eq(
|
173
|
-
expect(subject.container).to eq("identifier"=>"https://svpow.com", "identifierType"=>"URL", "title"=>"Sauropod Vertebra Picture of the Week", "type"=>"Periodical")
|
161
|
+
expect(subject.creators.first).to eq("familyName" => "Wedel", "givenName" => "Matt", "type" => "Person")
|
162
|
+
expect(subject.titles).to eq([{ "title" => "New paper: Curtice et al. (2023) on the first Haplocanthosaurus from Dry Mesa" }])
|
163
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
164
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
165
|
+
expect(subject.date).to eq("published" => "2023-06-09", "updated" => "2023-06-09")
|
166
|
+
expect(subject.descriptions.first["description"]).to start_with("Haplocanthosaurus tibiae and dorsal vertebrae.")
|
167
|
+
expect(subject.publisher).to eq("name" => "Sauropod Vertebra Picture of the Week")
|
168
|
+
expect(subject.subjects).to eq([{ "subject" => "Natural sciences" },
|
169
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
170
|
+
"subject" => "FOS: Natural sciences",
|
171
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
172
|
+
expect(subject.language).to eq("en")
|
173
|
+
expect(subject.container).to eq("identifier" => "https://svpow.com", "identifierType" => "URL", "title" => "Sauropod Vertebra Picture of the Week", "type" => "Periodical")
|
174
174
|
expect(subject.references.length).to eq(3)
|
175
|
-
expect(subject.references.first).to eq("key"=>"ref1", "url"=>"https://sauroposeidon.files.wordpress.com/2010/04/foster-and-wedel-2014-haplocanthosaurus-from-snowmass-colorado.pdf")
|
175
|
+
expect(subject.references.first).to eq("key" => "ref1", "url" => "https://sauroposeidon.files.wordpress.com/2010/04/foster-and-wedel-2014-haplocanthosaurus-from-snowmass-colorado.pdf")
|
176
176
|
end
|
177
177
|
|
178
|
-
it
|
179
|
-
input =
|
178
|
+
it "upstream post with references" do
|
179
|
+
input = "https://rogue-scholar.org/api/posts/954f8138-0ecd-4090-87c5-cef1297f1470"
|
180
180
|
subject = described_class.new(input: input)
|
181
181
|
expect(subject.valid?).to be true
|
182
|
-
expect(subject.id).to eq(
|
183
|
-
expect(subject.url).to eq(
|
184
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"954f8138-0ecd-4090-87c5-cef1297f1470", "alternateIdentifierType"=>"UUID"}])
|
185
|
-
expect(subject.type).to eq(
|
182
|
+
expect(subject.id).to eq("https://doi.org/10.54900/zwm7q-vet94")
|
183
|
+
expect(subject.url).to eq("https://upstream.force11.org/the-research-software-alliance-resa")
|
184
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "954f8138-0ecd-4090-87c5-cef1297f1470", "alternateIdentifierType" => "UUID" }])
|
185
|
+
expect(subject.type).to eq("Article")
|
186
186
|
expect(subject.creators.length).to eq(2)
|
187
|
-
expect(subject.creators.first).to eq("familyName"=>"Katz", "givenName"=>"Daniel S.", "id"=>"https://orcid.org/0000-0001-5934-7525", "type"=>"Person")
|
188
|
-
expect(subject.titles).to eq([{"title"=>"The Research Software Alliance (ReSA)"}])
|
189
|
-
expect(subject.license).to eq(
|
190
|
-
|
191
|
-
expect(subject.date).to eq(
|
192
|
-
expect(subject.descriptions.first[
|
193
|
-
expect(subject.publisher).to eq(
|
194
|
-
expect(subject.subjects).to eq([{"subject"=>"Humanities"},
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
expect(subject.language).to eq(
|
199
|
-
expect(subject.container).to eq("identifier"=>"https://upstream.force11.org", "identifierType"=>"URL", "title"=>"Upstream", "type"=>"Periodical")
|
187
|
+
expect(subject.creators.first).to eq("familyName" => "Katz", "givenName" => "Daniel S.", "id" => "https://orcid.org/0000-0001-5934-7525", "type" => "Person")
|
188
|
+
expect(subject.titles).to eq([{ "title" => "The Research Software Alliance (ReSA)" }])
|
189
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
190
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
191
|
+
expect(subject.date).to eq("published" => "2023-04-18", "updated" => "2023-04-18")
|
192
|
+
expect(subject.descriptions.first["description"]).to start_with("Research software is a key part of most research today. As University of Manchester Professor Carole Goble has said, \"software is the ubiquitous instrument of science.\"")
|
193
|
+
expect(subject.publisher).to eq("name" => "Upstream")
|
194
|
+
expect(subject.subjects).to eq([{ "subject" => "Humanities" },
|
195
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
196
|
+
"subject" => "FOS: Humanities",
|
197
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
198
|
+
expect(subject.language).to eq("en")
|
199
|
+
expect(subject.container).to eq("identifier" => "https://upstream.force11.org", "identifierType" => "URL", "title" => "Upstream", "type" => "Periodical")
|
200
200
|
expect(subject.references.length).to eq(11)
|
201
|
-
expect(subject.references.first).to eq("key"=>"ref1", "url"=>"https://software.ac.uk/blog/2014-12-04-its-impossible-conduct-research-without-software-say-7-out-10-uk-researchers")
|
201
|
+
expect(subject.references.first).to eq("key" => "ref1", "url" => "https://software.ac.uk/blog/2014-12-04-its-impossible-conduct-research-without-software-say-7-out-10-uk-researchers")
|
202
202
|
end
|
203
203
|
|
204
|
-
it
|
205
|
-
input =
|
204
|
+
it "jekyll post" do
|
205
|
+
input = "https://rogue-scholar.org/api/posts/efdacb04-bcec-49d7-b689-ab3eab0634bf"
|
206
206
|
subject = described_class.new(input: input)
|
207
207
|
expect(subject.valid?).to be true
|
208
|
-
expect(subject.id).to eq(
|
209
|
-
expect(subject.url).to eq(
|
210
|
-
expect(subject.alternate_identifiers).to eq([{"alternateIdentifier"=>"efdacb04-bcec-49d7-b689-ab3eab0634bf", "alternateIdentifierType"=>"UUID"}])
|
211
|
-
expect(subject.type).to eq(
|
208
|
+
expect(subject.id).to eq("https://citationstyles.org/2020/07/11/seeking-public-comment-on-CSL-1-0-2")
|
209
|
+
expect(subject.url).to eq("https://citationstyles.org/2020/07/11/seeking-public-comment-on-CSL-1-0-2")
|
210
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "efdacb04-bcec-49d7-b689-ab3eab0634bf", "alternateIdentifierType" => "UUID" }])
|
211
|
+
expect(subject.type).to eq("Article")
|
212
212
|
expect(subject.creators.length).to eq(1)
|
213
|
-
expect(subject.creators.first).to eq("familyName"=>"Karcher", "givenName"=>"Sebastian", "type"=>"Person")
|
214
|
-
expect(subject.titles).to eq([{"title"=>"Seeking Public Comment on CSL 1.0.2 Release"}])
|
215
|
-
expect(subject.license).to eq(
|
216
|
-
|
217
|
-
expect(subject.date).to eq(
|
218
|
-
expect(subject.descriptions.first[
|
219
|
-
expect(subject.publisher).to eq(
|
220
|
-
expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
expect(subject.language).to eq(
|
225
|
-
expect(subject.container).to eq("identifier"=>"https://citationstyles.org/", "identifierType"=>"URL", "title"=>"Citation Style Language", "type"=>"Periodical")
|
213
|
+
expect(subject.creators.first).to eq("familyName" => "Karcher", "givenName" => "Sebastian", "type" => "Person")
|
214
|
+
expect(subject.titles).to eq([{ "title" => "Seeking Public Comment on CSL 1.0.2 Release" }])
|
215
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
216
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
217
|
+
expect(subject.date).to eq("published" => "2020-07-11", "updated" => "2020-07-11")
|
218
|
+
expect(subject.descriptions.first["description"]).to start_with("Over the past few months, Citation Style Language developers have worked to address a backlog of feature requests. This work will be reflected in two upcoming releases.")
|
219
|
+
expect(subject.publisher).to eq("name" => "Citation Style Language")
|
220
|
+
expect(subject.subjects).to eq([{ "subject" => "Engineering and technology" },
|
221
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
222
|
+
"subject" => "FOS: Engineering and technology",
|
223
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
224
|
+
expect(subject.language).to eq("en")
|
225
|
+
expect(subject.container).to eq("identifier" => "https://citationstyles.org/", "identifierType" => "URL", "title" => "Citation Style Language", "type" => "Periodical")
|
226
|
+
end
|
227
|
+
|
228
|
+
it "substack post with broken reference" do
|
229
|
+
input = "https://rogue-scholar.org/api/posts/2b105b29-acbc-4eae-9ff1-368803f36a4d"
|
230
|
+
subject = described_class.new(input: input)
|
231
|
+
expect(subject.valid?).to be true
|
232
|
+
expect(subject.id).to eq("https://doi.org/10.59350/bbcsr-r4b59")
|
233
|
+
expect(subject.url).to eq("https://markrubin.substack.com/p/the-preregistration-prescriptiveness")
|
234
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "2b105b29-acbc-4eae-9ff1-368803f36a4d", "alternateIdentifierType" => "UUID" }])
|
235
|
+
expect(subject.type).to eq("Article")
|
236
|
+
expect(subject.creators.length).to eq(1)
|
237
|
+
expect(subject.creators.first).to eq("familyName" => "Rubin", "givenName" => "Mark", "type" => "Person")
|
238
|
+
expect(subject.titles).to eq([{ "title" => "The Preregistration Prescriptiveness Trade-Off and Unknown Unknowns in Science" }])
|
239
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
240
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
241
|
+
expect(subject.date).to eq("published" => "2023-06-06")
|
242
|
+
expect(subject.descriptions.first["description"]).to start_with("Comments on Van Drimmelen (2023)")
|
243
|
+
expect(subject.publisher).to eq("name" => "Critical Metascience")
|
244
|
+
expect(subject.subjects).to eq([{ "subject" => "Social sciences" },
|
245
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
246
|
+
"subject" => "FOS: Social sciences",
|
247
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
248
|
+
expect(subject.language).to eq("en")
|
249
|
+
expect(subject.container).to eq("identifier" => "https://markrubin.substack.com", "identifierType" => "URL", "title" => "Critical Metascience", "type" => "Periodical")
|
250
|
+
expect(subject.references.length).to eq(16)
|
251
|
+
expect(subject.references.first).to eq("key" => "ref1", "doi" => "https://doi.org/10.3386/w27250")
|
226
252
|
end
|
227
253
|
end
|
228
254
|
|
229
|
-
context
|
230
|
-
it
|
255
|
+
context "get json_feed" do
|
256
|
+
it "unregistered posts" do
|
231
257
|
response = subject.get_json_feed_unregistered
|
232
258
|
expect(response).to eq("ca2a7df4-f3b9-487c-82e9-27f54de75ea8")
|
233
259
|
end
|
234
260
|
|
235
|
-
it
|
236
|
-
response = subject.get_json_feed_not_indexed(
|
261
|
+
it "not indexed posts" do
|
262
|
+
response = subject.get_json_feed_not_indexed("2023-01-01")
|
237
263
|
expect(response).to eq("ab58e412-06eb-42b7-b81a-d340825b9d48")
|
238
264
|
end
|
239
265
|
|
240
|
-
it
|
241
|
-
response = subject.get_json_feed_by_blog(
|
266
|
+
it "by blog_id" do
|
267
|
+
response = subject.get_json_feed_by_blog("tyfqw20")
|
242
268
|
expect(response).to eq("3e1278f6-e7c0-43e1-bb54-6829e1344c0d")
|
243
269
|
end
|
244
270
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmeta-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
@@ -1185,6 +1185,7 @@ files:
|
|
1185
1185
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_doi.yml
|
1186
1186
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml
|
1187
1187
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml
|
1188
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/substack_post_with_broken_reference.yml
|
1188
1189
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/syldavia_gazette_post_with_references.yml
|
1189
1190
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/upstream_post_with_references.yml
|
1190
1191
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post.yml
|