Skip to content

Conversation

@rdhyee
Copy link
Contributor

@rdhyee rdhyee commented Oct 31, 2025

Implements interactive 3D geospatial visualization with DuckDB-WASM queries against OpenContext parquet data.

Features

  • Click any point to query all samples at that geographic location
  • Color-coded points by semantic role:
    • 🔵 Blue: sample_location (precise field collection points)
    • 🟣 Purple: site_location (administrative site markers)
    • 🟠 Orange: dual-purpose (both Path 1 and Path 2)
  • Interactive queries: Browser-based DuckDB-WASM against 691MB remote parquet
  • Property graph traversal: Implements both Path 1 and Path 2 patterns
  • PKAP Survey Area demo: Centered on Cyprus archaeological site
  • Comprehensive documentation: Explains PQG model, query patterns, relationship paths

Technical Implementation

  • 857 lines of Observable JavaScript + DuckDB-WASM
  • Cesium 3D terrain visualization
  • Reactive queries triggered by map clicks
  • HTTP range requests for efficient remote data access
  • Zero installation required - runs entirely in browser

Demo

Opens on PKAP Survey Area near Cyprus. Click any colored point to see:

  • Geographic location details
  • All samples collected at that coordinate
  • Sample metadata (thumbnails, descriptions, site context)
  • Event and site relationships

Ready for deployment to isamples.org.

rdhyee and others added 5 commits October 30, 2025 17:23
…sium tutorial

Phase 1 (documentation only - no code changes):
- Added "Why Path 1 and Path 2?" explanation with clear diagrams
- Added full relationship map showing Agent and IdentifiedConcept paths
- Added Eric's query pattern analysis from open-context-py
- Documented all 4 query functions with path requirements and summary table
- Added local parquet file access instructions for faster development

Key improvements:
- Users now understand the property graph structure before seeing queries
- Clear distinction between geographic paths vs agent/concept paths
- Explains INNER JOIN implications (both paths required)
- Documents reverse query pattern (geo → samples)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
… parquet_cesium tutorial

Implemented Eric Kansa's combined query function that unifies Path 1 and Path 2
with richer sample metadata. This complements the existing separate path queries
by providing a comprehensive view of all samples at a location.

New features:
- Added get_samples_at_geo_cord_location_via_sample_event() function
  - Combines Path 1 (direct event location) and Path 2 (via site) using UNION
  - Returns enriched metadata: sample_pid, sample_label, sample_description,
    thumbnail_url, alternate_identifiers, event_label, site_label, site_pid
  - Uses LEFT JOIN for sites in Path 1 (optional), INNER JOIN in Path 2 (required)
  - Orders results by thumbnail availability for better visual browsing

- Added selectedSamplesCombined reactive cell with loading state management
- Added new display section "Combined Samples at Location" with documentation
- Added combinedLoading flag to track query state

Architecture:
- Preserves existing get_samples_1() and get_samples_2() functions unchanged
- Adds parallel implementation for comparison and exploration
- Maintains consistent pattern with existing loading indicators and error handling

This enables users to see both simple (Path 1/Path 2 separate) and comprehensive
(combined with rich metadata) views of samples at clicked locations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Set initial camera view to Italy bounding box (6.6-18.8°E, 36.6-47.1°N)
- Configure Home button to reset to Italy instead of global view
- Use postRender event listener to apply camera after first render
- Prevents resize/tab visibility issues with early camera positioning

This provides a more useful default view for the OpenContext dataset,
which is heavily concentrated in Mediterranean archaeological sites.

Also update .gitignore to exclude Quarto intermediate files (*.quarto_ipynb).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Center on PKAP Survey Area coordinates (34.987406°N, 33.708047°E)
- Use 0.3° padding around point for better context
- Update Home button to reset to PKAP instead of Italy
- Add OpenContext source URL in comment for reference

PKAP (Palaepaphos-Kouklia Archaeological Project) is a better demonstration
site as it showcases the multi-location survey pattern with 15,446 events
across 544 different geographic coordinates within the survey area.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
MAJOR FEATURE: Geographic locations now color-coded by semantic role

Query Changes:
- Add CTE to classify GeospatialCoordLocations by usage type
- Join with edges to determine sample_location vs site_location usage
- Return location_type field: 'sample_location_only', 'site_location_only', 'both'

Visualization Changes:
- Blue (3px): sample_location_only - precise field collection points (Path 1)
- Purple (6px): site_location_only - administrative site markers (Path 2)
- Orange (5px): both - dual-purpose locations (~10k geos)

Implementation Details:
- Use Cesium.Color.fromCssColorString() for hex colors (#2E86AB, #A23B72, #F18F01)
- Conditional styling per point based on location_type
- Updated Data tab table header to show location_type column

Documentation Updates:
- Changed "Future Enhancement" to "✅ IMPLEMENTED"
- Added color legend with emoji indicators
- Updated SQL example to use 'nodes' table (not 'pqg')
- Documented performance impact (minimal)
- Listed future enhancements (UI filters, Site Explorer Mode)

Benefits:
- Makes Path 1 vs Path 2 distinction visually concrete
- Users can SEE semantic difference between precise and administrative locations
- Transforms visualization into pedagogical tool for understanding iSamples model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rdhyee rdhyee merged commit d0f9325 into isamplesorg:main Oct 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant