Repository navigation
feat(rdf): import Dublin Core descriptions into a namespace - #82
Merged
Merged
Conversation
POST /api/v1/namespaces/{name}/rdf/import reads Turtle, N-Triples or
JSON-LD (inline @context only; nothing is fetched) and matches each
description to a recording by its /id/ URI or an identifier. DCMI terms
and DC 1.1 elements fill the metadata fields; any other statement is kept
in a new `statements` field and exported again, so a round trip changes
nothing. Dry run by default; real imports go through the metadata history
(revertable) and the audit log.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RtRigWmLLWqBHqWmJ8CvA1
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: Lens could export RDF (#79) but could not read it back. Catalogue records from elsewhere had to be typed in by hand.
After: editors can post Turtle, N-Triples or JSON-LD to
POST /api/v1/namespaces/{name}/rdf/import. Each Dublin Core description is matched to a recording, by its Lens URI or by an identifier the recording already has, and fills its metadata. A dry run, which is the default, shows what would change. A real import writes metadata edits, so each one stays in the history and can be reverted, and it is recorded in the audit log. Statements that don't map to a field are kept on the recording and exported again, so exporting and re-importing changes nothing.How:
app/domain/rdf_import.pymaps DCMI terms and the DC 1.1 elements ontometadata.save. It only adds terms and statements, while other fields are replaced. Speakers and entities named by URI must belong to the namespace. Nothing is fetched while parsing: JSON-LD with a remote@contextis refused, and RDF/XML is not accepted. Input is capped at 5 MB. Recordings get a newstatementsmetadata field. Docs are indocs/rdf.md.Tests:
tests/api/test_rdf.pycovers a round trip with no change, matching by URI and by identifier, merging, the dry run, revert, refusing remote contexts, and roles. The full backend suite passes (374), except the known environmental LibreOffice test. tsc is clean, and the client was regenerated withmake openapi.🤖 Generated with Claude Code
https://claude.ai/code/session_01RtRigWmLLWqBHqWmJ8CvA1
Generated by Claude Code