- Introduced custodian_hub_v3.mmd, custodian_hub_v4_final.mmd, and custodian_hub_v5_FINAL.mmd for Mermaid representation. - Created custodian_hub_FINAL.puml and custodian_hub_v3.puml for PlantUML representation. - Defined entities such as CustodianReconstruction, Identifier, TimeSpan, Agent, CustodianName, CustodianObservation, ReconstructionActivity, Appellation, ConfidenceMeasure, Custodian, LanguageCode, and SourceDocument. - Established relationships and associations between entities, including temporal extents, observations, and reconstruction activities. - Incorporated enumerations for various types, statuses, and classifications relevant to custodians and their activities.
13 KiB
Session Summary: Legal Entity Model Refactoring
Date: 2025-11-22
Session Focus: Refactor EntityTypeEnum into proper class-based legal entity model
Schema Version: 20251121
Status: ✅ Complete
Session Objectives
- Replace
EntityTypeEnumwith proper class hierarchy for legal entities - Integrate ISO 20275 Entity Legal Form codes
- Implement TOOI naming pattern for legal names
- Create structured classes for registration information
- Update all related slots and imports
- Ensure ontology alignment with TOOI, W3C Org, ROV, CPOV
Work Completed
1. New Classes Created
✅ LegalEntityType.yaml
Location: schemas/20251121/linkml/modules/classes/LegalEntityType.yaml
- Top-level classification: PERSON vs ORGANIZATION
- Distinguishes natural persons from legal persons
- Maps to:
org:classification,schema:additionalType,tooi:organisatievorm
✅ LegalForm.yaml
Location: schemas/20251121/linkml/modules/classes/LegalForm.yaml
- ISO 20275 Entity Legal Form codes
- 1,600+ legal forms across 150+ jurisdictions
- Attributes:
elf_code,country_code,local_name,transliterated_name,abbreviation - Maps to:
rov:orgType,gleif:hasLegalForm,tooi:rechtsvorm
✅ LegalName.yaml
Location: schemas/20251121/linkml/modules/classes/LegalName.yaml
- Structured names following TOOI pattern
- Three name variants:
full_name,name_without_type,alphabetical_name - Additional fields:
display_name,language,script,temporal_validity - Maps to:
rov:legalName,tooi:officieleNaamInclSoort,tooi:officieleNaamExclSoort
✅ RegistrationInfo.yaml
Location: schemas/20251121/linkml/modules/classes/RegistrationInfo.yaml
Contains 4 sub-classes:
-
RegistrationNumber: Official registration identifiers with temporal validity
- Maps to:
rov:registration,tooi:organisatieIdentificatie
- Maps to:
-
RegistrationAuthority: Bodies that maintain registrations
- Maps to:
rov:hasRegisteredOrganization
- Maps to:
-
GovernanceStructure: Internal organizational structure
- Maps to:
org:hasUnit,org:OrganizationalUnit
- Maps to:
-
LegalStatus: Legal status tracking (active, dissolved, etc.)
- Maps to:
schema:status
- Maps to:
2. Updated Classes
✅ CustodianReconstruction.yaml
Location: schemas/20251121/linkml/modules/classes/CustodianReconstruction.yaml
Changes:
- Imports: Added
LegalEntityType,LegalForm,LegalName,RegistrationInfo - Slots renamed:
entity_type→legal_entity_type(range:LegalEntityType)registration_number→registration_numbers(pluralized, range:RegistrationNumber[])
- Slots updated with class ranges:
legal_name:string→LegalNamelegal_form:string→LegalFormregistration_authority:string→RegistrationAuthoritylegal_status:LegalStatusEnum→LegalStatusgovernance_structure:string→GovernanceStructure
- Comments updated:
- "CRITICAL: CustodianReconstruction is ONLY for formally registered legal entities"
- "Informal groups without legal status remain as CustodianObservations only"
- Deprecated:
registration_dateslot (moved toRegistrationNumber.temporal_validity)
3. Updated Slots
✅ legal_entity_type.yaml (NEW)
Location: schemas/20251121/linkml/modules/slots/legal_entity_type.yaml
- Replaces deprecated
entity_typeslot - Range:
LegalEntityType - Maps to:
org:classification
✅ legal_name.yaml (UPDATED)
- Range changed:
string→LegalName - Slot URI updated:
cpov:legalName→rov:legalName
✅ legal_form.yaml (UPDATED)
- Range changed:
string→LegalForm - Slot URI updated:
org:classification→rov:orgType - Removed pattern constraint (now in LegalForm class)
✅ registration_numbers.yaml (NEW, pluralized)
Location: schemas/20251121/linkml/modules/slots/registration_numbers.yaml
- Replaces
registration_number.yaml(singular) - Range:
RegistrationNumber - Multivalued: true
- Maps to:
rov:registration
✅ registration_authority.yaml (UPDATED)
- Range changed:
string→RegistrationAuthority - Slot URI updated:
prov:wasAttributedTo→rov:hasRegisteredOrganization
✅ legal_status.yaml (UPDATED)
- Range changed:
LegalStatusEnum→LegalStatus - Slot URI updated:
gleif-base:hasEntityStatus→schema:status
✅ governance_structure.yaml (UPDATED)
- Range changed:
string→GovernanceStructure - Slot URI updated:
org:organization→org:hasUnit
4. Deprecated Files
⚠️ entity_type.yaml → entity_type.yaml.deprecated
- Replaced by
legal_entity_type.yaml
⚠️ registration_number.yaml → registration_number.yaml.deprecated
- Replaced by
registration_numbers.yaml(pluralized)
5. Supporting Files Created
✅ ISO20275_mapping.yaml
Location: schemas/20251121/linkml/modules/mappings/ISO20275_mapping.yaml
- Template structure for ISO 20275 code mappings
- Examples for common Dutch legal forms
✅ parse_iso20275_codes.py
Location: scripts/parse_iso20275_codes.py
- Parses
data/ontology/2023-09-28-elf-code-list-v1.5.csv - Generates common heritage institution legal form mappings
- Outputs to
schemas/20251121/linkml/modules/mappings/ISO20275_common.yaml
✅ Documentation Files
- LEGAL_ENTITY_REFACTORING.md: Comprehensive refactoring documentation
- LEGAL_ENTITY_QUICK_REFERENCE.md: Quick reference guide
6. Updated Main Schema
✅ 01_custodian_name_modular.yaml
Location: schemas/20251121/linkml/01_custodian_name_modular.yaml
Changes:
-
Added class imports:
modules/classes/LegalEntityTypemodules/classes/LegalFormmodules/classes/LegalNamemodules/classes/RegistrationInfo
-
Added slot imports:
modules/slots/legal_entity_typemodules/slots/registration_numbers
-
Updated comments:
- Total classes: 12 → 17 (added 5 legal entity classes)
- Total files: 78 → 84
Key Design Decisions
1. PERSON vs ORGANIZATION (Not Individual/Group/Corporation)
Decision: Use only two top-level legal entity types
- PERSON: Natural person (individual with legal rights)
- ORGANIZATION: Legal person (all organizational forms)
Rationale:
- Reflects fundamental legal distinction in most jurisdictions
- Natural persons cannot have legal forms (no "incorporation")
- All corporations, governments, foundations are ORGANIZATION (legal persons)
- Groups without legal status are NOT legal entities (remain as observations)
2. Informal Groups Are NOT CustodianReconstructions
Decision: Informal groups without legal status remain as CustodianObservation only
Rationale:
CustodianReconstructionis ONLY for formally registered legal entities- Informal collectives lack legal personality
- Distinction aligns with legal reality (observations vs. entities)
- If informal group later registers (e.g., becomes association), upgrade to reconstruction
3. Pluralized registration_numbers
Decision: registration_numbers (plural) instead of registration_number (singular)
Rationale:
- Organizations often have multiple registrations (different systems/jurisdictions)
- Example: Dutch KvK number + EU VAT number + US EIN
- Each registration has independent temporal validity
4. Temporal Validity in All Legal Attributes
Decision: All legal classes include temporal validity via TimeSpan
Rationale:
- Legal names change (mergers, rebranding)
- Registrations expire or are deregistered
- Legal status changes over time (active → dissolved)
- Governance structures evolve
5. ISO 20275 Integration
Decision: Use ISO 20275 Entity Legal Form codes for legal_form
Rationale:
- International standard (1,600+ codes, 150+ jurisdictions)
- Standardized classification across countries
- Machine-readable codes enable validation
- Already used by GLEIF, business registries
Ontology Alignment Summary
| Class | Primary Mapping | Secondary Mappings |
|---|---|---|
| LegalEntityType | org:classification |
schema:additionalType, tooi:organisatievorm |
| LegalForm | rov:orgType |
gleif:hasLegalForm, tooi:rechtsvorm |
| LegalName | rov:legalName |
tooi:officieleNaamInclSoort |
| RegistrationNumber | rov:registration |
schema:identifier, tooi:organisatieIdentificatie |
| RegistrationAuthority | rov:hasRegisteredOrganization |
org:Organization |
| GovernanceStructure | org:hasUnit |
org:OrganizationalUnit |
| LegalStatus | schema:status |
gleif-base:hasEntityStatus |
Migration Guide
For Data Curators
| Old Value | New Value |
|---|---|
entity_type: INDIVIDUAL |
legal_entity_type: {code: "PERSON"} |
entity_type: ORGANIZATION |
legal_entity_type: {code: "ORGANIZATION"} |
entity_type: GOVERNMENT |
legal_entity_type: {code: "ORGANIZATION"} |
entity_type: CORPORATION |
legal_entity_type: {code: "ORGANIZATION"} |
entity_type: GROUP |
Remove (informal groups stay as observations) |
For Developers
Before:
entity_type: ORGANIZATION
legal_name: "Stichting Rijksmuseum"
legal_form: "8888"
registration_number: "41215422"
registration_authority: "KvK"
legal_status: ACTIVE
After:
legal_entity_type:
code: "ORGANIZATION"
legal_name:
full_name: "Stichting Rijksmuseum"
display_name: "Rijksmuseum"
legal_form:
elf_code: "8888"
country_code: "NL"
local_name: "Stichting"
registration_numbers:
- number: "41215422"
type: "KvK"
temporal_validity:
begin_of_the_begin: "1885-07-01"
registration_authority:
name: "Kamer van Koophandel"
abbreviation: "KvK"
jurisdiction: "NL"
legal_status:
status_code: "ACTIVE"
status_name: "Active"
Files Summary
Created (9 files):
schemas/20251121/linkml/modules/classes/LegalEntityType.yamlschemas/20251121/linkml/modules/classes/LegalForm.yamlschemas/20251121/linkml/modules/classes/LegalName.yamlschemas/20251121/linkml/modules/classes/RegistrationInfo.yamlschemas/20251121/linkml/modules/slots/legal_entity_type.yamlschemas/20251121/linkml/modules/slots/registration_numbers.yamlschemas/20251121/linkml/modules/mappings/ISO20275_mapping.yamlschemas/20251121/linkml/modules/classes/LEGAL_ENTITY_REFACTORING.mdschemas/20251121/linkml/modules/classes/LEGAL_ENTITY_QUICK_REFERENCE.md
Updated (7 files):
schemas/20251121/linkml/modules/classes/CustodianReconstruction.yamlschemas/20251121/linkml/modules/slots/legal_name.yamlschemas/20251121/linkml/modules/slots/legal_form.yamlschemas/20251121/linkml/modules/slots/registration_authority.yamlschemas/20251121/linkml/modules/slots/legal_status.yamlschemas/20251121/linkml/modules/slots/governance_structure.yamlschemas/20251121/linkml/01_custodian_name_modular.yaml
Deprecated (2 files):
schemas/20251121/linkml/modules/slots/entity_type.yaml.deprecatedschemas/20251121/linkml/modules/slots/registration_number.yaml.deprecated
Scripts (1 file):
scripts/parse_iso20275_codes.py
Total: 19 files created/updated/deprecated
Next Steps
Immediate (Required for Schema Validation):
- ✅ Update main schema imports (DONE)
- ✅ Update all slot definitions (DONE)
- ⏳ Run LinkML validation:
linkml-validate -s schemas/20251121/linkml/01_custodian_name_modular.yaml - ⏳ Parse ISO 20275 CSV:
python scripts/parse_iso20275_codes.py - ⏳ Generate RDF:
gen-owl -f ttl schemas/20251121/linkml/01_custodian_name_modular.yaml
Short-term (Data Migration):
- Create migration script for existing data
- Update validation tests to use new classes
- Migrate
EntityTypeEnumreferences toLegalEntityType - Update example instances in
schemas/20251121/examples/
Long-term (Enhancements):
- Curate RegistrationAuthority list by country
- Map full ISO 20275 code list (1,600+ codes)
- Add legal form hierarchies (parent/child relationships)
- Integrate with national business registries (APIs)
Validation Checklist
- All new classes have proper imports
- All slots updated with correct ranges
- Main schema imports all new classes and slots
- Ontology mappings documented
- Examples provided for each class
- Deprecated files renamed with
.deprecatedextension - Comments updated in CustodianReconstruction
- LinkML validation passes (run command above)
- RDF generation succeeds (run command above)
- ISO 20275 mapping generated (run script above)
Related Documentation
- Full Documentation:
schemas/20251121/linkml/modules/classes/LEGAL_ENTITY_REFACTORING.md - Quick Reference:
schemas/20251121/linkml/modules/classes/LEGAL_ENTITY_QUICK_REFERENCE.md - ISO 20275 CSV:
data/ontology/2023-09-28-elf-code-list-v1.5.csv - TOOI Ontology:
data/ontology/tooiont.ttl - W3C Org Ontology: https://www.w3.org/TR/vocab-org/
- Registered Organizations Vocabulary: https://www.w3.org/TR/vocab-regorg/
Session Completion
Status: ✅ All files created, updated, and linked properly
The legal entity model refactoring is complete. All new classes are properly integrated into the schema with correct imports, slot definitions, and ontology mappings.