bolognese 1.2.16 → 1.2.17
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 +1 -1
- data/lib/bolognese/metadata_utils.rb +2 -2
- data/lib/bolognese/version.rb +1 -1
- data/spec/writers/schema_org_writer_spec.rb +4 -4
- data/spec/writers/turtle_writer_spec.rb +1 -1
- 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: 6994f10d7662d22d3fb2f8095787626c4d0f3725229f2e368b8e4a2bda9f13ce
|
4
|
+
data.tar.gz: cac8eaba0ce32942b25d66aaf1bd916361e8a744335aeec02b55c90a93e41a3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aad9750206e2eec8817763f9aa423fc024dd03daaf13ba2b757a9a6005e68b65e5323609bb4d15a53877c62e7badd55bb20241867c41e2e08091c760e3bf80d
|
7
|
+
data.tar.gz: d8fbc18d86fabcb913c8e42c122397f69e718cc33a3c55046d6a17244e5d98e45f4d7f0f083116da3cbab983d8911b20b51dbd07e7d7817f1970f3679b84819f
|
data/Gemfile.lock
CHANGED
@@ -108,12 +108,12 @@ module Bolognese
|
|
108
108
|
def reverse
|
109
109
|
{ "citation" => Array.wrap(related_identifiers).select { |ri| ri["relationType"] == "IsReferencedBy" }.map do |r|
|
110
110
|
{ "@id" => normalize_doi(r["relatedIdentifier"]),
|
111
|
-
"@type" => r["resourceTypeGeneral"] || "
|
111
|
+
"@type" => r["resourceTypeGeneral"] || "ScholarlyArticle",
|
112
112
|
"identifier" => r["relatedIdentifierType"] == "DOI" ? nil : to_identifier(r) }.compact
|
113
113
|
end.unwrap,
|
114
114
|
"isBasedOn" => Array.wrap(related_identifiers).select { |ri| ri["relationType"] == "IsSupplementTo" }.map do |r|
|
115
115
|
{ "@id" => normalize_doi(r["relatedIdentifier"]),
|
116
|
-
"@type" => r["resourceTypeGeneral"] || "
|
116
|
+
"@type" => r["resourceTypeGeneral"] || "ScholarlyArticle",
|
117
117
|
"identifier" => r["relatedIdentifierType"] == "DOI" ? nil : to_identifier(r) }.compact
|
118
118
|
end.unwrap }.compact
|
119
119
|
end
|
data/lib/bolognese/version.rb
CHANGED
@@ -48,8 +48,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
48
48
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
49
49
|
json = JSON.parse(subject.schema_org)
|
50
50
|
expect(json["@id"]).to eq("https://doi.org/10.5061/dryad.8515")
|
51
|
-
expect(json["@reverse"]).to eq("citation" => [{"@id"=>"https://doi.org/10.1371/journal.ppat.1000446", "@type"=>"
|
52
|
-
"isBasedOn" => [{"@id"=>"https://doi.org/10.1371/journal.ppat.1000446", "@type"=>"
|
51
|
+
expect(json["@reverse"]).to eq("citation" => [{"@id"=>"https://doi.org/10.1371/journal.ppat.1000446", "@type"=>"ScholarlyArticle"}, {"@type"=>"ScholarlyArticle", "identifier"=>{"@type"=>"PropertyValue", "propertyID"=>"PMID", "value"=>"19478877"}}],
|
52
|
+
"isBasedOn" => [{"@id"=>"https://doi.org/10.1371/journal.ppat.1000446", "@type"=>"ScholarlyArticle"}, {"@type"=>"ScholarlyArticle", "identifier"=>{"@type"=>"PropertyValue", "propertyID"=>"PMID", "value"=>"19478877"}}])
|
53
53
|
end
|
54
54
|
|
55
55
|
it "Schema.org JSON IsSupplementTo" do
|
@@ -57,7 +57,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
57
57
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
58
58
|
json = JSON.parse(subject.schema_org)
|
59
59
|
expect(json["@id"]).to eq("https://doi.org/10.5517/cc8h01s")
|
60
|
-
expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1107/s1600536804021154", "@type"=>"
|
60
|
+
expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1107/s1600536804021154", "@type"=>"ScholarlyArticle"})
|
61
61
|
end
|
62
62
|
|
63
63
|
it "rdataone" do
|
@@ -132,7 +132,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
132
132
|
expect(json["contentSize"]).to eq("15.7M")
|
133
133
|
expect(json["contentUrl"]).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz")
|
134
134
|
expect(json["includedInDataCatalog"]).to eq("@id"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "@type"=>"DataCatalog", "name"=>"GTEx")
|
135
|
-
expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1038/nmeth.4407", "@type"=>"
|
135
|
+
expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1038/nmeth.4407", "@type"=>"ScholarlyArticle"})
|
136
136
|
end
|
137
137
|
|
138
138
|
it "series information" do
|
@@ -18,7 +18,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
18
18
|
expect(subject.valid?).to be true
|
19
19
|
ttl = subject.turtle.split("\n")
|
20
20
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
21
|
-
expect(ttl[2]).to eq("<https://doi.org/10.1371/journal.ppat.1000446> a schema:
|
21
|
+
expect(ttl[2]).to eq("<https://doi.org/10.1371/journal.ppat.1000446> a schema:ScholarlyArticle;")
|
22
22
|
end
|
23
23
|
|
24
24
|
# it "BlogPosting" do
|