Skip to content

feat(xmp): catalog-driven struct schemas — 110 generated structs wired into the writer - #54

Open
woss wants to merge 2 commits into
feat/serializer-iptc-photoshop-irbfrom
feat/serializer-xmp-schemas
Open

woss wants to merge 2 commits into
feat/serializer-iptc-photoshop-irbfrom
feat/serializer-xmp-schemas

Conversation

@woss

@woss woss commented Nov 22, 2026

Copy link
Copy Markdown
Owner

serializer-xmp lane (§D), stacked on #52 (which stacks on #51).

What

  • xmp-writer.ts imports the generated xmp-structs.json (110 schemas, 626KB) and expands it into the existing struct lookup tables at init: field-name sets, per-field list shapes, list-item struct keys, nested struct keys, language-alt fields. Hand-curated schemas win per key; nested inline Perl schemas get synthetic parent|field keys BFS-expanded (depth 12, matching upstream's cap).
  • Struct lists derive from shape ∩ struct intersection (62 keys) instead of hand-mapping; 48 plain structs; conditional fields excluded (spec: condition-based behaviour needs a reviewed handler).
  • Serializer mechanics unchanged (rdf:Alt/Bag/Seq, rdf:parseType="Resource", xml:lang, upsert/delete across sibling descriptions).
  • Enums, lang-alt detection and date normalization were already catalog-driven — untouched.

Matrix

  • JPEG|XMP|set + JPEG|XMP|delete → implemented. Six implemented cells total: GPS set, IPTC set/delete, Photoshop IRB set, XMP set/delete.

Verification

  • crs:Look (nested struct + list fields + boolean), Iptc4xmpExt:ImageRegion (struct list → nested struct → struct list, Role bag-of-structs) round-trip through vendored ExifTool 13.64 (LookParametersToneCurvePV2012, ImageRegionBoundaryVerticesX, ImageRegionRoleIdentifier readback).
  • Schema-checked child names reject invented fields (spec: "struct lists schema-checked child names").
  • Suite 1005/1005, tsc clean, generate-matrix --check passes.

🤖 Created by omp (session 01a20072-6105-7779-813d-61b178bbcf0e)

woss added 2 commits November 22, 2026 01:32
…d into the writer

- xmp-writer imports xmp-structs.json; expands schemas into the struct
  lookup tables (fields, list shapes, list-item structs, nested structs,
  lang-alts) under hand-curated tables (hand wins per key); nested inline
  schemas get synthetic parent|field keys, BFS-expanded to depth 12
- struct lists derive from shape+struct intersection (62 keys); plain
  structs 48; conditional fields excluded
- serializer mechanics (alt/bag/seq/parseType=Resource/xml:lang) unchanged
- tests: crs:Look (nested+list fields), ImageRegion (struct list with
  nested struct list + Role bag-of-structs) round-trip via upstream
  13.64; schema-checked child-name rejection
- JPEG|XMP|set + JPEG|XMP|delete → implemented (6 implemented cells total)
@woss
woss added this pull request to stack #53 November 22, 2026 00:32
@woss
woss force-pushed the feat/serializer-xmp-schemas branch from 7152007 to 9dec397 Compare November 22, 2026 00:32

This branch has not been deployed

No deployments
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.

1 participant