samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

Relationships that have ids but not an id or ids method are not converted to the valkyrie resource #3904

Closed elrayle closed 3 years ago

elrayle commented 5 years ago

Descriptive summary

Relationships that have _ids appended for the valkyrie resource attribute but do not have an equivalent _id or _ids property on the active fedora object, fail to copy over the IDs. The potential relationships that are effected are determined by method relationship_keys_for.

Rationale

All relationships should be converted over to the Valkyrie resource.

Expected behavior

When an ActiveFedora FileSet with files and original file set is transformed into a Valkyrie resource, the resource should have file_ids and original_file_ids set to the ids from the ActiveFedora FileSet. For both of these, I believe they should be converted to Valkyrie IDs.

Actual behavior

When an ActiveFedora FileSet with files and original file set is transformed into a Valkyrie resource, the resource has file_ids=[] and original_file_ids=[].

Steps to reproduce the behavior

Need to write test to check these tranformations.

  1. Use test to setup the ids in an ActiveFedora FileSet for files and original_file by adding a file to the file set
  2. Use test to check that the ids were transformed into the Valkyrie resource

Related work

PR #3902 Fixes a problem in the valkyrie id to fedora id matcher and needs to be merged prior to fixing this issue.

elrayle commented 5 years ago

For a fileset, #relationship_keys_for produces...

resource attribute getting ids from AF convert to Valkyrie ID? tested? comment
"member_ids" member_ids # [] YES PR #3902
ordered_member_ids # [] YES PR #3902
"list_source_ids" list_source.id # "f23a69e2-7d02-4b55-b4f8-6ed2fb4b0890/list_source" ? no should this be converted?
"ordered_member_proxy_ids" pcdm_object.ordered_member_proxies.map(&:id) # []` ? no should this be converted?
"related_object_ids" related_object_ids # [] YES no
"member_of_collection_ids" member_of_collection_ids # [] YES no
"file_ids" files.map(&:id) # ["f23a69e2-7d02-4b55-b4f8-6ed2fb4b0890/files/3bcbc7a3-2ee9-4950-b8c7-c5be38d2a043"] yes? new PR TBD
"original_file_ids" original_file.id # "f23a69e2-7d02-4b55-b4f8-6ed2fb4b0890/files/3bcbc7a3-2ee9-4950-b8c7-c5be38d2a043" yes? new PR TBD
"thumbnail_ids" thumbnail # nil yes? new PR TBD
"extracted_text_ids" extracted_text # nil yes? new PR TBD
elrayle commented 5 years ago

For a work, #relationship_keys_for produces...

resource attribute getting ids from AF convert to Valkyrie ID? tested? comment
"member_ids" member_ids # ["ck1", "cwk2", "cfs1", "cfs2"] YES PR #3902
ordered_member_ids # ["ck1", "cwk2", "cfs1", "cfs2"] YES PR #3902
"list_source_ids" list_source.id # "f23a69e2-7d02-4b55-b4f8-6ed2fb4b0890/list_source" ? no should this be converted?
"ordered_member_proxy_ids" `ordered_member_proxies.map(&:id) # [] ? no should this be converted?
"related_object_ids" related_object_ids # nil YES no
"member_of_collection_ids" member_of_collection_ids # ["pcol1_id", "pcol2_id"] YES no
"file_ids" files.map(&:id) # [] yes? no
"access_control_ids" access_control_id # "52335071-2597-4d58-ab21-9fd130647edb" yes? YES
"representative_ids" representative_id # "a8fad73d-2ed5-44a0-9004-096f4b10c857" yes? YES
"thumbnail_ids" thumbnail_id # nil yes? YES
"rendering_ids" rendering_ids # [] yes? no
"admin_set_ids" admin_set_id # "3db7af5d-7f02-4124-8aec-0620dd5dfa22" YES YES
"embargo_ids" embargo_id # nil yes? YES
"lease_idsc" lease_id # nil yes? YES
no-reply commented 3 years ago

this may be out of date. it's hard to be sure because the steps to reproduce are a bit vague. but at least the behavior described around file_set and original_file isn't current.

no-reply commented 3 years ago

this is addressed systematically in #4825