Commit graph

114 commits

Author SHA1 Message Date
kempersc
1b1cfbfca0 enrich custodians 2025-12-11 22:32:09 +01:00
kempersc
d4906abae4 update postgis data 2025-12-10 23:51:51 +01:00
kempersc
be3fbac601 enrich entries and persons 2025-12-10 18:04:25 +01:00
kempersc
41959f0766 correct HCID! 2025-12-10 13:01:13 +01:00
kempersc
162ca3ad79 docs: add Rules 13-16 for custodian type annotations, Exa LinkedIn, connection data, photo CDN 2025-12-10 09:04:14 +01:00
kempersc
c4b0f17a43 geocode: complete 100% coverage - add coordinates to final 26 files (CZ, BE, AR, LB, ML) 2025-12-10 01:07:34 +01:00
kempersc
82e58f6d40 geocode: add coordinates to 29 custodian files via Wikidata P131/P159 lookups 2025-12-10 01:04:29 +01:00
kempersc
6e2c36413e geocode: add coordinates to 540 Japanese custodian files using postal codes
- Download GeoNames JP postal code database (142K entries)
- Create geocode_japan_postal.py with postal code lookup
- Handle unicode hyphen variants in postal codes
- Add manual mappings for remote Tokyo islands (Hachijojima, Miyakejima)
- Implement prefix fallback for company postal codes
- Total JP files geocoded: 540 (99.81% coverage)

This brings overall geocoding coverage from 97.84% to 99.81%
2025-12-10 00:27:33 +01:00
kempersc
251b5eee68 geocode: add coordinates to 26 more custodian files
- Improved city name cleaning:
  - Roman numeral district suffixes (Kolín V. -> Kolín)
  - City + country suffixes (Genève 4 - Suisse -> Genève)
  - Czech postal notation (p. Luka nad Jihlavou -> Luka nad Jihlavou)
  - Historical city names (Gottwaldov -> Zlín, renamed 1990)
- Manual mappings for Swiss districts (Lugano Massagno -> Lugano)
2025-12-09 22:47:32 +01:00
kempersc
35e1686160 geocode: add coordinates to 69 custodian files across multiple countries
Countries updated: AR, AT, BG, BR, CA, CL, CN, CU, FI, GE, IR, JO, KG,
KR, LB, LI, LV, MX, MY, NI, NL, PS, PY, SX, TM, VN

- Manual city name mappings for transliteration variants
- St. Pölten -> Sankt Pölten (AT)
- Gaza City -> Gaza (PS)
- Beit Hanoun -> Bayt Hanun (PS)
- Veliko Tarnovo via geonames_id (BG)
2025-12-09 22:44:12 +01:00
kempersc
ef9607d991 geocode: add coordinates to 80 Czech custodian files
- Handle Czech address patterns:
  - House numbers with čp./č.p. prefix
  - X nad/pod Y town names (rivers/landmarks)
  - Hyphenated district names (Město-Část)
  - Trailing numbers and suffixes
2025-12-09 22:41:09 +01:00
kempersc
dee7a4c7d9 geocode: add coordinates to 147 Swiss custodian files
- Improved city name normalization to handle:
  - St. Gallen / St.Gallen -> Sankt Gallen
  - Canton suffixes (Buchs SG, Brugg AG)
  - Hyphenated districts (Bernex - Genève)
  - Postal codes with slashes (Ecublens/VD)
  - German prepositions (Hausen b. Brugg)
