Repository navigation
feat(fedora): keep a copy of the archive in a Fedora 6 repository - #88
Merged
Merged
Conversation
Opt-in: off until fedora.url is set (Settings → Fedora repository, or LENS_FEDORA_URL), so installs without Fedora run as before. Every namespace, collection, recording (with its file), entity and speaker becomes an LDP resource described in RDF with Dublin Core, linked to its Lens URI. Metadata changes are queued and sent within a minute; a full comparison (hash per resource) every 24 hours catches analysis changes, new recordings and deletions. docker-compose gets a `fedora` profile. Tested against a stand-in and against a real Fedora 6.5.1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RtRigWmLLWqBHqWmJ8CvA1
…-s9qndz # Conflicts: # fastapi_backend/app/domain/routines.py # fastapi_backend/app/domain/settings.py
…-s9qndz # Conflicts: # fastapi_backend/app/domain/settings.py # nextjs-frontend/components/settings/bodies.tsx
6 of 8 tasks
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.
Requested by Adeel · project thread
Before: the archive lived only in SurrealDB and the data folder. It had no copy in a standard repository.
After: Lens can keep a copy of the archive in Fedora 6. Every namespace, collection, recording (with its file), entity and speaker becomes an LDP resource in Fedora, described in RDF with Dublin Core (the mapping from #79) and linked back to its Lens URI with
owl:sameAs. A change to a recording's metadata is sent within a minute. Every 24 hours Lens compares everything with what it last sent and sends only the differences, which picks up analysis results, new recordings and deletions. Admins set it up and see its state in Settings → Fedora repository, which also has a "Compare and send now" button. Starting Fedora isdocker compose --profile fedora up.It is off until
fedora.urlis set, either in Settings or withLENS_FEDORA_URLin.env. Defaults are unchanged and installs without Fedora, such as a Raspberry Pi, run exactly as before.How:
app/domain/fedora.pyholds the LDP client, the per-resource Turtle (blank nodes become hash URIs), a queue of changes (fedora_outbox) and a hash per resource (fedora_state). It runs in the routines loop (sync_secondsandfull_hours), and deletions also remove the tombstone. The admin API isGET /api/v1/admin/fedoraandPOST /api/v1/admin/fedora/sync. Settings validate the values, the password is stored as a secret, and env overrides are supported. Thefedoracompose profile is in both compose files. Docs are indocs/fedora.md.Tests:
tests/api/test_fedora.pyruns against an in-memory stand-in (tests/fake_fedora.py). An opt-in test,LENS_TEST_FEDORA_URL, passed against a realfcrepo/fcrepo:6.5.1-tomcat9: resources were accepted, updated in place, and deleted. The full backend suite passes (415), except the known environmental LibreOffice test. jest (586), eslint and tsc pass. The client was regenerated withmake openapi.Refine later: have a single process do the sending, use Fedora transactions, store files as external content instead of copies, and support restoring from Fedora.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RtRigWmLLWqBHqWmJ8CvA1
Generated by Claude Code