glam/frontend
kempersc b905b6bbb0 Add new slot definitions for refer_to, remove, reported_on, signed_by, and specified_as
- Introduced `refer_to` slot to link identifiers to entities, with ontology alignment to CIDOC-CRM and DCTerms.
- Added `remove` slot for recording objects removed during deaccessioning, aligned with CIDOC-CRM properties.
- Created `reported_on` slot to capture URIs of reports documenting entities, with mappings to CIDOC-CRM and Schema.org.
- Implemented `signed_by` slot to identify individuals who signed documents, referencing RiC-O and Schema.org.
- Established `specified_as` slot to indicate the precision level of place references, with broad mappings to CRM and DQV.
2026-02-10 23:34:46 +01:00
..
data/sample-rdf
public Add new slot definitions for refer_to, remove, reported_on, signed_by, and specified_as 2026-02-10 23:34:46 +01:00
scripts Refactor StorageCondition schema: Migrate compliance_status to has_or_had_status with ComplianceStatus class 2026-01-22 16:22:16 +01:00
src Add new classes and slots to the ontology 2026-01-27 22:17:11 +01:00
tests
.env.production
.gitignore
COMMANDS.md
eslint.config.js
FILES_CREATED.md
FOUNDATION_COMPLETE.md
FRONTEND_PROGRESS.md
GRAPH_VIZ_FEATURE_CHECKLIST.md
GRAPH_VIZ_PHASE1_COMPLETE.md
index.html
INDEX.md
INTEGRATION_GUIDE.md
NDE_HEADER_STYLING_COMPLETE.md
NDE_HOUSE_STYLE_APPLIED.md
NEXT_STEPS.md
OXIGRAPH_STATUS.md
package-lock.json
package.json Implement scripts for schema modifications and ontology verification 2026-01-29 17:10:25 +01:00
PHASE3_HISTORY_COMPLETE.md
PHASE3_PERSISTENT_UI_STATE_COMPLETE.md
PHASE3_STATE_MANAGEMENT.md
PHASE3_TASK6_COMPLETE.md
PHASE3_TASK6_QUERY_BUILDER.md
PHASE3_TASK7_PLAN.md
PHASE3_TASK7_PROGRESS.md
PROGRESS_DASHBOARD.md
README.md
SESSION_SUMMARY.md
SESSION_SUMMARY_TASK5.md
STEP1_COMPLETE.md
TASK6_SUMMARY.md
TASK7_COMPLETION_SUMMARY.md
TASK7_FINAL_STATUS.md
TASK7_HANDOFF.md
TASK7_QUICK_TEST.md
TDD_SESSION_FIXES.md
TESTING_TASK7.md
TRIPLESTORE_DECISION_SUMMARY.md
TRIPLESTORE_OXIGRAPH_SETUP.md
tsconfig.app.json
tsconfig.json
tsconfig.node.json
VISUALIZATION_COMPLETE.md
vite.config.ts
yarn.lock

GLAM Heritage Custodian Frontend

Modern React frontend for visualizing and managing RDF transformation results from the GLAM Heritage Custodian Ontology project.

🎯 Project Overview

This frontend application provides interactive visualization of archival RDF data (EAD → RiC-O transformations) with force-directed graphs, bidirectional relationship exploration, and comprehensive metadata display.

Migrated from: example_ld (jQuery + vanilla JS) → React 19 + TypeScript + D3 v7

🚀 Quick Start

# Install dependencies
npm install

# Run development server
npm run dev
# Open http://localhost:5173

# Run tests
npm run test        # Watch mode
npm run test:ui     # UI with @vitest/ui
npm run test:run    # Single run
npm run test:coverage  # With coverage

# Build for production
npm run build

# Preview production build
npm run preview

📁 Project Structure

src/
├── components/          # React components
│   ├── layout/         # Layout components
│   ├── visualizations/ # D3 visualizations
│   │   ├── GraphView/  # Force-directed graph
│   │   ├── Timeline/   # Timeline visualization
│   │   ├── Map/        # Geographic map
│   │   └── Hierarchy/  # Hierarchical tree
│   ├── forms/          # Form components
│   └── ui/             # Reusable UI components
├── lib/                # Core libraries
│   ├── rdf/           # RDF parsing and graph utilities
│   ├── storage/       # IndexedDB manager
│   ├── api/           # API client
│   └── utils/         # Utility functions
├── hooks/             # Custom React hooks
├── stores/            # Zustand state stores
├── types/             # TypeScript type definitions
├── pages/             # Page components
└── styles/            # Global styles

