Fix redirect of resource-part URIs to ResourcePartPage#443
Merged
Conversation
Resolves #442. w3id.org forwards every /spaces/... URI to /space?id=<uri>, so term URIs within a maintained resource's namespace (e.g. .../r/ontology/hasWaterbody) landed on SpacePage and threw 500 because neither findById lookup matched. SpacePage.resolveSpace now falls back to MaintainedResourceRepository.findByNamespace and, if a containing resource is found, restarts to ResourcePartPage with the proper context. Also adds ensureLoaded() to findByNamespace for consistency with findById. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
w3id.orgforwards every/spaces/...URI to/space?id=<uri>, so term URIs within a maintained resource's namespace (e.g.https://w3id.org/spaces/marine-biodiversity/r/ontology/hasWaterbody) landed onSpacePageand returned a 500 because neitherSpaceRepository.findByIdnorMaintainedResourceRepository.findByIdmatched.SpacePage.resolveSpacenow falls back toMaintainedResourceRepository.findByNamespace(usingMaintainedResource.getNamespace(id)) and, when a containing resource is found, restarts toResourcePartPagewith the propercontext.ensureLoaded()tofindByNamespacefor consistency withfindById.Test plan
🤖 Generated with Claude Code