feat(documents): OKF v0.2 document profile with provenance and rights status #56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/52-document-profile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #52 (step 1 of 3)
Defines the document profile on OKF v0.2 and the module curation and ingestion share to read and write documents:
src/lib/document-profile.ts.writeStudioDocument(document, { themes, vocabularies }): validates with@quatrain/okfand a Studio profile, then serializes. Refuses: a missingtype,title,category,soa,generatedorrights; an empty value; a key written before v0.2 (timestamp,createdAt,revision,originalFileUri,fileHash); arightsoutsideopen | licensed | own | quote-only | unknown | excluded;openwithout a source naminglicenceandlicence_url; when given, acategoryorthematicsthat is not a theme, a facet value outside its vocabulary. Unknown keys are kept.readStudioDocument(text, { category, by }): converts a pre-v0.2 document (createdAt/timestamp→generated,originalFileUri+fileHash→ first source{ resource, sha256 },revisiondropped, folder →category,rights: unknown); a v0.2 document comes back unchanged.mayKeepFullText(rights),mayIndex(rights): effects of the rights status, for step 3.renderRootIndex(body):content/index.mdwithokf_version: "0.2".rights,generated,sources…).docs/DOCUMENT-PROFILE.mdand.fr.md; README and AGENTS.md move to OKF v0.2.Not in this PR: wiring into the curation route and the ingestion queue (they are rewritten for tenants in 4a and 4b); facet vocabularies in the tenant settings (step 2); rights in the curation form and enforcement in indexing (step 3).
Checks:
yarn test206/206 (15 new).tsc --noEmit: the same 11 errors as ondevelop, none in the new code.🤖 Generated with Claude Code