tests/
├── unit/              # Unit tests
├── integration/       # Integration tests
└── e2e/               # E2E tests (Playwright)

🧪 Testing

Test coverage: ~85% (target: 80%+)

Test Files

  • tests/unit/rdf-parser.test.ts - RDF parsing tests (N-Triples, Turtle)
  • tests/unit/graph-utils.test.ts - Graph utility function tests

Running Tests

# All tests in watch mode
npm run test

# Single run (CI/CD)
npm run test:run

# With coverage report
npm run test:coverage

# Interactive UI
npm run test:ui

📦 Key Dependencies

Production

  • React 19.2.0 - UI framework
  • TypeScript 5.9.3 - Type safety
  • D3.js 7.9.0 - Data visualization
  • n3 1.26.0 - RDF parsing
  • Zustand 5.0.8 - State management
  • React Query 5.90.10 - Data fetching
  • React Router 7.9.6 - Routing
  • Leaflet 1.9.4 - Maps
  • Axios - HTTP client
  • date-fns - Date utilities
  • lodash - Utility functions

Development

  • Vite 7.2.4 - Build tool
  • Vitest 4.0.13 - Unit testing
  • Playwright 1.56.1 - E2E testing
  • Testing Library - React testing utilities
  • ESLint - Linting
  • Prettier - Code formatting

🎨 Features

Implemented

  • IndexedDB storage for large RDF files
  • N-Triples RDF parser
  • Turtle RDF parser
  • Graph utility functions
  • React hooks for data management
  • Type-safe TypeScript interfaces
  • Comprehensive test suite

In Progress 🚧

  • Force-directed graph visualization (D3.js)
  • Bidirectional edge interaction
  • Upload form component
  • Results display component

Planned 📋

  • Timeline visualization
  • Geographic map view
  • Hierarchical tree view
  • Statistics dashboard
  • Export functionality
  • Search and filtering

🔧 Development

Path Aliases

TypeScript path aliases are configured for clean imports:

import { parseNTriples } from '@/lib/rdf/parser';
import { useDatabase } from '@/hooks/useDatabase';
import type { GraphNode } from '@/types/rdf';

API Proxy

Development server proxies /api/* requests to backend at http://localhost:8000.

Environment Setup

# Node.js version
node --version  # v24.5.0+

# npm version
npm --version   # 11.5.1+

📚 Documentation

Comprehensive documentation available in /docs/plan/frontend/:

  1. 00-overview.md - Master implementation plan
  2. 01-architecture.md - System architecture (4-layer design)
  3. 02-design-patterns.md - 17 design patterns with examples
  4. 03-tdd-strategy.md - Test-driven development strategy
  5. 04-example-ld-mapping.md - Migration mapping from example_ld
  6. 05-master-checklist.md - 80-day task breakdown
  7. 06-visual-roadmap.md - Visual timeline and diagrams
  8. 07-quick-start-guide.md - 15-minute setup guide

🎓 Learning Resources

Example Project

Original implementation: /Users/kempersc/apps/example_ld/

Key files migrated:

  • static/js/db.jssrc/lib/storage/indexed-db.ts
  • static/js/graph.jssrc/lib/rdf/parser.ts + src/lib/rdf/graph-utils.ts
  • static/js/app.js → (React components, in progress)

Technologies

🤝 Contributing

Code Style

  • TypeScript: Strict mode enabled
  • Linting: ESLint + Prettier
  • Tests: Required for new features (80%+ coverage)
  • Commits: Conventional commits format

Development Workflow

  1. Create feature branch
  2. Write tests (TDD approach)
  3. Implement feature
  4. Run tests: npm run test:run
  5. Run linter: npm run lint
  6. Create pull request

📊 Project Status

Current Phase: Week 1-2 Foundation (60% complete)

Component Status Coverage
Type Definitions Complete 100%
IndexedDB Manager Complete 95%
RDF Parser Complete 90%
Graph Utilities Complete 85%
React Hooks 🟡 In Progress 30%
Visualizations Not Started 0%
UI Components Not Started 0%

Next Milestone: Force-directed graph visualization (Week 3-4)

🐛 Known Issues

None currently - project is in early development phase.

📝 License

Part of the GLAM Heritage Custodian Ontology project.

📞 Support

For questions or issues, refer to:

  • Project documentation in /docs/plan/frontend/
  • Session summary: SESSION_SUMMARY.md
  • Master checklist: /docs/plan/frontend/05-master-checklist.md

Version: 0.1.0 (Foundation Phase)
Last Updated: 2024-11-22
Status: 🚧 Active Development