- Created scripts/geocode_from_city_name.py for unified geocoding
2025-12-09 22:38:33 +01:00
kempersc
cc61d99acf geocode: add coordinates to BG and EG custodian files
- BG: Add lat/lon from existing GeoNames IDs (28 files)
- EG: Map city codes to GeoNames (CAI→Cairo, ALX→Alexandria, etc.) (28 files)
- Fix malformed EG-IS-\`A\`-O-SCA.yaml → EG-IS-ISM-O-SCA.yaml
- Overall coverage: 96.4% → 96.6%
2025-12-09 21:59:58 +01:00
kempersc
2137c522db geocode: add coordinates to JP compound cities and CZ files from GeoNames
- JP: Handle Gun/Cho/Machi/Mura compound city names (2615 files)
- CZ: Map city codes to GeoNames entries (667 files)
- Overall coverage: 84.5% → 96.4%
2025-12-09 21:49:40 +01:00
kempersc
92b5e58ef3 geocode: add coordinates to AT, BE, DE, GB, PL, UA, US custodian files from GeoNames 2025-12-09 20:38:34 +01:00
kempersc
3a6ead8fde feat: Add legal form filtering rule for CustodianName
- Introduced LEGAL-FORM-FILTER rule to standardize CustodianName by removing legal form designations.
- Documented rationale, examples, and implementation guidelines for the filtering process.

docs: Create README for value standardization rules

- Established a comprehensive README outlining various value standardization rules applicable to Heritage Custodian classes.
- Categorized rules into Name Standardization, Geographic Standardization, Web Observation, and Schema Evolution.

feat: Implement transliteration standards for non-Latin scripts

- Added TRANSLIT-ISO rule to ensure GHCID abbreviations are generated from emic names using ISO standards for transliteration.
- Included detailed guidelines for various scripts and languages, along with implementation examples.

feat: Define XPath provenance rules for web observations

- Created XPATH-PROVENANCE rule mandating XPath pointers for claims extracted from web sources.
- Established a workflow for archiving websites and verifying claims against archived HTML.

chore: Update records lifecycle diagram

- Generated a new Mermaid diagram illustrating the records lifecycle for heritage custodians.
- Included phases for active records, inactive archives, and processed heritage collections with key relationships and classifications.
2025-12-09 16:58:41 +01:00
kempersc
7b42d720d5 geocode: add coordinates to CZ, BY, CH, FR, ES custodian files from GeoNames (1145 files) 2025-12-09 16:41:41 +01:00
kempersc
b54904ad0a fix: normalize YAML null formatting in Eye Filmmuseum file 2025-12-09 16:34:12 +01:00
kempersc
2c25ed6a96 geocode: add coordinates to JP custodian files from GeoNames (batch 2 - remaining 3639 files) 2025-12-09 16:33:29 +01:00
kempersc
9bc454cdbf geocode: add coordinates to JP custodian files from GeoNames (batch 1 - 3000 files) 2025-12-09 16:32:01 +01:00
kempersc
982620ba0c normalize: add canonical location blocks (batch 7 - final)
- Final 42 files updated
- Normalization complete: all 27,511 custodian files have location block
- 15,419 files have coordinates with coordinate_provenance
- 12,092 files have address-only location blocks
2025-12-09 14:57:33 +01:00
kempersc
e28576ee65 normalize: add canonical location blocks (batch 6)
- 2,546 files updated with location blocks
- All 27,511 custodian files now have location: block
- 15,421 files have coordinates with coordinate_provenance
- 12,090 files have address-only location blocks
2025-12-09 14:44:03 +01:00
kempersc
d20978dcbe normalize: add canonical location blocks (batch 5) 2025-12-09 14:39:02 +01:00
kempersc
3f60aa6238 normalize: add canonical location blocks (batch 4 - final) 2025-12-09 14:18:15 +01:00
kempersc
5b3d4d1ed5 normalize: add canonical location blocks (batch 3) 2025-12-09 14:14:13 +01:00
kempersc
b739ad4e61 normalize: add canonical location blocks (batch 2) 2025-12-09 13:28:59 +01:00
kempersc
bb41287730 normalize: add canonical location blocks (batch 1) 2025-12-09 13:17:11 +01:00
kempersc
fade1ed5b3 fix: add safety measures to prevent data loss during enrichment
Key changes:
- Created scripts/lib/safe_yaml_update.py with PROTECTED_KEYS constant
- Fixed enrich_custodians_wikidata_full.py to re-read files before writing
  (prevents race conditions where another script modified the file)
- Added safety check to abort if protected keys would be lost
- Protected keys include: location, original_entry, ghcid, provenance,
  google_maps_enrichment, osm_enrichment, etc.

Root cause of data loss in 62fdd35321:
- Script loaded files into list, then processed them later
- If another script modified files between load and write, changes were lost
- Now files are re-read immediately before modification

Per AGENTS.md Rule 5: NEVER Delete Enriched Data - Additive Only
2025-12-09 12:27:09 +01:00
kempersc
a7321b1bb9 reconstruct location blocks 2025-12-09 12:25:16 +01:00
kempersc
85a951bbea normalize: add canonical location blocks to 586 files
- Fixed 469 JP files missing location: blocks (had data in original_entry.locations)
- Fixed 117 additional JP files found in second pass
- 1 EG file skipped (no location source data available)
- Total files with location: blocks now 27,459 out of 27,511 (99.8%)
- Also includes YAML formatting standardization (line wrapping)

Recovery from data loss in commit 62fdd35321 is now complete.
2025-12-09 12:17:34 +01:00
kempersc
cab712659d recover location blocks 2025-12-09 11:34:56 +01:00
kempersc
62fdd35321 Refactor code structure for improved readability and maintainability 2025-12-09 11:15:51 +01:00
kempersc
b61271220b enrich entries 2025-12-09 10:46:43 +01:00
kempersc
bf7c773955 edit Japanese entries 2025-12-09 09:16:19 +01:00
kempersc
c283daa1a2 normalise dutch entries 2025-12-09 08:02:27 +01:00
kempersc
609866886a enrich entries 2025-12-09 07:58:14 +01:00
kempersc
131e3ca259 normalise custodian entries 2025-12-09 07:56:35 +01:00
kempersc
0938cce6cf feat(loaders): update DuckLake and TypeDB loaders with relation support 2025-12-08 15:00:14 +01:00
kempersc
486bbee813 feat(wikidata): add re-enrichment and duplicate removal scripts
- Add reenrich_wikidata_with_verification.py for re-running enrichment
- Add remove_wikidata_duplicates.py for deduplication
2025-12-08 14:59:38 +01:00
kempersc
891692a4d6 feat(ghcid): add diacritics normalization and transliteration scripts
- Add fix_ghcid_diacritics.py for normalizing non-ASCII in GHCIDs
- Add resolve_diacritics_collisions.py for collision handling
- Add transliterate_emic_names.py for non-Latin script handling
- Add transliteration tests
2025-12-08 14:59:28 +01:00
kempersc
6a6557bbe8 feat(enrichment): add emic name enrichment and update CustodianName schema
- Add emic_name, name_language, standardized_name to CustodianName
- Add scripts for enriching custodian emic names from Wikidata
- Add YouTube and Google Maps enrichment scripts
- Update DuckLake loader for new schema fields
2025-12-08 14:58:50 +01:00
kempersc
35066eb5eb fix(typedb): improve concept serialization for frontend compatibility
- Add 'type' alias alongside '_type' for frontend compatibility
- Handle both bytes and string IID formats from driver
- Add 'id' alias alongside '_iid' for consistency
2025-12-08 14:58:35 +01:00
kempersc
271545fa8b docs: add Z.AI GLM API and transliteration rules to AGENTS.md
- Add Rule 11 for Z.AI Coding Plan API usage (not BigModel)
- Add transliteration standards for non-Latin scripts
- Document GLM model options and Python implementation
2025-12-08 14:58:22 +01:00
kempersc
40bd3cb8f5 data(custodian): add emic_name fields and remove duplicate files with name suffixes
- Add emic_name, name_language, and standardized_name to 1,781 custodian files
- Remove 2,239 duplicate files that had name suffixes in filename
- Consolidate data into base GHCID files per PID stability rules
- Part of UNESCO Memory of the World custodian enrichment
2025-12-08 14:57:34 +01:00
kempersc
13f67bed19 feat(frontend): add graph visualization and data explorer features
Database Panels:
- Add D3.js force-directed graph visualization to Oxigraph and TypeDB panels
- Add 'Explore' tab with class/entity browser, graph/table toggle, and search
- Add data explorer to PostgreSQL panel with table browser, pagination, search, export
- Fix SPARQL variable naming bug in Oxigraph getGraphData() function
- Add node details panel showing selected entity attributes
- Add zoom/pan controls and node coloring by entity type

Map Features:
- Add TimelineSlider component for temporal filtering of institutions
- Support dual-handle range slider with decade histogram
- Add quick presets (Ancient, Medieval, Modern, Contemporary)
- Show institution density visualization by founding decade

Hooks:
- Extend useOxigraph with getGraphData() for graph visualization
- Extend useTypeDB with getGraphData() for graph visualization
- Extend usePostgreSQL with getTableData() and exportTableData()
- Improve useDuckLakeInstitutions with temporal filtering support

Styles:
- Add HeritageDashboard.css with shared panel styling
- Add TimelineSlider.css for timeline component styling
2025-12-08 14:56:17 +01:00
kempersc
7e3559f7e5 add new entries 2025-12-07 23:08:02 +01:00
kempersc
57c743b005 refactor(frontend): fetch NL municipalities from PostGIS API instead of static file
Replace static netherlands_municipalities_simplified.geojson with dynamic
PostGIS API call to /boundaries/countries/NL/admin2/geojson.

Transform API response properties to expected format:
- API: {code, name, name_local, admin1_code, admin1_name}
- Expected: {code, naam, provincieCode, provincieNaam}

This ensures NL boundary data comes from the authoritative PostGIS
database rather than a static file that could become outdated.
2025-12-07 19:48:07 +01:00
kempersc
12965071be fix(frontend): improve DuckLake connection detection in map page
Wait for DuckLake loading to complete before deciding whether to use
DuckLake data or fallback to static JSON. Prevents race conditions.
2025-12-07 19:23:12 +01:00
kempersc
1981dc28ed fix(frontend): normalize org_type names to letter codes in DuckLake hook
DuckLake stores full names like 'MUSEUM' but map expects single-letter
codes like 'M' for color styling. Also includes CSS fixes for Database page.
2025-12-07 19:21:58 +01:00
kempersc
18874e6070 fix(scripts): normalize org_type codes in DuckLake loader
- Handle single-letter GLAM type codes (G, L, A, M, O, R, C, etc.)
- Handle legacy GRP.HER.* format
- Support compound types like 'M,F' -> 'MUSEUM,FEATURES'
- Fix type hint syntax for Python 3.10+
2025-12-07 19:21:14 +01:00