Implement Eric Kansa's authoritative iSamples queries in Cesium tutorial#29
Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom Oct 31, 2025
Merged
Conversation
Replace previous UNION-based query with Eric's exact implementations from open-context-py/isamples_explore.py: 1. get_samples_at_geo_cord_location_via_sample_event - Path 1 only (backward walk from geo via sample_location) - INNER JOIN for site (required) - Orders by has_thumbnail DESC - Returns sample details, geo coords, site context 2. get_sample_data_via_sample_pid - Get full sample metadata including geo and site - Forward walk from sample via produced_by → event → sample_location 3. get_sample_data_agents_sample_pid - Get agent info (who collected/registered) - Returns responsibility and registrant predicates 4. get_sample_types_and_keywords_via_sample_pid - Get classification keywords and types - Returns keywords, has_sample_object_type, has_material_category Key changes: - Removed UNION approach (was combining Path 1 + Path 2) - Now matches Eric's Path 1-only strategy exactly - Uses list_contains() for backward edge traversal - Updated documentation to explain Path 1-only behavior - Site markers (Path 2 only) correctly return 0 results Tested with: - geoloc_04d6e816218b1a8798fa90b3d1d43bf4c043a57f (PKAP, returns 5 samples) - ark:/28722/k2wq0b20z (sample with 3 agents, 4 keywords) - Python tests verify SQL correctness Source: https://github.com/ekansa/open-context-py/blob/staging/opencontext_py/apps/all_items/isamples/isamples_explore.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the previous UNION-based query approach with Eric Kansa's exact query implementations from
open-context-py/isamples_explore.py.Queries Implemented
✅ 1.
get_samples_at_geo_cord_location_via_sample_eventsample_location)has_thumbnail DESC✅ 2.
get_sample_data_via_sample_pid✅ 3.
get_sample_data_agents_sample_pidresponsibilityandregistrantpredicates✅ 4.
get_sample_types_and_keywords_via_sample_pidkeywords,has_sample_object_type,has_material_categoryKey Changes
Query Strategy
Behavior Changes
geoloc_7a05216d388682536f3e2abd8bd2ee3fb286e461(Larnaka site marker) returns 0geoloc_04d6e816218b1a8798fa90b3d1d43bf4c043a57f(PKAP) returns 5 samplesTesting
Tested all 4 queries with PKAP survey area data:
Files Changed
tutorials/parquet_cesium.qmd(+196, -54 lines)🤖 Generated with Claude Code