-
Notifications
You must be signed in to change notification settings - Fork 3
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
Creating Hyku/Hyrax AdminSets fails from the UI only #59
Comments
NOTE: The AdminSet created from the UI is also not fully indexed in Solr. Compared to the Default AdminSet, the title seems to be missing. That seems to imply that perhaps the indexing in Solr logic uses a |
After consultation on Slack with @awoods, it seems this pairtree path behavior is mimicking a Fedora Modeshape implementation behavior (which exists in the Modeshape implementation for performance reasons, but is not required for all Fedora implementations). That explains the reason why the Samvera codebase would be expecting/generating such pairtree paths. But, we still need to debug Samvera to determine why two resources are created (one without the pairtree path that includes all triples, and one with the pairtree path that is a mostly-empty resource). |
Here's the exact line of code where Hyku (or Hyrax) turns IDs into pairtree paths: For example, running this method with the default AdminSet ID returns the path we are seeing:
This The call stack here looks like this:
|
I've figured out what seems to be going on:
In summary, it seems that Hyku "expects" Lambdora to act like Fedora 4. When Lambdora generates a UUID for a resource, Hyku expects that resource to be created under a pairtree path (based on that UUID) In the situation of the Default AdminSet, this works because Hyku provides the ID to Lambdora. This bug seems specific to the scenario where Lambdora generates the ID and passes it back to Hyku. |
The "quick fix" for Lambdora would likely be to tweak the default For Hyku/Hyrax applications, it'd need to be a tree-ified UUID (e.g. For the tree-ified UUID, we might be able to borrow some code/concepts from Fedora 4. This looks to be how they acheive it: https://github.com/fcrepo4/fcrepo4/blob/4.7.4-RC/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/services/functions/HierarchicalIdentifierSupplier.java |
When using Lambdora with a Hyku front-end, creating the default AdminSet (via its rake task,
hyrax:default_admin_set:create
) succeeds, and results in the following object in Lambdora:https://627cys77vl.execute-api.us-east-1.amazonaws.com/dev/dev/ad/mi/n_/se/admin_set/default
However, when manually creating a new AdminSet from the Hyku UI, we encounter a
Model mismatch. Expected AdminSet. Got: ActiveFedora::Base
error. On the backend the AdminSet is created, but its path structure is quite different from the Default AdminSet, e.g.https://627cys77vl.execute-api.us-east-1.amazonaws.com/dev/dev/abab7f63-5a3e-44f0-8a65-01133ecc7057
After creation of the new AdminSet, Hyku makes later GET calls to retrieve that AdminSet via a "pairtree" like path: https://627cys77vl.execute-api.us-east-1.amazonaws.com/dev/dev/ab/ab/7f/63/abab7f63-5a3e-44f0-8a65-01133ecc7057
Strangely, both of these paths are created in Lambdora, but only the first path (
/dev/abab7f63-5a3e-44f0-8a65-01133ecc7057
) includes all necessary AdminSet triples, while the second path (/dev/ab/ab/7f/63/abab7f63-5a3e-44f0-8a65-01133ecc7057
) is an "empty", unnamed container.It seems that the
Model mismatch
error results from a GET request to the second path, as that error seems to only occur when thehasModel
triple is missing from the response: https://github.com/samvera/active_fedora/blob/11-4-stable/lib/active_fedora/relation/finder_methods.rb#L210We suspect that
active_fedora
is generating these pairtree-like paths for UUIDs (including the "admin_set/default" UUID of the Default AdminSet), but have not yet determined where that occurs and whether this is a bug inactive_fedora
or in Lambdora (or both).The text was updated successfully, but these errors were encountered: