Skip to content

SemanticDomain -> LivingDictionaries mapping #4331

Description

@imnasnainaec

Summary

Build a curated mapping from DDP4 semantic-domain codes to Living Dictionaries' (LD) 69-key domain list. Semantic domains are the single hardest field to map from LIFT to LD, and every LIFT → LD import path needs this table to place entries in LD's domains systematically instead of dropping them. Highest leverage per unit effort of the #4325 work, and a hard input dependency for an importer.

Background

  • FieldWorks & The Combine use semantic domains (DDP4): ~1,792 hierarchical codes, 4 levels (e.g. 2.1.1 Head), carried in LIFT as semantic-domain-ddp4 traits + .lift-ranges.
  • LD uses its own list: 69 selectable two-level keys (e.g. 5.3), in site/src/lib/mappings/semantic-domains.ts, "modeled after SemDom with some adjustments."
  • LD's only precedent map (scripts/import/FLEx/semanticDomains.ts) is hand-built for one dictionary (Torwali) and not generalized. No general table exists.

Scope — DDP4 → LD (required)

Many-to-one: every DDP4 code → exactly one LD key, mostly keyed on DDP4's top-two numeric levels.

  • Deliverable: a data file (DDP4 code → LD key), plus a short rationale doc for the non-mechanical choices.
  • Unmappable / edge-case domains fall through to LD's catch-alls (senses.write_in_semantic_domains, entries.unsupported_fields.semdom). Note: these are reachable via LD's CSV/DB import path but not via the /api/v1 write API today.

Reverse direction — LD → DDP4 (optional, not blocking)

Only needed for a future LD → LIFT export. Two options, to decide when that work is scoped:

  • (a) an approximate one-to-many map (LD key → a representative general DDP4 code); or
  • (b) emit LD's 69 keys as a custom LIFT range/field and skip the reverse map entirely — lossless, but LIFT consumers then treat them as a parallel taxonomy rather than SemDom.

Because (b) is viable, this issue does not depend on building the reverse map.

Approach

  • Walk the ~1,792 DDP4 codes; assign each to the nearest LD top-two-level key (largely mechanical by shared numeric prefix).
  • Hand-review the tail where LD's simplification doesn't cleanly nest under DDP4's numbering.
  • Spot-check a sample against LD's semantic-domains.ts display names.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions