8000 feat(fedora): keep a copy of the archive in a Fedora 6 repository by adeelahmad · Pull Request #88 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(fedora): keep a copy of the archive in a Fedora 6 repository - #88

Merged
adeelahmad merged 3 commits into
mainfrom
claude/project-thread-s9qndz
Oct 3, 2026
Merged

adeelahmad merged 3 commits into
mainfrom
claude/project-thread-s9qndz

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 is docker compose --profile fedora up.

It is off until fedora.url is set, either in Settings or with LENS_FEDORA_URL in .env. Defaults are unchanged and installs without Fedora, such as a Raspberry Pi, run exactly as before.

How: app/domain/fedora.py holds 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_seconds and full_hours), and deletions also remove the tombstone. The admin API is GET /api/v1/admin/fedora and POST /api/v1/admin/fedora/sync. Settings validate the values, the password is stored as a secret, and env overrides are supported. The fedora compose profile is in both compose files. Docs are in docs/fedora.md.

Tests: tests/api/test_fedora.py runs against an in-memory stand-in (tests/fake_fedora.py). An opt-in test, LENS_TEST_FEDORA_URL, passed against a real fcrepo/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 with make 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

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
@adeelahmad adeelahmad self-assigned this Oct 3, 2026
claude added 2 commits October 3, 2026 03:55
…-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
@adeelahmad
adeelahmad merged commit 270f3ee into main Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0