Skip to content

Commit

Permalink
Merge pull request #861 from datacite/enable_related_items
Browse files Browse the repository at this point in the history
Re-enable related items
  • Loading branch information
digitaldogsbody authored Oct 11, 2022
2 parents 41fab76 + 4197052 commit 6a09c56
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 106 deletions.
38 changes: 19 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
amazing_print (1.4.0)
ansi (1.5.0)
apollo-federation (1.1.3)
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
latex-decode (~> 0.0)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bolognese (1.9.17)
bolognese (1.9.18)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down Expand Up @@ -209,7 +209,7 @@ GEM
scanf (~> 1.0)
sxp (~> 1.2)
unicode-types (~> 1.7)
edtf (3.0.8)
edtf (3.1.0)
activesupport (>= 3.0, < 8.0)
elasticsearch (7.5.0)
elasticsearch-api (= 7.5.0)
Expand Down Expand Up @@ -283,22 +283,22 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
i18n_data (0.8.0)
iso-639 (0.3.5)
iso8601 (0.9.1)
jmespath (1.6.1)
json (2.6.2)
json-canonicalization (0.3.0)
json-ld (3.2.1)
json-ld (3.2.3)
htmlentities (~> 4.3)
json-canonicalization (~> 0.3)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.15)
rack (~> 2.2)
rdf (~> 3.2)
json-ld-preloaded (3.2.0)
rdf (~> 3.2, >= 3.2.9)
json-ld-preloaded (3.2.1)
json-ld (~> 3.2)
rdf (~> 3.2)
jsonapi-renderer (0.2.2)
Expand All @@ -324,7 +324,7 @@ GEM
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
latex-decode (0.3.2)
latex-decode (0.4.0)
link_header (0.0.8)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand All @@ -339,7 +339,7 @@ GEM
logstash-event (1.2.02)
logstash-logger (0.26.1)
logstash-event (~> 1.2)
loofah (2.18.0)
loofah (2.19.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
macaddr (1.7.2)
Expand Down Expand Up @@ -371,7 +371,7 @@ GEM
mini_magick (4.11.0)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.2)
minitest (5.16.3)
money (6.16.0)
i18n (>= 0.6.4, <= 2)
msgpack (1.5.3)
Expand All @@ -383,10 +383,10 @@ GEM
connection_pool (~> 2.2)
netrc (0.11.0)
nio4r (2.5.8)
nokogiri (1.13.6)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oj (3.13.16)
oj (3.13.21)
oj_mimic_json (1.0.1)
optimist (3.0.1)
parallel (1.22.1)
Expand Down Expand Up @@ -450,7 +450,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rchardet (1.8.0)
rdf (3.2.8)
rdf (3.2.9)
link_header (~> 0.0, >= 0.0.8)
rdf-aggregate-repo (3.2.1)
rdf (~> 3.2)
Expand All @@ -469,7 +469,7 @@ GEM
rdf-turtle (3.2.1)
ebnf (~> 2.3)
rdf (~> 3.2)
rdf-vocab (3.2.1)
rdf-vocab (3.2.2)
rdf (~> 3.2, >= 3.2.4)
rdf-xsd (3.2.1)
rdf (~> 3.2)
Expand Down Expand Up @@ -596,19 +596,19 @@ GEM
climate_control (>= 0.0.3, < 1.0)
test-prof (0.10.2)
thor (1.2.1)
tilt (2.0.10)
tilt (2.0.11)
turnout (2.5.0)
i18n (>= 0.7, < 2)
rack (>= 1.3, < 3)
rack-accept (~> 0.4)
tilt (>= 1.4, < 3)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.2.0)
unicode-types (1.7.0)
unicode-types (1.8.0)
unicode_utils (1.4.0)
uniform_notifier (1.16.0)
uuid (2.3.9)
Expand All @@ -623,7 +623,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.0)
zeitwerk (2.6.1)

PLATFORMS
x86_64-linux
Expand Down
8 changes: 4 additions & 4 deletions app/serializers/datacite_doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DataciteDoiSerializer
:language,
:types,
:related_identifiers,
# :related_items,
:related_items,
:sizes,
:formats,
:version,
Expand Down Expand Up @@ -191,9 +191,9 @@ class DataciteDoiSerializer
Array.wrap(object.related_identifiers)
end

# attribute :related_items do |object|
# Array.wrap(object.related_items)
# end
attribute :related_items do |object|
Array.wrap(object.related_items)
end

attribute :geo_locations,
if:
Expand Down
12 changes: 5 additions & 7 deletions spec/factories/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,11 @@
"firstPage" => "249",
"lastPage" => "264",
"publicationYear" => "2018",
"relatedItemIdentifier" =>
{ "__content__" => "10.1016/j.physletb.2017.11.044",
"relatedItemIdentifierType" => "DOI" },
"relatedItemType" => "Journal",
"relationType" => "IsPublishedIn",
"titles" => { "title" => "Physics letters / B" },
"volume" => "776"
"relatedItemIdentifier" => { "relatedItemIdentifier" => "10.1016/j.physletb.2017.11.044", "relatedItemIdentifierType" => "DOI" },
"relatedItemType" => "Journal",
"relationType" => "IsPublishedIn",
"titles" => [{ "title" => "Physics letters / B" }],
"volume" => "776"
}
]
end
Expand Down
Loading

0 comments on commit 6a09c56

Please sign in to comment.