Skip to content

[DT-4061] Add similar and frequently-requested-with study recommendations - #3054

Open
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-dar-metricsfrom
otchet-dt-4061-study-recommendations
Open

[DT-4061] Add similar and frequently-requested-with study recommendations#3054
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-dar-metricsfrom
otchet-dt-4061-study-recommendations

Conversation

@otchet-broad

Copy link
Copy Markdown
Contributor

Base: branch 4 · 11 files, +447 · Migration: no · UI impact: none

Adds GET /api/metrics/study-recommendations/{studyId}/similar and GET /api/metrics/study-recommendations/{studyId}/frequently-requested-with. Both
return at most 12 publicly visible studies with their dataset counts.

"Similar" matches on a shared PI or at least one overlapping data type,
ranked by the size of the data type overlap plus a point for the PI match. A
blank pi_name is not an identity, so it never matches another blank one.

"Frequently requested with" ranks candidates by how often they appeared in
the same data access request as the source study. Only submitted,
non-archived, non-progress-report DARs score, and the reasons are worth
checking: a draft cart is not a request, an archived DAR should stop
counting, and a progress report carries its own reference_id, so counting
one would score its parent DAR more than once.

Both queries restrict candidates to public_visibility = TRUE, so a
recommendation never leaks the existence of a private study, and the source
study goes through verifyStudyVisibilityAccess.

No migration, no change to any existing response.

Depends on: branch 4 (extends MetricsService / MetricsResource).


Where this sits in the DT-4061 stack

otchet-dt-3990-study-ratings-pi-details was too large to review meaningfully
(95 files, +8168), so it was split into eight PRs. This PR targets otchet-dt-4061-study-dar-metrics,
not develop
, so its diff shows only its own work.

# Branch Base
1 otchet-dt-4061-study-visibility-authz develop
1b otchet-dt-4061-study-patch-ownership otchet-dt-4061-study-visibility-authz
2 otchet-dt-4061-study-pi-details otchet-dt-4061-study-visibility-authz
3 otchet-dt-4061-study-comments otchet-dt-4061-study-pi-details
4 otchet-dt-4061-study-dar-metrics otchet-dt-4061-study-comments
5 otchet-dt-4061-study-recommendationsthis PR otchet-dt-4061-study-dar-metrics
6 otchet-dt-4061-study-asset-fields otchet-dt-4061-study-recommendations
7 otchet-dt-4061-study-asset-endpoints otchet-dt-4061-study-asset-fields

Branch 1b is a sibling rather than a link in the chain: nothing depends on it,
so it can be held or dropped without blocking the others. Land the numbered
chain in order — merging out of order, or squash-merging, will require rebasing
the descendants.

The split is verified lossless: branch 7 plus 1b reproduces the original branch
exactly, apart from five scripts/verify-study-*.sh helper scripts that were
dropped at the author's request. ./mvnw test-compile passes on each branch
independently.

🤖 Generated with Claude Code

@otchet-broad
otchet-broad marked this pull request as ready for review September 8, 2026 20:45
@otchet-broad
otchet-broad requested a review from a team as a code owner September 8, 2026 20:45
@otchet-broad
otchet-broad requested review from fboulnois and rushtong and removed request for a team September 8, 2026 20:45
…ions

Adds GET /api/metrics/study-recommendations/{studyId}/similar and GET
/api/metrics/study-recommendations/{studyId}/frequently-requested-with.
Both return at most 12 publicly visible studies with their dataset counts.

"Similar" matches on a shared PI or at least one overlapping data type,
ranked by the size of the data type overlap plus a point for the PI match.
A blank pi_name is not an identity, so it never matches another blank one.

"Frequently requested with" ranks candidate studies by how often they
appeared in the same data access request as the source study. Only
submitted, non-archived, non-progress-report DARs score: a draft cart is
not a request, an archived DAR should stop counting, and a progress report
carries its own reference_id, so counting one would score its parent DAR
more than once.

Both queries restrict candidates to public_visibility = TRUE, so a
recommendation never leaks the existence of a private study, and the source
study itself goes through DatasetService#verifyStudyVisibilityAccess.

No migration and no change to any existing response.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 2014320 to e31cd4a Compare September 8, 2026 21:58
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-recommendations branch from 37de009 to f7668a1 Compare September 8, 2026 21:58
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