-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Valkyrie native Collections as PcdmCollection
#4076
Conversation
Add a PCDM style collection in native Valkyrie, with support for membership. Extract Work membership tests into shared examples for use across PCDM/Works models. We name the Collection model `Hyrax::PcdmCollection` to avoid application layer collisions with `::Collection` when referring to it from a Hyrax module. That is: we don't want to introduce a `Hyrax::Collection` without warning adopters.
`Schema` is a base level dependency for much of Hyrax post-Valkyrie, so putting it in `lib` seems to make sense. This makes it easy to require independently when it needs to be used in, e.g. `Wings`.
Collections in Hyrax need a collection type. We link them to a `GlobalID` for a `CollectionType` using `#collection_type_gid`. This closely mirrors the old `Hyrax::CollectionBehavior` approach.
Setup a mapping between `Hyrax::PcdmCollection` and `::Collection` for use in Wings adapters. Introduce a `:hyrax_collection` factory with some basic membership accessors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me.
Is this your intention to keep the model as short as only include attributes?
Can i know what's our plan for those callbacks, validation, indexer, member_object methods and permission templates, as well as those mixins modules in collection_behavior.rb?
Are we planning to use dry-transactions + pub/sub style for callbacks?and push indexer, member_object, permission templates to app/services/hyrax/collection? Correct me if i am wrong. |
include Hyrax::Schema(:core_metadata) | ||
|
||
attribute :collection_type_gid, Valkyrie::Types::String | ||
attribute :member_ids, Valkyrie::Types::Array.of(Valkyrie::Types::ID).meta(ordered: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that fine to add collection_type
, collection_type=
in the model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't supply a collection_type
setter without the _gid
suffix in the current CollectionBehavior
implementation. There is a ticket to refine that implementation, though it might be a wontfix
until after the ActiveFedora behavior is removed.
I'm not necessarily against putting them in now, but I'm a bit worried about the impact on Wings
. Keeping symmetry between Valkyrie and ActiveFedora properties simplifies things a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Sounds reasonable.
That's my notion, yes. Attributes and code explicitly involved in managing them. Obviously, we inherit |
Indexing is already a separate service in Hyrax (see: I think not Re: Callbacks, I think this might be a bit case-by-case. The Do notation approach above could probably be used for many of these cases. the Figgy-style For others (e.g. those in Membership is already handled here. I'm not sure what else is needed on this front. Any ideas? Permissions are handled by @hweng does this help answer your questions? I realize there's still a lot to decide here, but I think it's best to take these things one at a time. |
@no-reply Your approach https://github.com/samvera/hyrax/compare/transaction-to-monads looks good to me. Regarding the callbacks, do you consider to add them as steps in Transactions?
Or if you have any concern about it? |
Regarding the There are some local |
For Membership, Do we still want to keep these methods |
module Hyrax | ||
## | ||
# Valkyrie model for Collection domain objects in the Hydra Works model. | ||
class PcdmCollection < Hyrax::Resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concerned that we are establishing inconsistent naming of the Works Model classes. See my comments in PR #4084 RE: name of PcdmFileSet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my follow-up on the linked discussion.
@no-reply This PR looks good to me. I agree with you that there is still a lot to decide, might be best to discuss in the separate tickets. |
Add a PCDM style collection in native Valkyrie, with support for
membership. Extract Work membership tests into shared examples for use across
PCDM/Works models.
We name the Collection model
Hyrax::PcdmCollection
to avoid application layercollisions with
::Collection
when referring to it from a Hyrax module. Thatis: we don't want to introduce a
Hyrax::Collection
without warning adopters.@samvera/hyrax-code-reviewers