Skip to content

Use reference URLs for resource visuals - #7

Merged
ewlarson merged 1 commit into
developfrom
feature/reference-visuals-from-dct-references
Jun 12, 2026
Merged

Use reference URLs for resource visuals#7
ewlarson merged 1 commit into
developfrom
feature/reference-visuals-from-dct-references

Conversation

@ewlarson

@ewlarson ewlarson commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Use dct_references_s http://schema.org/thumbnailUrl / https://schema.org/thumbnailUrl as a fallback thumbnail source only when no distribution-derived thumbnail source is present.
  • Use structured distribution hasMap values first, then legacy dct_references_s http://schema.org/hasMap / https://schema.org/hasMap, before falling through to generated static-map or placeholder/default behavior.
  • Carry distribution context into resource static-map presentation and compatibility routes so structured rows remain authoritative.
  • Add regression coverage for distribution-first, legacy-reference-second visual source selection.

Validation

  • BTAA_SKIP_TEST_DB=1 python -m pytest backend/tests/services/test_static_map_service.py::test_external_static_map_url_reads_schema_has_map_from_dct_references_string backend/tests/services/test_static_map_service.py::test_external_static_map_url_accepts_https_schema_has_map_dict_value backend/tests/services/test_static_map_service.py::test_external_static_map_url_prefers_distribution_has_map_over_dct_references backend/tests/services/test_static_map_service.py::test_external_static_map_url_ignores_non_http_has_map_values backend/tests/services/test_image_service.py::TestImageServiceThumbnailSourceURL::test_get_thumbnail_source_url_prefers_distribution_thumbnail_over_dct_references backend/tests/services/test_image_service.py::TestImageServiceThumbnailURL::test_get_thumbnail_source_url_checks_dct_references_when_distributions_exist backend/tests/api/v1/test_static_map_endpoints.py::TestResourceStaticMapEndpoint::test_resource_static_map_uses_schema_has_map_before_generated_alias backend/tests/api/v1/test_static_map_endpoints.py::TestResourceStaticMapEndpoint::test_resource_static_map_latest_alias_redirects_when_no_schema_has_map backend/tests/api/v1/test_static_map_endpoints.py::TestResourceStaticMapEndpoint::test_resource_static_map_no_cache_uses_schema_has_map backend/tests/api/v1/test_resource_presenter.py::test_resource_presenter_static_map_uses_schema_has_map_without_geometry backend/tests/api/v1/test_resource_presenter.py::test_resource_presenter_static_map_prefers_distribution_has_map_over_legacy_reference backend/tests/api/v1/test_utils.py::TestHotVisualAssetUrls::test_reference_static_map_url_uses_schema_has_map_without_geometry backend/tests/api/v1/test_utils.py::TestHotVisualAssetUrls::test_reference_static_map_url_prefers_distribution_has_map_over_legacy_reference
  • python -m ruff check backend/app/services/static_map_service.py backend/app/services/image_service.py backend/app/api/v1/endpoint_modules/resources/static_map.py backend/app/api/v1/utils.py backend/app/api/v1/presenters/resource.py backend/tests/services/test_static_map_service.py backend/tests/services/test_image_service.py backend/tests/api/v1/test_static_map_endpoints.py backend/tests/api/v1/test_resource_presenter.py backend/tests/api/v1/test_utils.py
  • python -m py_compile backend/app/services/static_map_service.py backend/app/services/image_service.py backend/app/api/v1/endpoint_modules/resources/static_map.py backend/app/api/v1/utils.py backend/app/api/v1/presenters/resource.py
  • git diff --check -- backend/app/services/static_map_service.py backend/app/services/image_service.py backend/app/api/v1/endpoint_modules/resources/static_map.py backend/app/api/v1/utils.py backend/app/api/v1/presenters/resource.py backend/tests/services/test_static_map_service.py backend/tests/services/test_image_service.py backend/tests/api/v1/test_static_map_endpoints.py backend/tests/api/v1/test_resource_presenter.py backend/tests/api/v1/test_utils.py

Note: the broader focused suite reached 164 passed and then failed 5 existing image-service tests because sandboxed Redis access to localhost:6380 was denied with Operation not permitted; the new static-map endpoint/presenter/util tests passed in that run.

@ewlarson
ewlarson force-pushed the feature/reference-visuals-from-dct-references branch from 7290bd2 to 44d3405 Compare June 12, 2026 13:52
@ewlarson
ewlarson force-pushed the feature/reference-visuals-from-dct-references branch from 44d3405 to 185af60 Compare June 12, 2026 14:08
@ewlarson
ewlarson marked this pull request as ready for review June 12, 2026 14:15
@ewlarson
ewlarson merged commit e6cf726 into develop Jun 12, 2026
1 check passed
@ewlarson
ewlarson deleted the feature/reference-visuals-from-dct-references branch August 21, 2026 14:04
ewlarson added a commit that referenced this pull request Aug 21, 2026
…t-references

Use reference URLs for resource visuals
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