bolognese 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/utils.rb +8 -8
- data/lib/bolognese/version.rb +1 -1
- data/spec/find_from_format_spec.rb +1 -1
- data/spec/readers/schema_org_reader_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a7c798a8ea465ed7c94ffb395c4f44c6728430e408a2690367afb78610552e
|
4
|
+
data.tar.gz: 3d2e408ca2cbfa8ea3fb183f52b462a8fcf4ebc6c50752467f6ef7251cb31f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c3b485dba221c416990278b66a83b5e50b6fed6dd597808fa1524e43a961b87f94c6b2c0c8f4ee46e13615bdb96c5263b9040d4d0f7c713c58e34ff064857f
|
7
|
+
data.tar.gz: 58f43340d776f40d80f66d68b67b2400e1186b9a8d869bbe9dd5d4d69cc8a87863ec43440ef6a7ce5eb560332791d5a88006d8ae5be605fed0e24f68918c7168
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
@@ -356,16 +356,16 @@ module Bolognese
|
|
356
356
|
"crossref"
|
357
357
|
elsif options[:ext] == ".xml" && Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
358
358
|
"datacite"
|
359
|
+
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("@context").to_s.start_with?("http://schema.org", "https://schema.org")
|
360
|
+
"schema_org"
|
361
|
+
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("@context") == ("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
362
|
+
"codemeta"
|
359
363
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("ris_type")
|
360
364
|
"crosscite"
|
361
365
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("schemaVersion").to_s.start_with?("http://datacite.org/schema/kernel")
|
362
366
|
"datacite_json"
|
363
367
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("issued", "date-parts").present?
|
364
368
|
"citeproc"
|
365
|
-
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("@context").to_s.start_with?("http://schema.org", "https://schema.org")
|
366
|
-
"schema_org"
|
367
|
-
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("@context") == ("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
368
|
-
"codemeta"
|
369
369
|
end
|
370
370
|
end
|
371
371
|
|
@@ -376,14 +376,14 @@ module Bolognese
|
|
376
376
|
"datacite"
|
377
377
|
elsif Maremma.from_json(string).to_h.dig("ris_type").present?
|
378
378
|
"crosscite"
|
379
|
-
elsif Maremma.from_json(string).to_h.dig("schemaVersion").to_s.start_with?("http://datacite.org/schema/kernel")
|
380
|
-
"datacite_json"
|
381
|
-
elsif Maremma.from_json(string).to_h.dig("issued", "date-parts").present?
|
382
|
-
"citeproc"
|
383
379
|
elsif Maremma.from_json(string).to_h.dig("@context").to_s.start_with?("http://schema.org", "https://schema.org")
|
384
380
|
"schema_org"
|
385
381
|
elsif Maremma.from_json(string).to_h.dig("@context") == ("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
386
382
|
"codemeta"
|
383
|
+
elsif Maremma.from_json(string).to_h.dig("schemaVersion").to_s.start_with?("http://datacite.org/schema/kernel")
|
384
|
+
"datacite_json"
|
385
|
+
elsif Maremma.from_json(string).to_h.dig("issued", "date-parts").present?
|
386
|
+
"citeproc"
|
387
387
|
elsif string.start_with?("TY - ")
|
388
388
|
"ris"
|
389
389
|
elsif BibTeX.parse(string).first
|
data/lib/bolognese/version.rb
CHANGED
@@ -56,7 +56,7 @@ describe Bolognese::CLI do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "schema_org" do
|
59
|
-
string = IO.read(fixture_path + '
|
59
|
+
string = IO.read(fixture_path + 'schema_org_topmed.json').strip
|
60
60
|
expect(subject.find_from_format_by_string(string)).to eq("schema_org")
|
61
61
|
end
|
62
62
|
|
@@ -131,7 +131,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
131
131
|
|
132
132
|
it "GTEx dataset" do
|
133
133
|
input = fixture_path + 'schema_org_gtex.json'
|
134
|
-
subject = Bolognese::Metadata.new(input: input
|
134
|
+
subject = Bolognese::Metadata.new(input: input)
|
135
135
|
|
136
136
|
expect(subject.valid?).to be true
|
137
137
|
expect(subject.identifier).to eq("https://doi.org/10.25491/d50j-3083")
|
@@ -172,7 +172,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
172
172
|
|
173
173
|
it "TOPMed dataset" do
|
174
174
|
input = fixture_path + 'schema_org_topmed.json'
|
175
|
-
subject = Bolognese::Metadata.new(input: input
|
175
|
+
subject = Bolognese::Metadata.new(input: input)
|
176
176
|
|
177
177
|
expect(subject.valid?).to be true
|
178
178
|
expect(subject.identifier).to eq("https://doi.org/10.23725/8na3-9s47")
|