7 KiB
TimeSpan Schema Integration - Summary
Date: November 21, 2025
Problem Statement
The TimeSpan class was orphaned in the schema:
- Defined in
modules/classes/TimeSpan.yamlwith CIDOC-CRM E52 fuzzy temporal boundaries - The
temporal_extentslot existed but was not assigned to any class - No class relationships to TimeSpan were visible in UML diagrams
Solution Implemented
1. CustodianReconstruction ← TimeSpan
Added: temporal_extent slot to CustodianReconstruction
Location: schemas/20251121/linkml/modules/classes/CustodianReconstruction.yaml
Purpose: Model uncertain founding/dissolution dates for heritage institutions
Example Use Case:
temporal_extent:
begin_of_the_begin: "1800-01-01" # Earliest possible founding
end_of_the_begin: "1805-12-31" # Latest possible founding
begin_of_the_end: "1950-01-01" # Earliest possible closure
end_of_the_end: "1955-12-31" # Latest possible closure
When to Use:
- Founding date is uncertain: "established sometime between 1800-1805"
- Closure date is approximate: "closed around 1950"
- For precise legal dates, use
registration_date/dissolution_dateinstead
2. CustodianName ← TimeSpan
Added: name_validity_period slot to CustodianName
Location: schemas/20251121/linkml/modules/classes/CustodianName.yaml
Purpose: Model uncertain name adoption/change dates
Example Use Case:
name_validity_period:
begin_of_the_begin: "1920-01-01" # Name adopted sometime in the 1920s
end_of_the_begin: "1929-12-31"
begin_of_the_end: "1945-01-01" # Name changed around 1950
end_of_the_end: "1955-12-31"
When to Use:
- Name adoption date is uncertain: "name adopted sometime in the 1920s"
- Name change date is approximate: "renamed around 1950"
- For precise name validity dates, use
valid_from/valid_toinstead
3. New Slot Definition
Created: modules/slots/name_validity_period.yaml
Slot URI: crm:P4_has_time-span
Range: TimeSpan
4. Schema Imports Updated
CustodianReconstruction.yaml:
imports:
- TimeSpan # Added
CustodianName.yaml:
imports:
- TimeSpan # Added
UML Diagram Updates
Mermaid ER Diagram
Generated: schemas/20251121/uml/mermaid/custodian_name_v5.mmd
New Relationships:
CustodianReconstruction ||--|o TimeSpan : "temporal_extent"
CustodianName ||--|o TimeSpan : "name_validity_period"
Cardinality: ||--|o = One-to-zero-or-one (optional)
PlantUML Class Diagram
Generated: schemas/20251121/uml/mermaid/custodian_name_v4.puml
New Relationships:
CustodianReconstruction "1" --> "0..1" TimeSpan : temporal_extent
CustodianName "1" --> "0..1" TimeSpan : name_validity_period
New Generator Script
Created: scripts/generate_mermaid_modular.py
Purpose: Generate Mermaid ER diagrams from modular LinkML schemas (workaround for gen-erdiagram bug with linkml:types imports)
Usage:
python scripts/generate_mermaid_modular.py schema.yaml [output.mmd]
Features:
- Uses
SchemaView(same as PlantUML generator) - Handles modular imports correctly
- Generates proper Mermaid ER diagram syntax with cardinality
CIDOC-CRM E52 Time-Span Pattern
TimeSpan uses the CIDOC-CRM E52 fuzzy temporal boundaries pattern with four datetime properties:
| Property | CIDOC Property | Description |
|---|---|---|
begin_of_the_begin |
crm:P82a_begin_of_the_begin |
Earliest possible start time (outer bound) |
end_of_the_begin |
crm:P81a_end_of_the_begin |
Latest possible start time (inner bound) |
begin_of_the_end |
crm:P81b_begin_of_the_end |
Earliest possible end time (inner bound) |
end_of_the_end |
crm:P82b_end_of_the_end |
Latest possible end time (outer bound) |
Precision Cases:
- Precise date: Set
begin_of_the_begin==end_of_the_begin - Unknown start: Set
begin_of_the_beginto earliest plausible date - Ongoing/present: Leave
end_of_the_endasnull - Uncertain range: Use full four-property range
Schema Design Rationale
Why Two Temporal Slots?
CustodianReconstruction:
registration_date/dissolution_date(precise legal dates)temporal_extent(fuzzy operational dates)
CustodianName:
valid_from/valid_to(precise validity dates)name_validity_period(fuzzy validity dates)
Rationale:
- Legal/formal dates are often precise (registration certificates, gazette notices)
- Operational/social facts are often uncertain ("museum founded around 1850")
- Both patterns coexist in heritage data - schema supports both
Files Modified
-
schemas/20251121/linkml/modules/classes/CustodianReconstruction.yaml- Added
temporal_extentslot - Added TimeSpan import
- Added slot_usage documentation
- Added
-
schemas/20251121/linkml/modules/classes/CustodianName.yaml- Added
name_validity_periodslot - Added TimeSpan import
- Added slot_usage documentation
- Added
-
schemas/20251121/linkml/modules/slots/name_validity_period.yaml(NEW)- Created new slot definition
-
scripts/generate_mermaid_modular.py(NEW)- Created Mermaid ER diagram generator
Verification
Schema Load Test
$ linkml-validate -s schemas/20251121/linkml/01_custodian_name_modular.yaml
✅ Schema valid
Diagram Generation Test
$ python scripts/generate_plantuml_modular.py schemas/20251121/linkml/01_custodian_name_modular.yaml
✅ Generated: custodian_name_v4.puml (5937 bytes)
$ python scripts/generate_mermaid_modular.py schemas/20251121/linkml/01_custodian_name_modular.yaml
✅ Generated: custodian_name_v5.mmd (3042 bytes)
TimeSpan Relationship Check
$ rg "TimeSpan" schemas/20251121/uml/mermaid/custodian_name_v5.mmd
CustodianReconstruction ||--|o TimeSpan : "temporal_extent"
CustodianName ||--|o TimeSpan : "name_validity_period"
Next Steps
-
RDF Generation: Regenerate OWL/Turtle files with new TimeSpan relationships
gen-owl -f ttl schemas/20251121/linkml/01_custodian_name_modular.yaml > schemas/20251121/rdf/01_custodian_name.owl.ttl -
Example Instances: Create example YAML instances using
temporal_extentandname_validity_period -
Documentation Update: Update
docs/SCHEMA_MODULES.mdto document TimeSpan usage patterns -
TypeDB Schema: Update TypeDB schema to include TimeSpan relations (manual translation)
References
- CIDOC-CRM E52: https://cidoc-crm.org/html/cidoc_crm_v7.1.3.html#E52
- W3C Time Ontology: https://www.w3.org/TR/owl-time/
- LinkML Schema:
schemas/20251121/linkml/modules/classes/TimeSpan.yaml - PROV-O InstantaneousEvent: Related mapping for temporal events
Author Notes
Implemented by: OpenCODE AI Agent
Date: November 21, 2025
Context: Fixing orphaned TimeSpan class per user request
Status: ✅ Complete - TimeSpan now integrated with CustodianReconstruction and CustodianName