Skip to content

ds*→on* canonical redirect on dataset detail #17

Closed

Description

@neuromechanist

Problem

/dataset/ds002718 returns 404 today even though /dataset/on002718 renders correctly. The catalog has the mirror relationship (on002718 has source_id: "ds002718") and the backend already exposes /datasets/resolve/:sourceId that returns {found, dataset_id}.

Search results, external links from OpenNeuro, and any pre-existing references to the OpenNeuro id should land on the canonical on* page.

Scope

  • Add resolveCanonical(sourceId) helper to `src/lib/api.ts`.
  • In `src/pages/dataset/[id].astro`, when the param matches `^ds[0-9]{6}$`, call resolve first. If found, issue a 301 redirect to `/dataset/`. Otherwise fall through to existing logic (will 404 as today).
  • Pass through any `?v=` and other query params on the redirect.

Out of scope

  • Discover-page dedup (separate issue against nemar-cli list endpoint)
  • Search-engine masking (covered by website#12)
  • Mirror_of column / catalog backfill

Acceptance

  • `/dataset/ds002718` -> 301 -> `/dataset/on002718`
  • `/dataset/ds002718?v=1.0.0` -> 301 -> `/dataset/on002718?v=1.0.0`
  • `/dataset/ds007222` (no on* mirror) -> 404 as today
  • `/dataset/on002718` -> 200 (unchanged)
  • `/dataset/nm000154` -> 200 (unchanged)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions