Skip to content

1.4 How Hyrax persists member files

Randall Floyd edited this page Jul 30, 2018 · 3 revisions

The current modeling of member files to a work still seems to be the same PCDM implementation as described in these documents:

https://docs.google.com/drawings/d/1-NkkRPpGpZGoTimEpYTaGM1uUPRaT0SamuWDITvtG_8/edit

https://docs.google.com/drawings/d/1ihQzx9BJq0r3bJ5fuY1ZEQwo6NVBIQvG6mz8w-BtB38/edit

These behaviors are verified in the console for a simple Image work with one file:

irb(main):016:0> img = Image.last
=> #<Image id: "qj72p712h", head: [#<ActiveTriples::Resource:0x2ac8f7e7580c ID:<http://127.0.0.1:8984/rest/dev/qj/72/p7/12/qj72p712h/list_source#g70221172964220>>], tail: [#<ActiveTriples::Resource:0x2ac8f7e2a67c ID:<http://127.0.0.1:8984/rest/dev/qj/72/p7/12/qj72p712h/list_source#g70221172964220>>], depositor: "rdfloyd@indiana.edu", title: ["Another Image"], date_uploaded: "2018-07-26 18:30:20", date_modified: "2018-07-26 18:30:20"...>

irb(main):017:0> img.file_sets
=> [#<FileSet id: "qj72p713s", head: [], tail: [], depositor: "rdfloyd@indiana.edu", title: ["bhr9405-1-0057.tif"], date_uploaded: "2018-07-26 18:30:26", date_modified: "2018-07-26 18:30:26", label: "bhr9405-1-0057.tif", relative_path: nil, import_url: nil, resource_type: [], creator: ["rdfloyd@indiana.edu"], contributor: [], description: [], keyword: [], license: [], rights_statement: [], publisher: [], date_created: [], subject: [], language: [], identifier: [], based_near: [], related_url: [], bibliographic_citation: [], source: [], access_control_id: "fa273774-51b0-4c79-ba47-ad64ef8f3ce4", embargo_id: nil, lease_id: nil>]

irb(main):018:0> img.members
=> [#<FileSet id: "qj72p713s", head: [], tail: [], depositor: "rdfloyd@indiana.edu", title: ["bhr9405-1-0057.tif"], date_uploaded: "2018-07-26 18:30:26", date_modified: "2018-07-26 18:30:26", label: "bhr9405-1-0057.tif", relative_path: nil, import_url: nil, resource_type: [], creator: ["rdfloyd@indiana.edu"], contributor: [], description: [], keyword: [], license: [], rights_statement: [], publisher: [], date_created: [], subject: [], language: [], identifier: [], based_near: [], related_url: [], bibliographic_citation: [], source: [], access_control_id: "fa273774-51b0-4c79-ba47-ad64ef8f3ce4", embargo_id: nil, lease_id: nil>]

irb(main):019:0> img.members[0].files
=> [#<Hydra::PCDM::File uri="http://127.0.0.1:8984/rest/dev/qj/72/p7/13/qj72p713s/files/b520bc99-b902-4cb8-aa78-e326589d854e" >]